Menu

Segfault (Debian, unstable)

Help
2001-11-27
2001-11-28
  • Jamshed Kakar

    Jamshed Kakar - 2001-11-27

    Hi,

    I'm trying to use libcommonc++-dev Debian package (Common C++ 1.9) to create a threaded XML application.  After much fighting with the build environment I've finally been able to use ccgnu-config to get my code to compile.  I'm having a very strange problem... 'make' builds my app, 'dgenera', as follows:

    c++ -g -O2 -o .libs/dgenera dgenera.o -pthread  ../libdgenera/.libs/libdgenera.so -L/usr/lib/gcc-lib/i386-linux/2.95.4 -lgcc -lgcc -lgcc -lgcc -lgcc -lgcc -lgcc -lgcc -L/usr/lib /usr/lib/libccext.so /usr/lib/libccgnu.so /usr/lib/libxml2.so -L/lib -lz -ldl /usr/lib/libcppunit.a -lgcc -lgcc -lgcc -lgcc /usr/lib/libdgenus.so -lgcc -lgcc /usr/lib/libgrunt.so -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/libtidy.so -lxerces-c -Wl,--rpath -Wl,/usr/local/lib
    creating dgenera

    Running dgenera causes a segfault.  I'm going to need all those libraries but for now I've simply been trying to get:

    int
    main (int argc, char** argv)
    {
      return 0;
    }

    to run.  It segfaults...?  GDB reports:

    (gdb) run
    Starting program: /home/jkakar/cvs/dgenera-v2/src/.libs/lt-dgenera
    [New Thread 1024 (LWP 7265)]

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 1024 (LWP 7265)]
    0x405e0a8d in free () from /lib/libc.so.6
    (gdb) bt
    #0  0x405e0a8d in free () from /lib/libc.so.6
    #1  0x0804d584 in __builtin_delete () at dgenera.cc:40
    #2  0x401f57c4 in streambuf::~streambuf ()
       from /usr/lib/libstdc++-libc6.2-2.so.3
    #3  0x40054621 in ost::Slog::~Slog () from /usr/lib/libccext-1.9.so.0
    #4  0x4009a310 in ost::Slog::operator() () from /usr/lib/libccgnu-1.9.so.0
    #5  0x4009a362 in ost::Slog::operator() () from /usr/lib/libccgnu-1.9.so.0
    #6  0x400971c3 in _init () from /usr/lib/libccgnu-1.9.so.0
    #7  0x400adef5 in _fini () from /usr/lib/libccgnu-1.9.so.0
    #8  0x4000b4b6 in _dl_fini () from /lib/ld-linux.so.2
    #9  0x4059dfa3 in exit () from /lib/libc.so.6
    #10 0x4058b665 in __libc_start_main () from /lib/libc.so.6
    (gdb)

    Any help/suggestions/pointers would be appreciated.

    Thanks,
    Jamu.

     
    • Jamshed Kakar

      Jamshed Kakar - 2001-11-28

      Hi,

      Well... it appears that my problems were caused ONLY by my own stupidity and not by any shortcomings in Common C++.  To anyone having problems cooking up a client/server app -- two things:

      1. Use try/catch blocks.  Checking for errors has proven particularly useful -- see point 2.

      2. If you run ICQ don't try to bind your server to port 4000... =)

      Take care,
      Jamu.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.