bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core dump on variable length array compilation


From: Rajeev Kumar Singh
Subject: Core dump on variable length array compilation
Date: Thu, 14 Mar 2002 21:46:00 -0800

It seems that if we use the "C" extension of variable length array in a C++
program sometimes the compiler crashes and dumps core. Interestingly it
happens under some very unique circumstances. So in our complete build if we
only remove the object corresponding to the erroneous file and compile or
individually compile that file it works. However if we give a top level make
which builds all objects and libraries then it crashes on my machine. But
the same build on some other machines/Clear case views compiles through
without problem. 

We are using vxWorks environment from WindRiver for a Motorola PPC-8240
processor and compiling on a NT 4.0 workstation. I will include the code
snippet where the problem is and the core dump file generated with it. The
compile options and make command error print is as follows. 

ccppc -B\Vendor\Tornado/host/x86-win32/lib/gcc-lib/ -mstrict-align -ansi
-nostdi
nc -DRW_MULTI_THREAD -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope
-I/h
-I../inc -I../../common/inc -I../../../../nms/rli/inc -I../../rb_session/inc
-I.
./../../common/inc -I../../../../common/inc -I../../../../common/asp/inc
-I../..
/../../../bsp/cric/8240/inc -I../../../../../bsp/common/pfc/inc
-I../../../../..
/common/inc -I../../../NetworkLayer/Lapd/inc
-I../../../NetworkLayer/GroupDemo/i
nc -I../../../NetworkLayer/GroupDemo/inc -I../../../netMan/inc
-I../../Distribut
or/inc -I. -I\Vendor\Tornado\target\config\all -I\Vendor\Tornado\target/h
-I\Ven
dor\Tornado\target/src/config -I\Vendor\Tornado\target/src/drv -DCPU=PPC603
-g
 -DRFN_USING_51MHZ -DRFN_CRIC -DRFN_DEBUG  -DINCLUDE_SHOW_BR -DRFN_DEBUG  -c
../
src/rb1102MsgClasses.cpp
(Z:\Vendor\Tornado\host\x86-win32\lib\gcc-lib\powerpc-wrs-vxworks\cygnus-2.7
.2-9
60126\cc1plus.exe 1000) Exception: STATUS_ACCESS_VIOLATION
(Z:\Vendor\Tornado\host\x86-win32\lib\gcc-lib\powerpc-wrs-vxworks\cygnus-2.7
.2-9
60126\cc1plus.exe 1000) Dumping stack trace to cc1plus.exe.core
ccppc: Internal compiler error: program cc1plus got fatal signal 0
make[4]: *** [rb1102MsgClasses.o] Error 0x1
make[4]: Leaving directory `Z:\sw\apps\iden\isc_if\rb_controller\obj'
make[3]: *** [rbControllerSt] Error 0x2
make[3]: Leaving directory `Z:\sw\apps\iden\isc_if\rb_controller\obj'
make[2]: ***
[../../../../apps/iden/isc_if/rb_controller/obj/rbControllerSt.o] E
rror 0x2
make[2]: Leaving directory `Z:\SW\bsp\cric\8240\src'
make[1]: *** [vxcric.st] Error 0x2
make[1]: Leaving directory `Z:\SW\bsp\cric\8240\src'
make: *** [cric.st] Error 0x2


The piece of code that was causing this problem is following. 

STATUS msg1102Header_c::sendRFAdjustReq ( UINT8* pMac, char* pData, UINT32
len )
{

   char    buf[len + 2];  // Makes compiler to crash with core dump in some
cases 
   // char    buf[50 + 2]; // This declaration compiles OK 
   STATUS  rvalu;

   // set up the RF adjust header
   buf[0] = 0x60;
   buf[1] = 0x00;

   // copy the data over
   for ( UINT32 i = 0; i < len; i++ )
      buf[i+2] = pData[i];

   rvalu = enetSend( (char*) &buf,
                     sizeof(buf),
                     pMac,
                     glbEnetAddr,
                     FPGA_ETHERNET_CMD_TYPE,
                     PAD_OFF,
                     0
                  );

   return rvalu;

}

And the core dump file is attached as an attachment. 

 <<cc1plus.exe.core>> 


Rajeev Singh
Radio Frame Networks
(425) 883 2088 Ext. 121

Attachment: cc1plus.exe.core
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]