Compiling melt-branch revision 144904 with gcc 4.4.0 (Trunk),
4.3, or 4.1 results in a Segmentation fault in the modded 'cc1'
basilys_extra_marking() function.

Here is the "regular output" of where it fails:

Compiling ../../melt-branch/gcc/warmelt-outobj-0.c with -g
-fkeep-inline-functions -DIN_GCC -DHAVE_CONFIG_H -DMELTGCC_DYNAMIC_OBJSTRUCT

real    0m9.599s
user    0m8.321s
sys     0m0.924s


-rwxr-xr-x 1 root root 1448978 2009-03-16 20:42 warmelt-outobj-0-d.so
-rw-r--r-- 1 root root 2309220 2009-03-16 10:05
../../melt-branch/gcc/warmelt-outobj-0.c
done ./built-melt-cc-script ../../melt-branch/gcc/warmelt-outobj-0.c
warmelt-outobj-0-d.so @@@@

date +"#warmelt0.modlis generated %c" > warmelt0.modlis-tmp
for f in   warmelt-first-0  warmelt-macro-0  warmelt-normal-0 
warmelt-normatch-0  warmelt-genobj-0  warmelt-outobj-0; do echo $f >>
warmelt0.modlis-tmp; done
/bin/sh ../../melt-branch/gcc/../move-if-change warmelt0.modlis-tmp
warmelt0.modlis
rm -f warmelt-first-1.c
generating warmelt-first using warmelt-first-0 warmelt-macro-0 warmelt-normal-0
warmelt-normatch-0 warmelt-genobj-0 warmelt-outobj-0
WARMELT_BASE0= warmelt-first-0 warmelt-macro-0 warmelt-normal-0
warmelt-normatch-0 warmelt-genobj-0 warmelt-outobj-0 WARMELT_BASE0ROW=
warmelt-first-0-d:warmelt-macro-0-d:warmelt-normal-0-d:warmelt-normatch-0-d:warmelt-genobj-0-d:warmelt-outobj-0-d
time ./cc1 -Wno-shadow -fbasilys=translateinit -fbasilys-dynlibdir=.
-fbasilys-compile-script=/mnt/drive2/melt-branch_build/gcc/built-melt-cc-script
-fbasilys-gensrcdir=. -fbasilys-tempdir=_tempmeltdir_$$ 
-fbasilys-init=warmelt-first-0-d:warmelt-macro-0-d:warmelt-normal-0-d:warmelt-normatch-0-d:warmelt-genobj-0-d:warmelt-outobj-0-d
\
              -fbasilys-arg=../../melt-branch/gcc/melt/warmelt-first.bysl \
              -fbasilys-secondarg=warmelt-first-1.c
** warmelt generated 105 routines into warmelt-first-1.c
** from Mon 16 Mar 2009 08:41:53 PM PDT
../../melt-branch/gcc/warmelt-outobj-0.c
** of checksum d154a02b37d0b56f8a7a08c5368fded8 
../../melt-branch/gcc/warmelt-outobj-0.c
cc1: note: BASILYS INFORM [#198595]: warmelt generated module -
warmelt-first-1.c
 {GC 12538k -> cc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

real    0m1.788s
user    0m1.104s
sys     0m0.292s
make[4]: *** [warmelt-first-1.c] Error 4
make[4]: Leaving directory `/mnt/drive2/melt-branch_build/gcc'
make[3]: *** [melt.encap] Error 2


In order to discover the "hidden processing" and intermediate
files (along with giving some more debugging tips) I changed
"melt-cc-script.proto" (as is suggested at the wiki's URL: 
http://gcc.gnu.org/wiki/MiddleEndLispTranslator) to use "-O0"
and "--save-temps" (plus other commands) like this:

        echo Compiling $csource with $melt_cflags
#       time $melt_cc -O0 -v -fmem-report -ftime-report -dn -Wall -fPIC        
$melt_cflags -I "$melt_headerdir" $csource -c -o $nakedynstuff.o
#            $melt_cc -O0 -v -fmem-report -ftime-report -dn -Wall -fPIC -shared
$melt_cflags -I "$melt_headerdir" $datf.c $nakedynstuff.o -o $nakedynstuff.so
        time $melt_cc -O0 -v -ftime-report --save-temps -Wall -fPIC        
$melt_cflags -I "$melt_headerdir" $csource -c -o $nakedynstuff.o
             $melt_cc -O0 -v -ftime-report --save-temps -Wall -fPIC -shared
$melt_cflags -I "$melt_headerdir" $datf.c $nakedynstuff.o -o $nakedynstuff.so
        echo


After doing that I was able to run "./cc1" on the intermediate file
using 'gdb' with this result:

# cd /mnt/drive2/melt-branch_build/gcc
# file ./cc1
./cc1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.8, not stripped
# gdb --args ./cc1 -Wno-shadow -fbasilys=translateinit -fbasilys-dynlibdir=.
-fbasilys-compile-script=/mnt/drive2/melt-branch_build/gcc/built-melt-cc-script
-fbasilys-gensrcdir=. -fbasilys-tempdir=_tempmeltdir_$$ 
-fbasilys-init=warmelt-first-0-d:warmelt-macro-0-d:warmelt-normal-0-d:warmelt-normatch-0-d:warmelt-genobj-0-d:warmelt-outobj-0-d
-fbasilys-arg=../../melt-branch/gcc/melt/warmelt-first.bysl
-fbasilys-secondarg=warmelt-first-1.c -v
GNU gdb 6.8-debian
...
(gdb) r
Starting program: /mnt/drive2/melt-branch_build/gcc/cc1 -Wno-shadow
-fbasilys=translateinit -fbasilys-dynlibdir=.
-fbasilys-compile-script=/mnt/drive2/melt-branch_build/gcc/built-melt-cc-script
-fbasilys-gensrcdir=. -fbasilys-tempdir=_tempmeltdir_2871
-fbasilys-init=warmelt-first-0-d:warmelt-macro-0-d:warmelt-normal-0-d:warmelt-normatch-0-d:warmelt-genobj-0-d:warmelt-outobj-0-d
-fbasilys-arg=../../melt-branch/gcc/melt/warmelt-first.bysl
-fbasilys-secondarg=warmelt-first-1.c -v
 {Main zone GC 27k -> 27k} {Tree identifier zone GC 1k -> 1k} {Tree zone GC 0k
-> 0k} {RTL zone GC 0k -> 0k}** warmelt generated 105 routines into
warmelt-first-1.c
** from Tue 17 Mar 2009 09:04:44 AM PDT warmelt-outobj-0-d.c
** of checksum d154a02b37d0b56f8a7a08c5368fded8  warmelt-outobj-0-d.c
cc1: note: BASILYS INFORM [#198595]: warmelt generated module -
warmelt-first-1.c
 {Main zone GC 11069k -> 
Program received signal SIGSEGV, Segmentation fault.
0x081ad904 in basilys_extra_marking (xtradata=0xffdde120) at
../../melt-branch/gcc/basilys.c:515
515           if (!mi->iniframp || !*mi->iniframp || !mi->marker_rout) 
(gdb) where
#0  0x081ad904 in basilys_extra_marking (xtradata=0xffdde120) at
../../melt-branch/gcc/basilys.c:515
#1  0x0848a579 in ggc_mark_roots_extra_marking (extramarker=0x81ad8aa
<basilys_extra_marking>, extradata=0xffdde120) at
../../melt-branch/gcc/ggc-common.c:121
#2  0x081987fc in ggc_collect_1 (zone=0x9623bc0, need_marking=1 '\001',
walkrout=0x81ad8aa <basilys_extra_marking>, walkdata=0xffdde120)
    at ../../melt-branch/gcc/ggc-zone.c:1961
#3  0x081989cc in ggc_collect_extra_marking (walkrout=0x81ad8aa
<basilys_extra_marking>, walkdata=0xffdde120) at
../../melt-branch/gcc/ggc-zone.c:2035
#4  0x081ae1ba in basilys_garbcoll (wanted=2097152, needfull=1 '\001') at
../../melt-branch/gcc/basilys.c:675
#5  0x081bff6d in do_finalize_basilys () at
../../melt-branch/gcc/basilys.c:7097
#6  0x081c00d0 in basilys_finalize () at ../../melt-branch/gcc/basilys.c:7146
#7  0x0877d19f in toplev_main (argc=11, argv=0xffdde254) at
../../melt-branch/gcc/toplev.c:2283
#8  0x08190482 in main (argc=Cannot access memory at address 0x18
) at ../../melt-branch/gcc/main.c:35
(gdb) 


Then ...

(gdb) l ../../melt-branch/gcc/basilys.c:515
510       struct callframe_basilys_st *cf = 0;
511       gcc_assert (xtradata == basilys_topframe);
512       /* first, scan all the modules and mark their frame if it is non null
*/
513       for (ix = 0; VEC_iterate (basilys_module_info_t, modinfvec, ix, mi);
ix++)
514         {
515           if (!mi->iniframp || !*mi->iniframp || !mi->marker_rout) 
516             continue;
517           (mi->marker_rout) (*mi->iniframp);
518         };
519       /* then scan all the MELT call frames */
(gdb) b ../../melt-branch/gcc/basilys.c:513
Breakpoint 5 at 0x81ad8eb: file ../../melt-branch/gcc/basilys.c, line 513.
(gdb) r
...
(gdb) u
515           if (!mi->iniframp || !*mi->iniframp || !mi->marker_rout) 
(gdb) print mi
$1 = (basilys_module_info_t *) 0xa7eb8a0
(gdb) where
#0  basilys_extra_marking (xtradata=0xff96ccb0) at
../../melt-branch/gcc/basilys.c:515
#1  0x0848a579 in ggc_mark_roots_extra_marking (extramarker=0x81ad8aa
<basilys_extra_marking>, extradata=0xff96ccb0) at
../../melt-branch/gcc/ggc-common.c:121
#2  0x081987fc in ggc_collect_1 (zone=0x9623bc0, need_marking=1 '\001',
walkrout=0x81ad8aa <basilys_extra_marking>, walkdata=0xff96ccb0)
    at ../../melt-branch/gcc/ggc-zone.c:1961
#3  0x081989cc in ggc_collect_extra_marking (walkrout=0x81ad8aa
<basilys_extra_marking>, walkdata=0xff96ccb0) at
../../melt-branch/gcc/ggc-zone.c:2035
#4  0x081ae1ba in basilys_garbcoll (wanted=2097152, needfull=1 '\001') at
../../melt-branch/gcc/basilys.c:675
#5  0x081bff6d in do_finalize_basilys () at
../../melt-branch/gcc/basilys.c:7097
#6  0x081c00d0 in basilys_finalize () at ../../melt-branch/gcc/basilys.c:7146
#7  0x0877d19f in toplev_main (argc=11, argv=0xff96cde4) at
../../melt-branch/gcc/toplev.c:2283
#8  0x08190482 in main (argc=Cannot access memory at address 0x18
) at ../../melt-branch/gcc/main.c:35
(gdb) u

Program received signal SIGSEGV, Segmentation fault.
0x081ad904 in basilys_extra_marking (xtradata=0xff96ccb0) at
../../melt-branch/gcc/basilys.c:515
515           if (!mi->iniframp || !*mi->iniframp || !mi->marker_rout) 
(gdb) print mi
$2 = (basilys_module_info_t *) 0xa7eb8a0
(gdb) print mi->iniframp
$3 = (void **) 0x11761
(gdb) print mi->marker_rout
$4 = (void (*)(void *)) 0


and to go futher:
(gdb) b ../../melt-branch/gcc/toplev.c:617
Breakpoint 6 at 0x877a291: file ../../melt-branch/gcc/toplev.c, line 617.
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xf7721519 in ssignal () from /lib/i686/cmov/libc.so.6
(gdb) where
#0  0xf7721519 in ssignal () from /lib/i686/cmov/libc.so.6
#1  0x0877a270 in crash_signal (signo=11) at ../../melt-branch/gcc/toplev.c:607
#2  <signal handler called>
#3  0x081ad904 in basilys_extra_marking (xtradata=0xff96ccb0) at
../../melt-branch/gcc/basilys.c:515
#4  0x0848a579 in ggc_mark_roots_extra_marking (extramarker=0x81ad8aa
<basilys_extra_marking>, extradata=0xff96ccb0) at
../../melt-branch/gcc/ggc-common.c:121
#5  0x081987fc in ggc_collect_1 (zone=0x9623bc0, need_marking=1 '\001',
walkrout=0x81ad8aa <basilys_extra_marking>, walkdata=0xff96ccb0)
    at ../../melt-branch/gcc/ggc-zone.c:1961
#6  0x081989cc in ggc_collect_extra_marking (walkrout=0x81ad8aa
<basilys_extra_marking>, walkdata=0xff96ccb0) at
../../melt-branch/gcc/ggc-zone.c:2035
#7  0x081ae1ba in basilys_garbcoll (wanted=2097152, needfull=1 '\001') at
../../melt-branch/gcc/basilys.c:675
#8  0x081bff6d in do_finalize_basilys () at
../../melt-branch/gcc/basilys.c:7097
#9  0x081c00d0 in basilys_finalize () at ../../melt-branch/gcc/basilys.c:7146
#10 0x0877d19f in toplev_main (argc=11, argv=0xff96cde4) at
../../melt-branch/gcc/toplev.c:2283
#11 0x08190482 in main (argc=Cannot access memory at address 0x18
) at ../../melt-branch/gcc/main.c:35
(gdb) 


I'm not familiar enough with this branch to offer a patch.


Thanks,
Rob


-- 
           Summary: [melt] - revision 144904 - BASILYS INFORM [#198595]:
                    warmelt-first-1.c -> SIGSEGV
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rob1weld at aol dot com
 GCC build triplet: i686-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu


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

Reply via email to