Find the answer to your Linux question:
Results 1 to 5 of 5
I'm building an application on Linux using: QT for interface and utility objects Matlab compiled shared libraries for heavy math calcs A 3rd party container library I need to get ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Location
    Brockville, Ontario, Canada
    Posts
    74

    Question about multi-threading


    I'm building an application on Linux using:
    QT for interface and utility objects
    Matlab compiled shared libraries for heavy math calcs
    A 3rd party container library

    I need to get the darn threading turned off for now. It's just giving me way too many annoying, unexplainable, and random Segmentation Faults and "SIGTRAP" things and I have no idea what the root of the problems are.

    SO:
    QT - I've compiled it with thread support but in my project file I removed the thread option for CONFIG, although it still compiles with threading. How do I turn this off.
    Matlab - I'm not sure if I can remove threading in this. Anyone know?
    3rd Party - I think I've got this under control.

  2. #2
    Just Joined!
    Join Date
    Apr 2005
    Location
    Brockville, Ontario, Canada
    Posts
    74

    New info

    Okay, so I know I can't do multi-threading with matlab, so that's fine. I compiled a copy of the QT libraries without thread support and I'm building my app with those libraries. The 3rd party lib doesn't do multi-threading. But I'm still getting a problem like the one below. All I did was start the program with gdb, set one breakpoint, and I didn't even make it to the breakpoint. I thought i wasn't using threading but gdb is reporting a bunch of stuff about threads. What the heck!?! Any pointers to how I can start to figure this out would be greatly appreciated.

    Thanks.

    Code:
    [sadohert@192 drivers]$ gdb ./driver_rtreedb
    GNU gdb 6.2-2mdk (Mandrakelinux)
    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 "i586-mandrake-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
    
    (gdb) break 70
    Breakpoint 1 at 0x8050877: file driver_rtreedb.cpp, line 70.
    (gdb) r
    Starting program: /home/sadohert/devel/CBIRSystem/drivers/driver_rtreedb
    [Thread debugging using libthread_db enabled]
    [New Thread 1087487648 (LWP 31472)]
    [New Thread 1144327088 (LWP 31478)]
    Detaching after fork from child process 31479.
    Warning: latest version of matlab app-defaults file not found.
    Contact your system administrator to have this file installed.
    [New Thread 1233198000 (LWP 31480)]
    [New Thread 1233726384 (LWP 31481)]
    [New Thread 1234254768 (LWP 31482)]
    [New Thread 1234783152 (LWP 31483)]
    [New Thread 1235311536 (LWP 31484)]
    [New Thread 1235839920 (LWP 31485)]
    [New Thread 1236368304 (LWP 31486)]
    
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 1144327088 (LWP 31478)]
    0x477052b9 in ?? ()
    Current language:  auto; currently c
    (gdb)

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Location
    Brockville, Ontario, Canada
    Posts
    74

    PLEASE help

    This is the other type of problem I encounter:
    Code:
    Program received signal SIGTRAP, Trace/breakpoint trap.
    [Switching to Thread 1273514928 (LWP 32094)]
    0x40c9e931 in __nptl_death_event () from /lib/tls/libpthread.so.0
    (gdb)
    gdb is reporting like 10 -15 threads being created, but I thought I had done what I could to remove thread support. Do I need to configure gdb without thread support? Are all those threads actually gdb threads?

    My laptop is about to take a trip out the window

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2005
    Location
    Brockville, Ontario, Canada
    Posts
    74

    More info

    I flip between using kdevelop and command line for editing and compiling and occassionally when I try to import my qmake-based project kdevelop craps out. The backtrace also makes reference to the libthread_db library, as has the segmentation fault type errors.

    Could that library be a problem? I'm using gcc-3.2.3 for compiling. Should I be using a libthread_db library file that is somehow better associated with this older compiler than the one my system shipped with (v3.4 I believe).

    I'm at a total loss here. Sometimes I never see any problems and life is good, the code works.

  6. #5
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    I have no experience with threads but here's an idea: instead of using
    gdb try putting infinite loops at various places in your programme and
    while it executes one of those see if you can get any useful info with ps
    I wonder also if /proc contains any useful info about the threads of a process.
    My laptop is about to take a trip out the window
    Sounds like you need a break

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •