This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug threads/11692] GDB internal error when using pthread_attr_setaffinity_np


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]