The gcc.dg-struct-layout-1 executable crashes while being run as part of the 
test generation.  This occurs regardless of optimization level.

GDB emits a corrupt and useless backtrace, indicating that the crash is in 
wscanf()*.

The crash appears to actually occur in fprintf() called by output_FNB()**.

So far, I think that the crash is caused by some sort of corruption in 
msvcrt's stdio.  In addition, I think theres a good chance that the initial 
corruption comes from an fprintf() call in switchfiles()***.  However, I 
haven't been able to find any obvious cause for this at this time, and I'm not 
sure how to proceed on debugging this.

The same crash occurs regardless of host compiler version.

i686-pc-mingw32
Windows XP SP2 Professional
Pentium 4 1.4GHz 256MB
binutils 2.15.94 20041028
mingwrt mainline 20041028
msvcrt 7.0.2600.2180
w32api mainline 20041028
libiconv 1.9.1
gmp 4.1.4
mpfr 2.0.3
GNU Make 3.80
expect 5.26
tcl 8.4
dejagnu 1.4.2.x
Misc tools and environment from Cygwin Current Fri Oct 22 01:50:41 2004
ln with softlinks disabled
host gcc 3.4.1 (mingw special)
host binutils 2.15.91 20040904 (mingw)
host mingwrt 3.5
host w32api 3.1

Reading specs from c:/aaronwl/cs/env/mingw-head-head-head/bin/../lib/gcc/i686-
pc-
mingw32/4.0.0/specs                                                            
Configured with: ../../src/cvs/head/gcc/configure --enable-
languages=ada,c,c++,f95,java,objc --with-dwarf2 --enable-libmudflap --enable-
libgcj --with-win32-nlsapi=unicows --enable-libstdcxx-allocator=mt --enable-
libstdcxx-debug --enable-concept-checks --prefix=/aaronwl/cs/env/mingw-head-
head-head-20041028 --with-included-gettext --with-libiconv-
prefix=/aaronwl/cs/internat/iconv/install --with-gmp=/aaronwl/cs/env/mingw-
head-head-head-20041028 --with-mpfr=/aaronwl/cs/env/mingw-head-head-head-
20041028
Thread model: win32
gcc version 4.0.0 20041028 (experimental)

* Backtrace:
#0  0x77c42a16 in wscanf ()
#1  0x0040e1b0 in aligned_bitfld_types ()
#2  0x77c5fce0 in msvcrt!_iob ()
#3  0x00000000 in ?? () from 
#4  0x00000061 in ?? ()
#5  0x00242bb0 in ?? ()
#6  0x00000238 in ?? ()
#7  0x00000000 in ?? () from 
#8  0x00000007 in ?? ()
#9  0x00000000 in ?? () from 
#10 0x00240178 in ?? ()
#11 0x00000000 in ?? () from 
#12 0x00000000 in ?? () from 
#13 0x00000000 in ?? () from 
#14 0x00000000 in ?? () from 
#15 0x77c5fce0 in msvcrt!_iob ()
#16 0x0040c30e in _data_end__ ()
#17 0x00000000 in ?? () from 
#18 0x2f737265 in ?? ()
...

** Backtrace:
#0  output_FNB (mode=70 'F', e=0x22fec0)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:812
        l1 = 1189259747
        l2 = 1422942914
        m = 4294967295
        signs = 0
        p = 0x3d2ce0 " È\227|ÿÿÿÿ"
        q = 0x77c3a52e "]ÃÌÌÌÌÌ\213ÿU\213ìV\213u\b\2154õÐúÅw\203>"
#1  0x00402f22 in subvalues (e=0x22fec0, p=0x40d120 "a", 
    letter=0x22fe8b "b\001")
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:956
        i = 2009291924
        j = 2009155104
        q = 0x40d121 ""
#2  0x00403593 in output (e=0x22feb0)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1078
        i = 1
        c = 98 'b'
        p = (void **) 0x498a10
        skip_cint = 0x40c2ea ""
---Type <return> to continue, or q <return> to quit---
#3  0x00404431 in generate_random_tests (features=0, len=1)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1443
        e = 0x22feb0
        i = 4221808
        r = 168811253
#4  0x0040471e in main (argc=5, argv=0x3d2d28)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1528
        startidx = 0
        i = 0
        j = 1
        count = 200
        c = -1
        n = 3000


*** Backtrace:
#0  switchfiles (fields=1)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:551
        filecnt = 1
        destbuf = 0x3d4288 "/aaronwl/cs/compilers/gcc/build/mingw-
head/gcc/testsuite/gcc.dg-struct-layout-1/t001_main.c"
        destptr = 0x3d42d8 "t001_main.c"
#1  0x004033c4 in output (e=0x22feb0)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1054
        i = 4718664
        c = 0 '\0'
        p = (void **) 0x49193c
        skip_cint = 0x40c2ea ""
#2  0x00404431 in generate_random_tests (features=0, len=1)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1443
        e = 0x22feb0
        i = 4221808
        r = 225536172
#3  0x0040471e in main (argc=5, argv=0x3d2d28)
    
at /aaronwl/cs/compilers/gcc/src/cvs/head/gcc/gcc/testsuite/gcc.dg/compat/struc
t-layout-1_generate.c:1528
---Type <return> to continue, or q <return> to quit---
        startidx = 0
        i = 0
        j = 1
        count = 200
        c = -1
        n = 3000

-- 
           Summary: struct-layout-1 generator broken on i686-pc-mingw32
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aaronavay62 at aaronwl dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18246

Reply via email to