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

fink/mac os 10.6/seg fault/ no numerics

jskeel
2010-03-03
2013-06-03
  • jskeel
    jskeel
    2010-03-03

    Dear all,

    I've just tried to set up gdl on my mac SL via fink.
    After a couple of times using self-update of fink I finally got gdl to compile.
    I've started it and everyting works except any kind of computing.
    For example, the command
    print, 'a string'
    works.
    However, the command
    print, 4+3
    causes a seg fault.
    I have just no idea what the cause of the problem might be. Any hint and help is greatly appreciated!

     
  • Hello,

    There was an apparently similar problem described recently in the bug tracker. There, it affected OS X with Macports and GCC 4.5, but perhaps it might help in your case as well.

    Try to check if there are several versions of the libgcc_s library, e.g.:

    $ locate libgcc_s.1.dylib

    If so, pick the one which corresponds to the compiler version used by Fink, and try to run GDL with the DYLD_LIBRARY_PATH env. var set to the directory of this library, e.g.:

    $ DYLD_LIBRARY_PATH=/opt/local/lib/gcc45 gdl

    Hope that helps,
    Sylwester

     
  • jskeel
    jskeel
    2010-03-03

    Hi Sylwester,

    thanks for your quick answer!
    Looks like I have some steep learning gradient ahead of me. OK.
    The result of

    $ locate libgcc_s.1.dylib

    is

    /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libgcc_s.1.dylib
    /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libgcc_s.1.dylib
    /sw/lib/gcc4.4/lib/libgcc_s.1.dylib
    /usr/lib/libgcc_s.1.dylib

    And apparently there are a couple of compilers:

    $ find / -name "gcc" 2> /dev/null

    yields, among others,

    /sw/lib/gcc4.4/bin/gcc

    So, I said

    $ export DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/bin/gcc

    then

    $ fink rebuild gdl

    and finally with

    $ fink reinstall gdl

    I end up with same error:

    GDL> print, 4+3
    Segmentation fault

    Darn. Given that I'm sort of an anti-guru in handling fink, this is not surprising.
    Any ideas?

    Best,

    JS

     
  • Coud you post here the output of:

    $ otool -L /sw/bin/gdl

    (assuming gdl binary is installed in /sw/bin)

    Sylwester

     
  • jskeel
    jskeel
    2010-03-03

    Hi,

    yes, here it is:

    /sw/bin/gdl:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
    /sw/lib/freetype219/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.19.0)
    /usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
    /sw/lib/ncurses/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libreadline.5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libgsl.0.dylib (compatibility version 15.0.0, current version 15.0.0)
    /sw/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /sw/lib/libplplotd.11.dylib (compatibility version 12.0.0, current version 12.1.0)
    /sw/lib/libplplotcxxd.9.dylib (compatibility version 12.0.0, current version 12.0.0)
    /sw/lib/libMagick++.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libMagickWand.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libMagickCore.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libnetcdf.4.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /sw/lib/libsz.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /sw/lib/libhdf5.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /sw/lib/libfftw3.3.dylib (compatibility version 6.0.0, current version 6.4.0)
    /sw/lib/libfftw3f.3.dylib (compatibility version 6.0.0, current version 6.4.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

    Cheers,
    JS

     
  • Thanks,

    The "libgcc_s" seem not to be a problem here, but the libstdc++ is resolved to /usr/lib/libstdc++.6.dylib, while it probably should be resolved to something like /sw/lib/gcc4.4/lib/libstdc++.6.dylib. Please try running GDL with:

    $ DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/lib gdl

    Best,
    Sylwester

     
  • jskeel
    jskeel
    2010-03-03

    It's still compiling, yet I caught the following errors on my screen running by:

    g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/include -I/sw/include -I/sw -I/sw/include -I/sw/include -I/sw/include/ImageMagick -I/sw/include -I/sw/include -I/sw/include/hdf -I/sw/include -I/sw/include/hdf -I/sw/include/hdf5 -I/sw/include -I/sw/include   -I/sw/include  -g -O2 -c -o gdl-datatypes.o `test -f 'datatypes.cpp' || echo './'`datatypes.cpp
    datatypes.cpp: In member function 'int Data_< <template-parameter-1-1> >::Scalar2index(SizeT&) const ':
    datatypes.cpp:4461:   instantiated from here
    datatypes.cpp:1267: warning: comparison is always false due to limited range of data type
    datatypes.cpp: In member function 'SizeT Data_< <template-parameter-1-1> >::LoopIndex() const ':
    datatypes.cpp:4461:   instantiated from here
    datatypes.cpp:1353: warning: comparison is always false due to limited range of data type
    datatypes.cpp: In member function 'int Data_< <template-parameter-1-1> >::Scalar2index(SizeT&) const ':
    datatypes.cpp:4463:   instantiated from here
    datatypes.cpp:1267: warning: comparison is always false due to limited range of data type
    datatypes.cpp: In member function 'SizeT Data_< <template-parameter-1-1> >::LoopIndex() const ':
    datatypes.cpp:4463:   instantiated from here
    datatypes.cpp:1353: warning: comparison is always false due to limited range of data type
    basic_op.cpp: In function 'T pow(T, T) ':
    basic_op.cpp:3293:   instantiated from 'Data_<Sp2>* Data_< <template-parameter-1-1> >::Pow(BaseGDL*) '
    datatypes.cpp:4461:   instantiated from here
    basic_op.cpp:3259: warning: comparison is always false due to limited range of data type
    basic_op.cpp: In function 'T pow(T, T) ':
    basic_op.cpp:3293:   instantiated from 'Data_<Sp2>* Data_< <template-parameter-1-1> >::Pow(BaseGDL*) '
    datatypes.cpp:4463:   instantiated from here
    basic_op.cpp:3259: warning: comparison is always false due to limited range of data type

    Are those warnings related to the issue?

    Thank you!
    JS

     
  • jskeel
    jskeel
    2010-03-03

    Ok,

    I rebuild after

    $ export DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/lib gdl

    but I still get the same seg fault.

    Cheers,
    JS

     
  • Hello,

    If the problem is caused by a mismatch in the library location, rebuilding should not be necessary.

    The compiler warnings you've mentioned are expected and harmless (the code that causes them is simply shorter when written in the warning-causing manner - it's mentioned in the INSTALL file).

    What does "otool -L /sw/bin/gdl" output after setting the DYLD_LIBRARY_PATH to "/sw/lib/gcc4.4/lib" ?

    Does this file exists on your machine: /sw/lib/gcc4.4/lib/libstdc++.6.dylib ?

    Finally, could you run gdl under gdb, trigger the segfault, and post here the backtrace, i.e.:

    $ gdb gdl
    (gdb) run
    GDL> print, 4+3
    (gdb) bt

    Thanks,
    Sylwester

     
  • jskeel
    jskeel
    2010-03-04

    Hello,

    after the command

    $ export DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/lib gdl

    the output of "otool -L /sw/bin/gdl" is

    /sw/bin/gdl:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
    /sw/lib/freetype219/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.19.0)
    /usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
    /sw/lib/ncurses/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libreadline.5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libgsl.0.dylib (compatibility version 15.0.0, current version 15.0.0)
    /sw/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /sw/lib/libplplotd.11.dylib (compatibility version 12.0.0, current version 12.1.0)
    /sw/lib/libplplotcxxd.9.dylib (compatibility version 12.0.0, current version 12.0.0)
    /sw/lib/libMagick++.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libMagickWand.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libMagickCore.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /sw/lib/libnetcdf.4.dylib (compatibility version 5.0.0, current version 5.0.0)
    /sw/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /sw/lib/libsz.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    /sw/lib/libhdf5.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /sw/lib/libfftw3.3.dylib (compatibility version 6.0.0, current version 6.4.0)
    /sw/lib/libfftw3f.3.dylib (compatibility version 6.0.0, current version 6.4.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

    The file  /sw/lib/gcc4.4/lib/libstdc++.6.dylib is existing (with a size of 1393508 bytes)
    Starting "gdl gdb" yields a number of warnings of the sort:

    GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
    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 …
    warning: Could not find object file "/sw/src/fink.build/freetype219-2.3.8-3/freetype-2.3.8/objs/.libs/ftsystem.o" - no debug information available for "builds/unix/ftsystem.c".

    In total, these are some 2600 lines of warnings. Shall I post them? (or send them someway else?)
    he command run in gdb yields another cascade of the same sort of warnings. (shall I post them, too?)

    And this is the backtrace:

    GDL> print, 3+4

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x01cfd497
    0x00299daa in GDLParser::numeric_constant ()
    (gdb)

    Thank you very much!

    JS

     
  • jskeel
    jskeel
    2010-03-12

    Hi,
    any ideas?

    JS

     
  • Hello,

    Sorry for not replying earlier, and thanks for providing the detailed info (I've also forwarded it to the Fink package maintainer).

    (I've just tried to get fink on my machine… but I've temporarily given up after being asked to approve installation of 353 additional packages after issuing "fink install gdl"… the list of needed packages included octave & TeXLive ?!?!)

    Anyhow, I still think the problem is that your GDL binary is being dynamicaly linked with

    "/usr/lib/libstdc++.6.dylib" and not the "/sw/lib/gcc4.4/lib/libstdc++.6.dylib" (assuming it was compiled with the Fink's gcc 4.4)

    I don't understand why setting the DYLD_LIBRARY_PATH does not help :(

    Perhaps try:

    $ DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/lib:$DYLD_LIBRARY_PATH gdl

    or

    $ DYLD_FALLBACK_LIBRARY_PATH=/sw/lib/gcc4.4/lib:$DYLD_LIBRARY_PATH gdl

    or

    $ export DYLD_LIBRARY_PATH=/sw/lib/gcc4.4/lib:$DYLD_LIBRARY_PATH
    $ gdl

    or

    $ export DYLD_FALLBACK_LIBRARY_PATH=/sw/lib/gcc4.4/lib:$DYLD_LIBRARY_PATH
    $ gdl

    or

    try to force Fink to use the system compiler when compiling GDL?

    Best,
    Sylwester