Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:11:53+00:00 2026-05-15T21:11:53+00:00

I’ve run into some problems debugging a multi-threaded process using GDB. I have a

  • 0

I’ve run into some problems debugging a multi-threaded process using GDB. I have a multi-threaded process that splinters off into several (8 or 9) different threads, and I am trying to determine what the contents of variables are when the constructor for a class called XML_File_Data is called. However, I’ve run into a problem where, after I apply the correct function breakpoint to all threads and it’s apparent one of the thread’s break point is getting hit (the program temporarily halts execution), I’m not able to determine which thread hit the breakpoint. The command

(gdb) thread apply all where

is giving me shockingly useless information in the form:

#0  0x004ab410 in __kernel_vsyscall ()
#1  0x05268996 in nanosleep () from /lib/libc.so.6
#2  0x052a215c in usleep () from /lib/libc.so.6
#3  0x082ee313 in frame_clock_frame_end (clock=0xb4bfd2f8)
    at frame_clock.c:143
#4  0x003a349a in ?? ()
#5  0x00b5cfde in thread_proxy ()
   from /cets_development_libraries/install/lib/libboost_thread-gcc41-mt-1_38.so.1.38.0
#6  0x02c1f5ab in start_thread () from /lib/libpthread.so.0
#7  0x052a8cfe in clone () from /lib/libc.so.6

Of the 9 processes, 7 or so are giving me almost exactly that output, and the information about the last 2 isn’t really much more helpful (functions far down the call stack have recognizable names, but any recent #0-#4 functions aren’t recognizable).

This is what I have so far:

(gdb) gdb
(gdb) gdb attach <processid>
(gdb) thread apply all 'XML_File_Data::XML_File_Data()'

and (after the breakpoint is hit)

(gdb) thread apply all where

Could any experienced debuggers offer me some hints on what I am doing wrong or what is normally done in this situation?

Cheers,
Charlie

EDIT: Fortunately, I was able to find out that the cause of the ??’s was optimized code being run through the debugger, in addition to not running the debugger in the directory of the executable file. Still not much success with the debugging though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:11:53+00:00Added an answer on May 15, 2026 at 9:11 pm

    You can use command thread or info threads to find out the current thread number after breakpoint hit

    (gdb) thread
    [Current thread is 1 (Thread 0xb790d6c0 (LWP 2519))]
    (gdb)
    
    (gdb) info threads
      17 Thread 0xb789cb90 (LWP 2536)  0xb7fc6402 in __kernel_vsyscall ()
      16 Thread 0xb769bb90 (LWP 2537)  0xb7fc6402 in __kernel_vsyscall ()
      15 Thread 0xb749ab90 (LWP 2543)  0xb7fc6402 in __kernel_vsyscall ()
      14 Thread 0xb7282b90 (LWP 2544)  0xb7fc6402 in __kernel_vsyscall ()
      13 Thread 0xb5827b90 (LWP 2707)  0xb7fc6402 in __kernel_vsyscall ()
      12 Thread 0xb5626b90 (LWP 2708)  0xb7fc6402 in __kernel_vsyscall ()
      11 Thread 0xb5425b90 (LWP 2709)  0xb7fc6402 in __kernel_vsyscall ()
      10 Thread 0xb5161b90 (LWP 2713)  0xb7fc6402 in __kernel_vsyscall ()
      9 Thread 0xb4ef9b90 (LWP 2715)  0xb7fc6402 in __kernel_vsyscall ()
      8 Thread 0xb4af7b90 (LWP 2717)  0xb7fc6402 in __kernel_vsyscall ()
      7 Thread 0xb46ffb90 (LWP 2718)  0xb7fc6402 in __kernel_vsyscall ()
      6 Thread 0xb44feb90 (LWP 2726)  0xb7fc6402 in __kernel_vsyscall ()
      5 Thread 0xb42fdb90 (LWP 2847)  0xb7fc6402 in __kernel_vsyscall ()
      4 Thread 0xb40fcb90 (LWP 2848)  0xb7fc6402 in __kernel_vsyscall ()
      3 Thread 0xb3efbb90 (LWP 2849)  0xb7fc6402 in __kernel_vsyscall ()
      2 Thread 0xb3cfab90 (LWP 2850)  0xb7fc6402 in __kernel_vsyscall ()
    * 1 Thread 0xb790d6c0 (LWP 2519)  0xb7fc6402 in __kernel_vsyscall ()
    (gdb)
    

    An asterisk `*’ to the left of the gdb thread number indicates the current thread. See here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.