Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3 Program cannot run even number of thrads

open
nobody
None
5
2008-02-22
2008-02-22
No

When running crf_learn with an even number of threads (2 and 6 were both tried) the program aborts with either a Bus Error or a Segmentation Fault when it begins the iterations. When running with odd numbers of threads (3 and 5) it runs perfectly well.

Discussion

  • Logged In: YES
    user_id=2064823
    Originator: NO

    On debian etch 32bits, does not run in multithread (either 2, 3, 15, 16), very quickly (less than 1 minute)
    on both Intel and AMD, with gcc-3.4 and gcc-4.1

    $ crf_learn -f 3 -p 3 template train train.model
    .....
    Number of sentences: 12908
    Number of features: 756610
    Number of thread(s): 3
    Freq: 3
    eta: 0.00010
    C: 1.00000
    shrinking size: 20
    Segfault (core dumped)

    The same command with -p1 is ok.
    Number of sentences: 12908
    Number of features: 756610
    Number of thread(s): 1
    Freq: 3
    eta: 0.00010
    C: 1.00000
    shrinking size: 20
    iter=0 terr=0.99778 serr=1.00000 act=756610 obj=477099.55695 diff=1.00000

    ----------------------
    gbd output:

    $ LANG=C gdb /users/Tools/CRF++-0.50/.libs/lt-crf_learn core.9920
    GNU gdb 6.4.90-debian
    Copyright (C) 2006 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 "i486-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

    warning: Can't read pathname for load map: Input/output error.
    Reading symbols from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0...done.
    Loaded symbols for /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    Reading symbols from /lib/tls/libpthread.so.0...Reading symbols from /usr/lib/debug/lib/tls/libpthread-2.3.6.so...done.
    done.
    Loaded symbols for /lib/tls/libpthread.so.0
    Reading symbols from /usr/lib/libstdc++.so.6...done.
    Loaded symbols for /usr/lib/libstdc++.so.6
    Reading symbols from /lib/tls/libm.so.6...Reading symbols from /usr/lib/debug/lib/tls/libm-2.3.6.so...done.
    done.
    Loaded symbols for /lib/tls/libm.so.6
    Reading symbols from /lib/libgcc_s.so.1...done.
    Loaded symbols for /lib/libgcc_s.so.1
    Reading symbols from /lib/tls/libc.so.6...Reading symbols from /usr/lib/debug/lib/tls/libc-2.3.6.so...done.
    done.
    Loaded symbols for /lib/tls/libc.so.6
    Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug/lib/ld-2.3.6.so...done.
    done.
    Loaded symbols for /lib/ld-linux.so.2
    Core was generated by `/users/Tools/CRF++-0.50/.libs/lt-crf_learn -f 3 -p 3'.
    Program terminated with signal 11, Segmentation fault.
    #0 0xb7f68de7 in CRFPP::Path::calcExpectation () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    (gdb)
    (gdb)
    (gdb) bt
    #0 0xb7f68de7 in CRFPP::Path::calcExpectation () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    #1 0xb7f68b2f in CRFPP::Node::calcExpectation () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    #2 0xb7f69e11 in CRFPP::TaggerImpl::gradient () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    #3 0xb7f5bda5 in CRFPP::CRFEncoderThread::run () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    #4 0xb7f5bab0 in CRFPP::thread::wrapper () from /users/Tools/CRF++-0.50/.libs/libcrfpp.so.0
    #5 0xb7f210bd in start_thread () from /lib/tls/libpthread.so.0
    #6 0xb7da101e in clone () from /lib/tls/libc.so.6
    (gdb)

     
  • I had the same problem with multi-threads,it appears that the problem was in my training file: I had two empty lines separating two examples instead of only one. Correcting that, it runs perfectly with multi-threads