public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "frederic dot riss at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/11692] GDB internal error when using pthread_attr_setaffinity_np
Date: Fri, 11 Jun 2010 11:07:00 -0000	[thread overview]
Message-ID: <20100611110748.26661.qmail@sourceware.org> (raw)
In-Reply-To: <20100611085114.11692.frederic.riss@gmail.com>


------- Additional Comments From frederic dot riss at gmail dot com  2010-06-11 11:07 -------
Having debugged my code a bit further, this could very well be a bug in
libthread_db (One might argue that GDB shouldn't crash anyways). The thing is
that the second thread creation of the program will fail because the cpu_set
does reference an unexisting CPU. Thus there could be some thread event because
pthread_create is called, but the thread never actually exists because the call
fails. Strange thing is that this doesn't happen if you only launch one thread,
you have to launch a second one for the problem to appear.

Here's the requested debug output:
(gdb) set debug infrun 1
(gdb) set debug lin-lwp 1
(gdb) r
Starting program: /tmp/a.out 
linux_nat_wait: [process 22258]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
LLW: trap ptid is process 22258.
LLR: Preparing to resume process 22258, 0, inferior_ptid process 22258
RC: Not resuming sibling process 22258 (not stopped)
LLR: PTRACE_CONT process 22258, 0 (resume event thread)
linux_nat_wait: [process 22258]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
LLW: trap ptid is process 22258.
infrun: proceed (addr=0x726850, signal=0, step=0)
infrun: resume (step=0, signal=0), trap_expected=0
LLR: Preparing to resume process 22258, 0, inferior_ptid process 22258
RC: Not resuming sibling process 22258 (not stopped)
LLR: PTRACE_CONT process 22258, 0 (resume event thread)
infrun: wait_for_inferior (treat_exec_as_sigtrap=0)
linux_nat_wait: [process -1]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
LLW: trap ptid is process 22258.
infrun: target_wait (-1, status) =
infrun:   22258 [process 22258],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x7350d0
infrun: BPSTAT_WHAT_CHECK_SHLIBS
infrun: no stepping, continue
infrun: resume (step=1, signal=0), trap_expected=1
LLR: Preparing to step process 22258, 0, inferior_ptid process 22258
LLR: PTRACE_SINGLESTEP process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
SEL: Select single-step process 22258
LLW: trap ptid is process 22258.
infrun: target_wait (-1, status) =
infrun:   22258 [process 22258],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x7350d1
infrun: no stepping, continue
infrun: resume (step=0, signal=0), trap_expected=0
LLR: Preparing to resume process 22258, 0, inferior_ptid process 22258
RC: Not resuming sibling process 22258 (not stopped)
LLR: PTRACE_CONT process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
LLW: trap ptid is process 22258.
infrun: target_wait (-1, status) =
infrun:   22258 [process 22258],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x7350d0
infrun: BPSTAT_WHAT_CHECK_SHLIBS
[Thread debugging using libthread_db enabled]
infrun: no stepping, continue
infrun: resume (step=1, signal=0), trap_expected=1
LLR: Preparing to step process 22258, 0, inferior_ptid process 22258
LLR: PTRACE_SINGLESTEP process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 22258.
SEL: Select single-step process 22258
LLW: trap ptid is process 22258.
infrun: target_wait (-1, status) =
infrun:   22258 [process 22258],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x7350d1
infrun: no stepping, continue
infrun: resume (step=0, signal=0), trap_expected=0
LLR: Preparing to resume process 22258, 0, inferior_ptid process 22258
RC: Not resuming sibling process 22258 (not stopped)
LLR: PTRACE_CONT process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22261 received Stopped (signal) (stopped)
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLW: Handling extended status 0x03057f
LHEW: Got clone event from LWP 22258, resuming
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLTA: KILL(SIG0) LWP 22258 (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 22258.
SC:  kill LWP 22261 **<SIGSTOP>**
SC:  lwp kill 0 ERRNO-OK
WL: waitpid LWP 22261 received Stopped (signal) (stopped)
LLW: trap ptid is LWP 22258.
[New Thread 0xb7fe0b70 (LWP 22261)]
infrun: target_wait (-1, status) =
infrun:   22258 [Thread 0xb7fe16c0 (LWP 22258)],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8f7980
infrun: BPSTAT_WHAT_SINGLE
infrun: no stepping, continue
infrun: resume (step=1, signal=0), trap_expected=1
LLR: Preparing to step Thread 0xb7fe16c0 (LWP 22258), 0, inferior_ptid Thread
0xb7fe16c0 (LWP 22258)
LLR: PTRACE_SINGLESTEP process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22258 received Trace/breakpoint trap (stopped)
LLTA: KILL(SIG0) Thread 0xb7fe16c0 (LWP 22258) (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in Thread 0xb7fe16c0 (LWP
22258).
SEL: Select single-step Thread 0xb7fe16c0 (LWP 22258)
LLW: trap ptid is Thread 0xb7fe16c0 (LWP 22258).
infrun: target_wait (-1, status) =
infrun:   22258 [Thread 0xb7fe16c0 (LWP 22258)],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8f7981
infrun: no stepping, continue
infrun: resume (step=0, signal=0), trap_expected=0
LLR: Preparing to resume process 22258, 0, inferior_ptid Thread 0xb7fe16c0 (LWP
22258)
RC:  PTRACE_CONT Thread 0xb7fe0b70 (LWP 22261), 0, 0 (resuming sibling)
RC:  PTRACE_CONT Thread 0xb7fe0b70 (LWP 22261), 0, 0 (resume sibling)
RC: Not resuming sibling Thread 0xb7fe16c0 (LWP 22258) (not stopped)
LLR: PTRACE_CONT process 22258, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
I'm alive!
LLW: waitpid 22262 received Stopped (signal) (stopped)
LLW: waitpid 22261 received Trace/breakpoint trap (stopped)
LLTA: KILL(SIG0) Thread 0xb7fe0b70 (LWP 22261) (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in Thread 0xb7fe0b70 (LWP
22261).
SC:  kill Thread 0xb7fe16c0 (LWP 22258) **<SIGSTOP>**
SC:  lwp kill 0 ERRNO-OK
WL: waitpid Thread 0xb7fe16c0 (LWP 22258) received Trace/breakpoint trap (stopped)
WL: Handling extended status 0x03057f
LHEW: Got clone event from LWP 22258, resuming
WL: waitpid Thread 0xb7fe16c0 (LWP 22258) received Stopped (signal) (stopped)
LLW: trap ptid is Thread 0xb7fe0b70 (LWP 22261).
infrun: target_wait (-1, status) =
infrun:   22258 [Thread 0xb7fe0b70 (LWP 22261)],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8f7990
infrun: context switch
infrun: Switching context from Thread 0xb7fe16c0 (LWP 22258) to Thread
0xb7fe0b70 (LWP 22261)
infrun: BPSTAT_WHAT_SINGLE
infrun: no stepping, continue
infrun: resume (step=1, signal=0), trap_expected=1
LLR: Preparing to step Thread 0xb7fe0b70 (LWP 22261), 0, inferior_ptid Thread
0xb7fe0b70 (LWP 22261)
LLR: PTRACE_SINGLESTEP process 22261, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22261 received Trace/breakpoint trap (stopped)
LLTA: KILL(SIG0) Thread 0xb7fe0b70 (LWP 22261) (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in Thread 0xb7fe0b70 (LWP
22261).
SEL: Select single-step Thread 0xb7fe0b70 (LWP 22261)
LLW: trap ptid is Thread 0xb7fe0b70 (LWP 22261).
infrun: target_wait (-1, status) =
infrun:   22258 [Thread 0xb7fe0b70 (LWP 22261)],
infrun:   status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8f7991
infrun: no stepping, continue
infrun: resume (step=0, signal=0), trap_expected=0
LLR: Preparing to resume process 22258, 0, inferior_ptid Thread 0xb7fe0b70 (LWP
22261)
RC:  PTRACE_CONT LWP 22262, 0, 0 (resuming sibling)
RC:  PTRACE_CONT LWP 22262, 0, 0 (resume sibling)
RC: Not resuming sibling Thread 0xb7fe0b70 (LWP 22261) (not stopped)
RC:  PTRACE_CONT Thread 0xb7fe16c0 (LWP 22258), 0, 0 (resuming sibling)
RC:  PTRACE_CONT Thread 0xb7fe16c0 (LWP 22258), 0, 0 (resume sibling)
LLR: PTRACE_CONT process 22261, 0 (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1]
LLW: waitpid 22262 received Unknown signal 32 (stopped)
LLTA: KILL(SIG0) LWP 22262 (OK)
LLW: PTRACE_CONT LWP 22262, Unknown signal 77 (preempt 'handle')
LLW: waitpid 22261 received 0 (exited)
LLW: Thread 0xb7fe0b70 (LWP 22261) exited.
[Thread 0xb7fe0b70 (LWP 22261) exited]
LLW: waitpid 22262 received Trace/breakpoint trap (stopped)
LLTA: KILL(SIG0) LWP 22262 (OK)
LLW: Candidate event Trace/breakpoint trap (stopped) in LWP 22262.
SC:  kill Thread 0xb7fe16c0 (LWP 22258) **<SIGSTOP>**
SC:  lwp kill 0 ERRNO-OK
WL: waitpid Thread 0xb7fe16c0 (LWP 22258) received Stopped (signal) (stopped)
LLW: trap ptid is LWP 22262.
infrun: target_wait (-1, status) =
infrun:   -1 [process -1],
infrun:   status->kind = spurious
../../gdb/infrun.c:2887: internal-error: handle_inferior_event: Assertion `inf'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11692

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2010-06-11 11:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11  8:51 [Bug threads/11692] New: " frederic dot riss at gmail dot com
2010-06-11  8:51 ` [Bug threads/11692] " frederic dot riss at gmail dot com
2010-06-11 10:36 ` pedro at codesourcery dot com
2010-06-11 10:43 ` frederic dot riss at gmail dot com
2010-06-11 10:54 ` pedro at codesourcery dot com
2010-06-11 10:55 ` frederic dot riss at gmail dot com
2010-06-11 11:01 ` pedro at codesourcery dot com
2010-06-11 11:07 ` frederic dot riss at gmail dot com [this message]
2010-06-11 11:20 ` pedro at codesourcery dot com
2010-06-11 11:29 ` pedro at codesourcery dot com
     [not found] <bug-11692-4717@http.sourceware.org/bugzilla/>
2011-08-03 21:19 ` crow at linux dot org.ba
2011-08-03 21:41 ` sergiodj at redhat dot com
2012-05-29 16:17 ` palves at redhat dot com
2012-06-14 15:01 ` palves at redhat dot com
2012-06-14 15:17 ` palves at redhat dot com
2012-07-20 17:28 ` cvs-commit at gcc dot gnu.org
2012-07-20 17:36 ` palves at redhat dot com
2012-07-21  9:43 ` palves at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100611110748.26661.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).