Sender: david AT df DOT lth DOT se (David Svensson) Date: Sun, 28 Aug 1994 15:16:07 +0200 (MET DST) From: David Svensson Sender: David Svensson Reply-To: David Svensson Subject: Possible bug in cc1plus in 1.12 To: DJGPP list I have found what I believe to be a bug in the C++ part of the compiler. Whenever the compiler finds an undeclared variable it prints the error messages properly and then hangs with a segmentation fault. This behavior is not present in the standard C part of the compiler. I have included a sample file provoking this error at the end of this document as well as the compiler output and the coredump file. The GO32 variable used was: GO32=ansi core core.log 2r1 The sample was compiled by: gcc test3.cc -o test3.o -v >gcc.err GO32 reports 4672 Kb free VCPI. I'm running dos 6.2 with emm386 installed without EMS support. Does anyone out there have any clues as to what causes this problem? David ------------ test3.cc ----------------- int main(void) { a=1; return 0; } ------------ compiler output ---------- Reading specs from p:/lib/specs gcc version 2.6.0 p:/bin/cpp.exe -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=6 -Dunix -Di386 -DGO32 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__MSDOS test3.cc E:\TMP/cc000063 GNU CPP version 2.6.0 (80386, BSD syntax) #include "..." search starts here: #include <...> search starts here: p:/cplusinc p:/include p:/contrib/include /usr/local/lib/g++-include /usr/local/include /usr/local/go32/include /usr/local/lib/gcc-lib/go32/2.6.0/include /usr/include End of search list. p:/bin/cc1plus.exe E:\TMP/cc000063 -quiet -dumpbase test3.cc -version -o E:\TMP/cca00063 GNU C++ version 2.6.0 (80386, BSD syntax) compiled by GNU C version 2.6.0. test3.cc: In function `int main()': test3.cc:3: `a' undeclared (first use this function) test3.cc:3: (Each undeclared identifier is reported only once test3.cc:3: for each function it appears in.) Segmentation violation in pointer 0x00000405 at d8:566d5 EXCEPTION OCCURRED! Information dumped to core file: "core.log" ------------ core.log ----------------- ==================== eax=00184e30 ebx=00184e30 ecx=00184e30 edx=00000401 esi=00184e30 edi=00184e30 ebp=7ffff65c esp=7ffff628 cs=d8 ds=48 es=48 fs=48 gs=38 ss=48 cr2=00000405 Call frame traceback EIPs: 0x000566d5 0x0004a47a 0x00073689 0x0007839b Contents of stack: stack[0x7ffff628] = 0x000000d3 stack[0x7ffff62a] = 0xf7200000 stack[0x7ffff62c] = 0x7ffff720 stack[0x7ffff62e] = 0x4e307fff stack[0x7ffff630] = 0x00184e30 stack[0x7ffff632] = 0x9ca00018 stack[0x7ffff634] = 0x00079ca0 stack[0x7ffff636] = 0xa6b00007 stack[0x7ffff638] = 0x0018a6b0 stack[0x7ffff63a] = 0x003b0018 stack[0x7ffff63c] = 0x0000003b stack[0x7ffff63e] = 0xf6680000 stack[0x7ffff640] = 0x7ffff668 stack[0x7ffff642] = 0x4e307fff stack[0x7ffff644] = 0x00184e30 stack[0x7ffff646] = 0x4e300018 stack[0x7ffff648] = 0x00184e30 stack[0x7ffff64a] = 0x4e300018 stack[0x7ffff64c] = 0x00184e30 stack[0x7ffff64e] = 0xa6b00018 stack[0x7ffff650] = 0x0018a6b0 stack[0x7ffff652] = 0x03820018 stack[0x7ffff654] = 0x00000382 stack[0x7ffff656] = 0xf7200000 stack[0x7ffff658] = 0x7ffff720 stack[0x7ffff65a] = 0xfba87fff stack[0x7ffff65c] = 0x7ffffba8 stack[0x7ffff65e] = 0xa47a7fff stack[0x7ffff660] = 0x0004a47a stack[0x7ffff662] = 0x4e300004 stack[0x7ffff664] = 0x00184e30 stack[0x7ffff666] = 0x006a0018 stack[0x7ffff668] = 0x0000006a stack[0x7ffff66a] = 0xa6b00000 stack[0x7ffff66c] = 0x0018a6b0 stack[0x7ffff66e] = 0x785c0018 stack[0x7ffff670] = 0x0015785c stack[0x7ffff672] = 0x00000015 stack[0x7ffff674] = 0x00000000 stack[0x7ffff676] = 0x2ce70000