[Bug 919703] Review Request: libgap - libGAP -- a C library version of the GAP kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=919703



--- Comment #9 from Paulo Andrade <paulo.cesar.pereira.de.andrade@xxxxxxxxx> ---
(In reply to Volker Braun from comment #8)
> Updated tarball at https://bitbucket.org/vbraun/libgap/downloads

  Thanks, but it still fails with a stack overflow.

$ rpm -q gap
gap-4.6.5-1.fc20.x86_64

$ libtool --mode=execute gdb test
[...]
(gdb) r
Starting program: /home/pcpa/rpmbuild/BUILD/libgap-4.6.5/test/.libs/lt-test 
--------------------
Input: 0;
Output follows...
0
--------------------
Input: 1 + CyclicGroup(2);

Program received signal SIGSEGV, Segmentation fault.
libGAP_RNamName (name=name@entry=0x7ffff7970354 "context") at records.c:94
94          pos = (pos % libGAP_SizeRNam) + 1;
Missing separate debuginfos, use: debuginfo-install glibc-2.18.90-5.fc21.x86_64
gmp-5.1.2-2.fc20.x86_64
#0  libGAP_RNamName (name=name@entry=0x7ffff7970354 "context") at records.c:94
#1  0x00007ffff79104ab in libGAP_CallErrorInner (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0, justQuit=justQuit@entry=1, 
    mayReturnVoid=mayReturnVoid@entry=0, mayReturnObj=mayReturnObj@entry=0, 
    lateMessage=0x7ffef7785728, printThisStatement=printThisStatement@entry=1)
    at gap.c:1433
#2  0x00007ffff791068b in libGAP_ErrorQuit (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0) at gap.c:1451
#3  0x00007ffff7843974 in libGAP_ErrorMustHaveAssObjHandler (
    self=<optimized out>, args=<optimized out>) at gvars.c:156
#4  0x00007ffff79105e2 in libGAP_CallErrorInner (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0, justQuit=justQuit@entry=1, 
    mayReturnVoid=mayReturnVoid@entry=0, mayReturnObj=mayReturnObj@entry=0, 
    lateMessage=0x7ffef7785728, printThisStatement=printThisStatement@entry=1)
    at gap.c:1443
[...]

After binary searching the start of the frames:

(gdb) frame 92466
#0  0x0000000000000000 in ?? ()

(gdb) frame 92465
#92465 0x0000000000400d1f in main () at test.c:142
142       eval("1 + CyclicGroup(2);\n");

(gdb) frame 92464
#92464 0x00000000004011a4 in eval (
    input=input@entry=0x40149f "1 + CyclicGroup(2);\n") at test.c:103
103       status = libGAP_ReadEvalCommand(libGAP_BottomLVars);

(gdb) frame 92463
#92463 0x00007ffff784c6d0 in libGAP_ReadEvalCommand (context=0x7ffef7783c70)
    at read.c:2285
2285        else                           { libGAP_ReadExpr(  
libGAP_S_SEMICOLON|libGAP_S_EOF, 'r' ); }

(gdb) frame 92462
#92462 0x00007ffff7848c52 in libGAP_ReadExpr (follow=follow@entry=3221225472, 
    mode=mode@entry=114 'r') at read.c:1637
1637        libGAP_ReadAnd( follow, mode );

(gdb) frame 92461
#92461 0x00007ffff7848b92 in libGAP_ReadAnd (follow=follow@entry=3221225472, 
    mode=mode@entry=114 'r') at read.c:1611
1611        libGAP_ReadRel( follow, mode );

(gdb) frame 92460
#92460 0x00007ffff7848a0b in libGAP_ReadRel (follow=follow@entry=3221225472, 
    mode=mode@entry=114 'r') at read.c:1572
1572        libGAP_ReadAri( follow, (isNot == 0 ? mode : 'r') );

(gdb) frame 92459
#92459 0x00007ffff784891d in libGAP_ReadAri (follow=follow@entry=3221225472, 
    mode=<optimized out>) at read.c:1539
1539            libGAP_ReadTerm( follow, 'r' );

(gdb) frame 92458
#92458 0x00007ffff7848813 in libGAP_ReadTerm (follow=follow@entry=3221225472, 
    mode=mode@entry=114 'r') at read.c:1500
1500        libGAP_ReadFactor( follow, mode );

(gdb) frame 92457
#92457 0x00007ffff78485ed in libGAP_ReadFactor (
    follow=follow@entry=3221225472, mode=mode@entry=114 'r') at read.c:1449
1449        libGAP_ReadAtom( follow, (sign1 == 0 ? mode : 'r') );

(gdb) frame 92456
#92456 0x00007ffff7848521 in libGAP_ReadAtom (follow=follow@entry=3221225472, 
    mode=<optimized out>) at read.c:1387
1387            libGAP_ReadCallVarAss( follow, mode );

(gdb) frame 92455
#92455 0x00007ffff784af3a in libGAP_ReadCallVarAss (follow=3221225472, 
    mode=<optimized out>) at read.c:395
395             else if ( type == 'g' ) { libGAP_IntrRefGVar( var );          
level=0; }

(gdb) frame 92454
#92454 0x00007ffff7890351 in libGAP_IntrRefGVar (gvar=1016) at intrprtr.c:2961
2961            libGAP_ErrorQuit(

(gdb) frame 92453
#92453 0x00007ffff791068b in libGAP_ErrorQuit (msg=<optimized out>, 
    arg1=<optimized out>, arg2=<optimized out>) at gap.c:1451
1451      libGAP_CallErrorInner(msg, arg1, arg2, 1, 0, 0, libGAP_False, 1);

(gdb) frame 92452
#92452 0x00007ffff79105e2 in libGAP_CallErrorInner (msg=<optimized out>, 
    arg1=140733055102272, arg2=<optimized out>, justQuit=justQuit@entry=1, 
    mayReturnVoid=mayReturnVoid@entry=0, mayReturnObj=mayReturnObj@entry=0, 
    lateMessage=0x7ffef7785728, printThisStatement=printThisStatement@entry=1)
    at gap.c:1443
1443      return libGAP_CALL_2ARGS(libGAP_ErrorInner,r,l);  

(gdb) frame 92451
#92451 0x00007ffff7843974 in libGAP_ErrorMustHaveAssObjHandler (
    self=<optimized out>, args=<optimized out>) at gvars.c:156
156         libGAP_ErrorQuit(

(gdb) frame 92450
#92450 0x00007ffff791068b in libGAP_ErrorQuit (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0) at gap.c:1451
1451      libGAP_CallErrorInner(msg, arg1, arg2, 1, 0, 0, libGAP_False, 1);

(gdb) frame 92450
#92450 0x00007ffff791068b in libGAP_ErrorQuit (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0) at gap.c:1451
1451      libGAP_CallErrorInner(msg, arg1, arg2, 1, 0, 0, libGAP_False, 1);

(gdb) frame 92449
#92449 0x00007ffff79105e2 in libGAP_CallErrorInner (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0, justQuit=justQuit@entry=1, 
    mayReturnVoid=mayReturnVoid@entry=0, mayReturnObj=mayReturnObj@entry=0, 
    lateMessage=0x7ffef7785728, printThisStatement=printThisStatement@entry=1)
    at gap.c:1443
1443      return libGAP_CALL_2ARGS(libGAP_ErrorInner,r,l);  

(gdb) frame 92448
#92448 0x00007ffff7843974 in libGAP_ErrorMustHaveAssObjHandler (
    self=<optimized out>, args=<optimized out>) at gvars.c:156
156         libGAP_ErrorQuit(

(gdb) frame 92447
#92447 0x00007ffff791068b in libGAP_ErrorQuit (
    msg=msg@entry=0x7ffff795af48 "Variable: <<unknown>> must have an assigned
value", arg1=arg1@entry=0, arg2=arg2@entry=0) at gap.c:1451
1451      libGAP_CallErrorInner(msg, arg1, arg2, 1, 0, 0, libGAP_False, 1);


So, the error should be in frame #92454

I do not understand the code, only extra help I can give on a first look
is that at the point of failure I see this as the starting point to debug,
and should be trivial for the code author :-)

(gdb) frame 92454
#92454 0x00007ffff7890351 in libGAP_IntrRefGVar (gvar=1016) at intrprtr.c:2961
2961            libGAP_ErrorQuit(
(gdb) p libGAP_PtrGVars[gvar]
$19 = (libGAP_Bag) 0x0
(gdb) p libGAP_ExprGVars[gvar]
$20 = (libGAP_UInt *) 0x7ffef7baa6b0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
package-review mailing list
package-review@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/package-review





[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]