Trying to build latest CVS for Fedora 19 and was getting a segfault in test_ce. Tracked it down to gdl-0.9.3/src/basic_pro_jmg.cpp. I think the attached patch is what you are meaning to do.
Hmm, now segfaults somewhere else on 32-bit Fedora rawhide:
48: Starting test Stuct 48: TEST EXITED FROM SIGNAL 11
gdb session:
(gdb) bt #0 0x5713d0d9 in vfprintf () from /lib/libc.so.6 #1 0x5720033d in __printf_chk () from /lib/libc.so.6 #2 0x58f74a92 in printf (__fmt=0x58f75c33 "'%s' ") at /usr/include/bits/stdio2.h:104 #3 testce_struct (argc=1, argv=0x92676b8) at /builddir/build/BUILD/gdl-0.9.3/testsuite/libtest_ce.cpp:413 #4 0x0836df19 in lib::call_external (e=0x91ffeac) at /builddir/build/BUILD/gdl-0.9.3/src/basic_pro_jmg.cpp:473 #5 0x0881d0fc in FCALL_LIBNode::Eval (this=0x92687a8) at /builddir/build/BUILD/gdl-0.9.3/src/prognodeexpr.cpp:3285 #6 0x0880ce42 in ASSIGN_REPLACENode::Run (this=0x9268758) at /builddir/build/BUILD/gdl-0.9.3/src/prognode.cpp:1091 #7 0x08165f79 in GDLInterpreter::statement (this=this@entry=0xffe61844, _t=0x924ca98) at /builddir/build/BUILD/gdl-0.9.3/src/GDLInterpreter.cpp:96 #8 0x081672bc in GDLInterpreter::call_pro (this=0xffe61844, _t=<optimized out>) at /builddir/build/BUILD/gdl-0.9.3/src/GDLInterpreter.cpp:812 #9 0x08813909 in PCALLNode::Run (this=0x914e338) at /builddir/build/BUILD/gdl-0.9.3/src/prognode.cpp:1248 #10 0x08165f79 in GDLInterpreter::statement (this=this@entry=0xffe61844, _t=0x914e338) at /builddir/build/BUILD/gdl-0.9.3/src/GDLInterpreter.cpp:96 #11 0x08166f1c in GDLInterpreter::interactive (this=0xffe61844, _t=<optimized out>, _t@entry=0x914e338) at /builddir/build/BUILD/gdl-0.9.3/src/GDLInterpreter.cpp:39 #12 0x085d12d5 in DInterpreter::ExecuteLine (this=this@entry=0xffe61844, in=in@entry=0xffe61630, lineOffset=0) at /builddir/build/BUILD/gdl-0.9.3/src/dinterpreter.cpp:1161 #13 0x085d4de5 in DInterpreter::InterpreterLoop (this=this@entry=0xffe61844, startup="", batch_files=std::vector of length 0, capacity 0, statement="test_ce\n") at /builddir/build/BUILD/gdl-0.9.3/src/dinterpreter.cpp:1550 #14 0x08128fc8 in main (argc=3, argv=0xffe61a24) at /builddir/build/BUILD/gdl-0.9.3/src/gdl.cpp:344 (gdb) up #1 0x5720033d in __printf_chk () from /lib/libc.so.6 (gdb) up #2 0x58f74a92 in printf (__fmt=0x58f75c33 "'%s' ") at /usr/include/bits/stdio2.h:104 104 return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); (gdb) up #3 testce_struct (argc=1, argv=0x92676b8) at /builddir/build/BUILD/gdl-0.9.3/testsuite/libtest_ce.cpp:413 413 printf("'%s' ", so->si.s[0].s); (gdb) print so->si.s[0].s $1 = 0x3 <Address 0x3 out of bounds> (gdb) print so->si.s[0] $2 = {slen = 2, stype = 0, s = 0x3 <Address 0x3 out of bounds>} (gdb) print so->si.s $3 = {{slen = 2, stype = 0, s = 0x3 <Address 0x3 out of bounds>}, {slen = 10, stype = -25184, s = 0x3 <Address 0x3 out of bounds>}} (gdb) print so->si $4 = {c = -32 '\340', d = 654496323804562433, s = {{slen = 2, stype = 0, s = 0x3 <Address 0x3 out of bounds>}, {slen = 10, stype = -25184, s = 0x3 <Address 0x3 out of bounds>}}} (gdb) print so $5 = (outer *) 0x915ea48 (gdb) print *so $6 = {l1 = 1, si = {c = -32 '\340', d = 654496323804562433, s = {{slen = 2, stype = 0, s = 0x3 <Address 0x3 out of bounds>}, {slen = 10, stype = -25184, s = 0x3 <Address 0x3 out of bounds>}}}, l2 = 1279350367, c = -112 '\220'} (gdb) list 408 printf("Error:\n"); 409 printf("number of arguments: Got: %d\n", argc); 410 printf(" Expected: %d\n", 1); 411 printf("First Element: Got: %d / %d %lld ", 412 so->l1, so->si.c, so->si.d ); 413 printf("'%s' ", so->si.s[0].s); 414 printf("'%s' / ", so->si.s[1].s); 415 printf("%d %d\n", so->l2, so->c); 416 printf(" Expected: %d / %d %d '%s' '%s' / %d %d\n", 417 1, 1, 2, "One", "Two", 2, 2); (gdb) print argc $1 = 1
Thanks Orion, that helps me a lot to go further.
Adding an extra test related to GDL_STRING I have significant progress, most case tests OK except Struct.
Run withing Valgrind all pbs catched and go to the end, but with huge list of messages ...
Alain
PS: I am trying to revert changes done in June 22 too ;-)
Now I removed
#ifdef USE_EIGEN SizeT defaultAlign = 16;
and CALL_EXTERNAL, tested using "test_ce.pro" (first of all you must compiled "libtest_ce.c") is OK on 32b and 64b ;-)
BUT the change was due to a report of memory leak around, please help me to test it !
last correction tested with success on various 32b and 64b Linux.
Log in to post a comment.
Hmm, now segfaults somewhere else on 32-bit Fedora rawhide:
gdb session:
Thanks Orion, that helps me a lot to go further.
Adding an extra test related to GDL_STRING I have significant progress,
most case tests OK except Struct.
Run withing Valgrind all pbs catched and go to the end, but with huge list of
messages ...
Alain
PS: I am trying to revert changes done in June 22 too ;-)
Now I removed
#ifdef USE_EIGEN
SizeT defaultAlign = 16;
and CALL_EXTERNAL, tested using "test_ce.pro" (first of all you must compiled
"libtest_ce.c") is OK on 32b and 64b ;-)
BUT the change was due to a report of memory leak around, please help me to test it !
Alain
Last edit: Alain C. 2013-08-04
last correction tested with success on various 32b and 64b Linux.
Alain