Segmentation fault

  • Nobody/Anonymous

    Hi again

    Thx again for all the help yesterday.
    Ive now manage to install the staden package on my Mac OSX 10.6 and gap seems to work but I get the error:
    "Segmentation fault"
    When I try to start spin, any idea about what it can be and how it can be fixed?

    Best Regards
    Joel D

  • James Bonfield

    James Bonfield - 2010-07-08

    Hmm, odd. Spin isn't really supported now as I simply don't have time. However if there's some simple bug stopping it then obviously I'd want it fixed.

    If you define the STADEN_DEBUG environment variable (to be anything) you'll get some data about the dynamic libraries it looks for and loads. We expect some to not exist as each Tcl sub-package isn't required to also have a C compiled library too. However it may perhaps indicate a problem at startup if it dies at a particular point. (My guess is it's something itcl/iwidgets related - I've never been too happy with the integration of that.)

    Failing that, it's possible to add  "puts HERE" type statements liberarly through the startup code in spin.tcl and also the etc/spinrc file (as that's really just a tcl script too) for a poor-mans debugging aid. If I get time I'll experiment again with a new MacOS X build, but the only Mac I have access to is via a remote login to someone elses and I don't think it's on 10.6 yet either.

  • Nobody/Anonymous

    Did the puts thing and pin pointed it to this part:

    #set up score matrices
    puts "set up score matrices"
    set_score_matrix -file  -type $PROTEIN
    puts "score_matrix1"
    set_score_matrix -file "<identity>" -type $DNA
    puts "score matrix2"
    puts "set_max_matches"

    And get this from the run:
    necessary for busy cursor
    set up score matrices
    Segmentation fault

    So it seems to be some thing wrong with the line:
    set_score_matrix -file  -type $PROTEIN


  • Nobody/Anonymous

    And this is from the run with STADEN_DEBUG: (and some puts in there)

    I am starting…
    load /Users/bongcam/StadenTest/bin/../lib/staden/libspin.dylib => dlsym(0x1003443e0, Spin_Unload): symbol not founddlsym(0x1003443e0, Spin_SafeUnload): symbol not found
    load /Users/bongcam/StadenTest/bin/../lib/staden/libspin_emboss.dylib =>
    I have loaded the spin package
    necessary for busy cursor
    set up score matrices
    Segmentation fault

  • James Bonfield

    James Bonfield - 2010-07-08

    Thanks for that. So it definitely looks like the "set_score_matrix" command that is failing some how.  This wasn't any code I wrote so I'm not entirely familier with it, but it looks like it should be trying to load $STADTABL/pam250 (which after running via the spin wrapper shell script will be stadenroot / share/staden/etc/pam250.

    The code does seem to check for failures and deliberately making the file not exist seems to correctly spot the error and report it.

    I'll experiment some more.

  • Nobody/Anonymous

    If you need any more information just ask :)

  • James Bonfield

    James Bonfield - 2010-07-08

    Annoyingly it's working (sort of) for me on 10.5.8. I say sort of because some things cause spin to die later on, but it does at least start up.

    I think I need to rebuild tcl/tk/itcl/itk to get it fully working. Which versions of these did you install and where did you get them from? I assume you're using the X11 builds rather than native aqua Tk? (I don't support that currently.)

  • Nobody/Anonymous

    10.6 has dropped support for a lot of libraries, so we had to install everything our selfs. Yes we use the X11 build.

    tcl/tk: 8.5.8
    itcl: 3.4
    itk: 3.3
    iwidgets: 4.0.1

    Getting itcl/itk installed in order to getting iwidgets was tricky. We solved it by downloading the itcl 3.2.1 package witch have both itcl and itk. Then just replaced the subfolders itcl and itk with the newer ones. That solved paths things for iwidgets…

    We downloaded all the packages from there corresponding sourceforge pages.


  • Nobody/Anonymous

    Hi again!

    After some debugging with gdb we got this backtrace (see below). Seems like the function vsprintf in vmessage function that causes the segfault. Maybe this is a OSX thing cause the staden pakage works just fine on our linux machines (Ubuntu).

    Just for the fun, I tried to use sprintf instead of vsprintf (I don't really know the difference =/). Spin started but I couldn't do anything, just a bunch of error messages in popup windows. Is this due to sprintf instead of vsprintf in vmessages?


    Erik-Bongcam-Rudloffs-Mac-mini:Staden-svn bongcam$ gdb ../bin/tclsh
    GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done
    (gdb) set args ../share/staden/tcl/spin/spin.tcl
    (gdb) run
    Starting program: /Users/bongcam/StadenTest/bin/tclsh ../share/staden/tcl/spin/spin.tcl
    Reading symbols for shared libraries .+++..... done
    Reading symbols for shared libraries ............................................................. done
    Reading symbols for shared libraries ......... done
    Reading symbols for shared libraries .. done
    Reading symbols for shared libraries . done
    Reading symbols for shared libraries . done
    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x00000000007f8000
    0x00007fff87262180 in strlen ()
    (gdb) bt
    #0  0x00007fff87262180 in strlen ()
    #1  0x00007fff8726da7c in __vfprintf ()
    #2  0x00007fff87323bc0 in vsprintf ()
    #3  0x00000001005233d5 in vmessage (fmt=0x101fadd38 "Current protein score matrix file is %s\n") at text_output.c:890
    #4  0x0000000101f8ee61 in SetScoreMatrix (clientData=<value temporarily unavailable, due to optimizations>, interp=<value temporarily unavailable, due to optimizations>, argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at sip_cmds.c:635
    #5  0x00000001000112f0 in TclInvokeStringCommand ()
    #6  0x000000010001455f in TclEvalObjvInternal ()
    #7  0x00000001000151ce in TclEvalEx ()
    #8  0x000000010001559a in Tcl_EvalEx ()
    #9  0x000000010006d136 in Tcl_FSEvalFileEx ()
    #10 0x0000000100072d12 in Tcl_Main ()
    #11 0x00000001000019d8 in main ()

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks