Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Segfault running gap5 check_assembly

2012-10-02
2013-04-18
  • James Abbott
    James Abbott
    2012-10-02

    Hello,

    I'm experiencing a reproducible segfault when trying to run gap5's 'check assembly' from the 2.0.0b9 release on an assembly of a 1.8 Mb bacterial genome in 32 contigs.  I'm running the x86_64 binary distribution running on Fedora 17 (3.5.4-1.fc17.x86_64).  My tclsh is lacking debug symbols, but hopefully the backtrace will still provide some clues as to what is going on:

    #0  0x46a70286 in __strlen_sse2_bsf () from /lib/libc.so.6
    #1  0xf6b64341 in vflen (fmt=0xf55854a8 "\nReading #%lld(%s) has a local percentage mismatch of %2.1f\n", ap=0xff8072c4 "\a(") at ../../io_lib/vlen.c:227
    #2  0xf6bbf54d in vmessage (fmt=0xf55854a8 "\nReading #%lld(%s) has a local percentage mismatch of %2.1f\n")
        at /nfs/users/nfs_j/jkb/staden/trunk/src/build.i386/../tk_utils/text_output.c:895
    #3  0xf54f19df in check_uassembly_single (io=0x9d58c50, con=0xaf4bfe7 "", contig=15, r=0xaf8c508, maxperc=0.5, win_len=50, ignore_N=1)
        at /nfs/users/nfs_j/jkb/staden/trunk/src/build.i386/../gap5/check_assembly.c:107
    #4  0xf54f1d53 in check_assembly (io=0x9d58c50, num_contigs=32, contigs=0xa226148, winsize=50, maxperc=0.5, ignore_N=1)
        at /nfs/users/nfs_j/jkb/staden/trunk/src/build.i386/../gap5/check_assembly.c:433
    #5  0xf54d5394 in tcl_check_assembly (clientData=0x0, interp=0x9b37640, objc=11, objv=0x9b3f5d8)
        at /nfs/users/nfs_j/jkb/staden/trunk/src/build.i386/../gap5/newgap5_cmds.c:2014
    #6  0xf773b931 in TclEvalObjvInternal () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #7  0xf7767729 in ?? () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #8  0xf776b358 in TclCompEvalObj () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #9  0xf7797006 in TclObjInterpProc () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #10 0xf773b931 in TclEvalObjvInternal () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #11 0xf7767729 in ?? () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #12 0xf776b358 in TclCompEvalObj () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #13 0xf773c9c8 in Tcl_EvalObjEx () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #14 0xf6c6081b in TkInvokeButton () from /usr/local/staden/lib/libtk8.4.so.0
    #15 0xf6c6221e in ?? () from /usr/local/staden/lib/libtk8.4.so.0
    #16 0xf773b931 in TclEvalObjvInternal () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #17 0xf773c86c in Tcl_EvalObjv () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #18 0xf773cb50 in Tcl_EvalObjEx () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #19 0xf7797818 in Tcl_UplevelObjCmd () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #20 0xf773b931 in TclEvalObjvInternal () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #21 0xf7767729 in ?? () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #22 0xf776b358 in TclCompEvalObj () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #23 0xf7797006 in TclObjInterpProc () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #24 0xf773b931 in TclEvalObjvInternal () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #25 0xf773bedd in Tcl_EvalEx () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #26 0xf773c1eb in Tcl_Eval () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #27 0xf773c286 in Tcl_GlobalEval () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #28 0xf6c38031 in Tk_BindEvent () from /usr/local/staden/lib/libtk8.4.so.0
    #29 0xf6c3d903 in TkBindEventProc () from /usr/local/staden/lib/libtk8.4.so.0
    #30 0xf6c42f6a in Tk_HandleEvent () from /usr/local/staden/lib/libtk8.4.so.0
    #31 0xf6c4357b in ?? () from /usr/local/staden/lib/libtk8.4.so.0
    #32 0xf778c887 in Tcl_ServiceEvent () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #33 0xf778cb68 in Tcl_DoOneEvent () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #34 0xf6c4298f in Tk_MainLoop () from /usr/local/staden/lib/libtk8.4.so.0
    #35 0xf778890d in Tcl_Main () from /usr/local/staden/bin/../lib/libtcl8.4.so.0
    #36 0x080486af in main ()
    

    Any ideas what may be going wrong here?

    Many thanks,
    James

     
  • James Bonfield
    James Bonfield
    2012-10-03

    Hello.

    Sorry to hear the program is crashing for you.

    The vmessage() calling code is:

            vmessage("\nReading #%"PRIrec"(%s) has a local percentage "
                     "mismatch of %2.1f\n",
                     s->rec, s->name, 100 * (float)worst / win_len);
    

    I'm assuming s->name is either nul or some rogue pointer. "s" itself must be fine or it would have died here, but instead it got into the vmessage and later strlen. As the only %s here is s->name I guess that is where the problem lies.

    As to *why* it's happened though I do not know. Does Check Database report any faults with the DB? We've certainly seen a few cases of data corruption, and are bit by bit trying to squash such bugs. However it's a rather complex beast and sometimes errors can be notoriously hard to reproduce too.

    If the database is corrupted, first take a copy before attempting anything. Then you can try possibly Check Database with fix enable (sometimes helps, but often isn't sufficient) or try exporting to SAM and reimporting with tg_index to build a fresh copy. This can be done on the command line too with gap5_export.