sabotage icon indicating copy to clipboard operation
sabotage copied to clipboard

fltk build segfaults on mips

Open rofl0r opened this issue 11 years ago • 2 comments

while building tests with the "fluid" command line program

Generating tree.cxx and header from tree.fl...          
make[1]: *** [tree.cxx] Segmentation fault   

./fltk-1.3.x-r9708/test/Makefile 262/497 52%
# FLUID file rules
.fl.cxx .fl.h:  ../fluid/fluid$(EXEEXT)
        echo Generating $@ and header from $<...
        ../fluid/fluid$(EXEEXT) -c $<
root:/src/build/fltk13/fltk-1.3.x-r9708/test$ gdb --args ../fluid/fluid -c tree.fl

this looks very similar to an issue i had with first ppc, then arm where C++ static initializers were'nt run.

at that time it was Generating fast_slow.cxx and header from fast_slow.fl...

rofl0r avatar Apr 08 '13 03:04 rofl0r

b factory.cxx:1120
cond 1 i == 12 && tn && tn[0] == 'F' && tn[1] == 'l' && tn[2] == '_' && tn[3] == 'W'
 p buffer + 3232*2

file.cxx allocates some buffer on the heap. later a Fl_Type thing is allocated via C++'s new. when this happens, the memory region of "buffer" in file.cxx is suddenly unmapped and the new C++ object mapped right into it. after spending about 4 hours with this issue, i just gonna disable building the stuff in test/.

rofl0r avatar Apr 08 '13 17:04 rofl0r

the issue is due to libc.a being linked into libstdc++.so for some reason. so we have two concurrent malloc implementations that call sbrk(0) twice and corrupt the heap

rofl0r avatar Apr 08 '13 20:04 rofl0r