Hi All, Already mentioned on #concatenative, but thought I ought to post here for completeness:
It turned out that on linux and wine the struct memory was zero'd (which may be a fluke), but not on win32. In the factor c code some flags were being tested before being initialized, which I guess didn't matter when they were global vars. In particular 'performing_compaction' had a random value when compiled with -O3 which was causing the early crashes. Cheers, Phil Slava Pestov wrote: > Hi Phil, > > Could this be a gcc bug? > > Slava > > On Thu, Sep 3, 2009 at 6:12 AM, Phil Dawes<[email protected]> wrote: >> Hi Slava, (Hi factor list) >> >> As I mentioned on #concatenative I'm getting bootstrap crashes on win32 >> for my reentrantvm build when g++ is run with optimize settings (-O). >> >> - Crashes don't occur with -O0 >> - tested with mingw gcc 4.1.2 and 4.4.0 >> - Crashes don't occur replacing the -O3 with the corresponding -f >> optimization switches [1] >> - Crashes don't occur on x86.32 linux or under wine >> >> I git-bisected to the first crashing example in my branch, which is >> prior to any .factor or assembly changes. >> The patch in question just moves the data_gc globals into the vm struct. >> >> I found that moving: 'gc_stats stats[max_gen_count]' out of the struct >> and back to a global variable again means that factor bootstraps ok. >> However leaving a dummy var in the struct gc_stats >> stats_dummy[max_gen_count] >> ...means it still crashes, so I don't think it's initialisation of that >> member that's causing the problem. >> >> The gdb backtrace and factor stack dumps are below. >> >> I'll do some more digging tonight, but please let me know if any of this >> rings a bell. >> >> Thanks, >> >> Phil >> >> [1] >> http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Optimize-Options.html#Optimize-Options >> >> >> Breakpoint 1, factor::factorvm::factorbug (this=0x4d2478) at >> vm/debug.cpp:433 >> 433 if(fep_disabled) >> Current language: auto; currently c++ >> (gdb) bt >> #0 factor::factorvm::factorbug (this=0x4d2478) at vm/debug.cpp:433 >> #1 0x6718de7a in primitive_die () at vm/debug.cpp:584 >> #2 0x0396370a in ?? () >> #3 0x039afba9 in ?? () >> #4 0x039636f0 in ?? () >> #5 0x00000010 in ?? () >> Backtrace stopped: previous frame inner to this frame (corrupt stack?) >> >> >> .s >> ==== DATA STACK: >> T{ hashtables.private:tombstone f } >> T{ hashtables.private:tombstone f } >> T{ generic.single:no-method T{ hashtables.private:tombstone f } >> assocs:>alist } >> READY >> .c >> ==== CALL STACK: >> [ memory:gc memory:begin-scan [ hashtables:hashtable? ] sequences:pusher >> [ memor >> y:(each-object) ] kernel:dip memory:end-scan [ hashtables:rehash ] >> sequences:each init:boot... ] >> 8 >> word/quot addr: 24400dc >> word/quot xt: 39def30 >> return address: 39def84 >> [ math.private:iterate-step math.private:iterate-next math:(each-integer) ] >> 0 >> word/quot addr: 24dfb5c >> word/quot xt: 39dfd90 >> return address: 39dfda3 >> [ kernel:-roll [ kernel:call ] kernel:3dip ] >> 2 >> word/quot addr: 244105c >> word/quot xt: 39b0770 >> return address: 39b079e >> [ kernel:dup assocs:>alist [ kernel:dup assocs:clear-assoc ] kernel:dip >> hashtables.private:(rehash) ] >> 1 >> word/quot addr: 245445c >> word/quot xt: 39636f0 >> return address: 396370a >> READY >> .r >> ==== RETAIN STACK: >> 2389 >> 5254 >> T{ kernel:compose T{ kernel:curry T{ kernel:compose T{ kernel:curry { T{ >> hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ >> hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ >> hashtables.private:tombstone f } T{ hashtables.private:tombstone f } >> "inline" syntax:t T{ hashtables.private:tombstone f } T{ >> hashtables.private:tombstone f }... } [ sequences.private >> :nth-unsafe ] } [ kernel:drop hashtables.private:((empty)) ] } [ >> sequences.private:nth-unsafe ] } [ hashtables:rehash ] } >> READY >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Factor-talk mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
