From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26688 invoked by alias); 11 Jun 2010 11:07:50 -0000 Received: (qmail 26662 invoked by uid 48); 11 Jun 2010 11:07:48 -0000 Date: Fri, 11 Jun 2010 11:07:00 -0000 Message-ID: <20100611110748.26661.qmail@sourceware.org> From: "frederic dot riss at gmail dot com" To: gdb-prs@sourceware.org In-Reply-To: <20100611085114.11692.frederic.riss@gmail.com> References: <20100611085114.11692.frederic.riss@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug threads/11692] GDB internal error when using pthread_attr_setaffinity_np X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00398.txt.bz2 ------- 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 **** 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) **** 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) **** 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.