From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32665 invoked by alias); 20 Nov 2014 17:11:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32654 invoked by uid 89); 20 Nov 2014 17:11:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 20 Nov 2014 17:11:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id E4EE3116BC6; Thu, 20 Nov 2014 12:11:40 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id aObmbpz5ZICk; Thu, 20 Nov 2014 12:11:40 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3A04D1167A8; Thu, 20 Nov 2014 12:11:39 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 7306B40F79; Thu, 20 Nov 2014 21:11:37 +0400 (RET) Date: Thu, 20 Nov 2014 17:11:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: RFC: skip_inline_frames failed assertion resuming from breakpoint on LynxOS Message-ID: <20141120171137.GT5774@adacore.com> References: <20141120051109.GR5774@adacore.com> <20141120051223.GA23720@adacore.com> <546DBA9F.9060600@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <546DBA9F.9060600@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-11/txt/msg00481.txt.bz2 Hi Pedro, > > infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT, step=0) > > infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 > > trap_expected=1 indicates that GDB is about to step thread 142 _only_, leaving > everything else stopped. Can you enable "set debug remote 1" as well? Correct (we are single-stepping out of a breakpoint). Here is the output with remote debugging: | Continuing. | infrun: clear_proceed_status_thread (Thread 126) | infrun: clear_proceed_status_thread (Thread 147) | infrun: clear_proceed_status_thread (Thread 134) | infrun: clear_proceed_status_thread (Thread 135) | infrun: clear_proceed_status_thread (Thread 133) | infrun: clear_proceed_status_thread (Thread 136) | infrun: clear_proceed_status_thread (Thread 127) | infrun: clear_proceed_status_thread (Thread 129) | infrun: clear_proceed_status_thread (Thread 128) | infrun: clear_proceed_status_thread (Thread 130) | infrun: clear_proceed_status_thread (Thread 132) | infrun: clear_proceed_status_thread (Thread 141) | infrun: clear_proceed_status_thread (Thread 131) | infrun: clear_proceed_status_thread (Thread 137) | infrun: clear_proceed_status_thread (Thread 138) | infrun: clear_proceed_status_thread (Thread 139) | infrun: clear_proceed_status_thread (Thread 140) | infrun: clear_proceed_status_thread (Thread 142) | infrun: clear_proceed_status_thread (Thread 143) | infrun: clear_proceed_status_thread (Thread 144) | infrun: clear_proceed_status_thread (Thread 145) | infrun: clear_proceed_status_thread (Thread 146) | infrun: clear_proceed_status_thread (Thread 125) | infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT, step=0) | infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 | Sending packet: $Hg8e#4c...Packet received: OK | Sending packet: $m10684838,4#73...Packet received: 4ba1db21 | Sending packet: $QPassSignals:#f3...Packet received: OK | Sending packet: $vCont;s:8e#8f...infrun: wait_for_inferior () | Packet received: T2e01:3a440910;40:10a187f4;thread:92; | infrun: target_wait (-1, status) = | infrun: 42000 [Thread 146], | infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_34 | infrun: infwait_normal_state | infrun: TARGET_WAITKIND_STOPPED | infrun: stop_pc = 0x10a187f4 | infrun: context switch | infrun: Switching context from Thread 142 to Thread 146 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $g#67...Packet received: 000000c33a4409102003b21020ed76a83a4408d80000000000000007000100010001005b20ed76a820ed79380000000010abd7a10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402000e6883a4409103fc34833395728754082c13483339573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e112e0be826d69500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a187f40000f030220000481099d6dc109db33420000000fff80000 | infrun: random signal (GDB_SIGNAL_REALTIME_34) | Sending packet: $T8e#f1...Packet received: OK | infrun: switching back to stepped thread | infrun: Switching context from Thread 146 to Thread 142 | Sending packet: $Hg8e#4c...Packet received: OK | Sending packet: $g#67...Packet received: 103422e83a8948e02003b21000000000000000000000000900000008000000090000000020037a301068480800000000220000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402001791c3a89499000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106848380002f43042000042103422e81068480820000000fff80000 | infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 | Sending packet: $m10684838,4#73...Packet received: 4ba1db21 | Sending packet: $vCont;s:8e#8f...infrun: prepare_to_wait | Packet received: T2f01:3a55b910;40:10a187f4;thread:91; | infrun: target_wait (-1, status) = | infrun: 42000 [Thread 145], | infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_35 | infrun: infwait_normal_state | infrun: TARGET_WAITKIND_STOPPED | infrun: stop_pc = 0x10a187f4 | infrun: context switch | infrun: Switching context from Thread 142 to Thread 145 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $g#67...Packet received: 000000c33a55b9102003b21020ed76b03a55b8d800000000000001fe000000010000000120ed76b0100703ac00000000280000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402000e6883a55b9100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a187f40000f030280000081099d6dc109db33400000000fff80000 | infrun: random signal (GDB_SIGNAL_REALTIME_35) | Sending packet: $T8e#f1...Packet received: OK | infrun: switching back to stepped thread | infrun: Switching context from Thread 145 to Thread 142 | Sending packet: $Hg8e#4c...Packet received: OK | Sending packet: $g#67...Packet received: 103422e83a8948e02003b21000000000000000000000000900000008000000090000000020037a301068480800000000220000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402001791c3a89499000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106848380002f43042000042103422e81068480820000000fff80000 | infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 | Sending packet: $m10684838,4#73...Packet received: 4ba1db21 | Sending packet: $vCont;s:8e#8f...infrun: prepare_to_wait | Packet received: T3001:3a65e910;40:10a187f4;thread:90; | infrun: target_wait (-1, status) = | infrun: 42000 [Thread 144], | infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_36 | infrun: infwait_normal_state | infrun: TARGET_WAITKIND_STOPPED | infrun: stop_pc = 0x10a187f4 | infrun: context switch | infrun: Switching context from Thread 142 to Thread 144 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $g#67...Packet received: 000000c33a65e9102003b21020ed76b83a65e8d820f44dcc00000001000000020000000220ed76b800000060000016e020ef70900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402000e6883a65e910408206d1cf98259e4081f6d1cf98259e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004081f6d1cf98259e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a187f40000f030230000481099d6dc109db33400000000fff80000 | infrun: random signal (GDB_SIGNAL_REALTIME_36) | Sending packet: $T8e#f1...Packet received: OK | infrun: switching back to stepped thread | infrun: Switching context from Thread 144 to Thread 142 | Sending packet: $Hg8e#4c...Packet received: OK | Sending packet: $g#67...Packet received: 103422e83a8948e02003b21000000000000000000000000900000008000000090000000020037a301068480800000000220000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402001791c3a89499000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106848380002f43042000042103422e81068480820000000fff80000 | infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 | Sending packet: $m10684838,4#73...Packet received: 4ba1db21 | Sending packet: $vCont;s:8e#8f...infrun: prepare_to_wait | Packet received: T3101:3a791910;40:10a187f4;thread:8f; | infrun: target_wait (-1, status) = | infrun: 42000 [Thread 143], | infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_37 | infrun: infwait_normal_state | infrun: TARGET_WAITKIND_STOPPED | infrun: stop_pc = 0x10a187f4 | infrun: context switch | infrun: Switching context from Thread 142 to Thread 143 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $g#67...Packet received: 000000c33a7919102003b21020ed76c03a7918d800000000000002123a7919905448524420ed76c0b07da7b020f07728200000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402000e6883a7919100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010a187f40000f030280000081099d6dc109db33400000000fff80000 | infrun: random signal (GDB_SIGNAL_REALTIME_37) | Sending packet: $T8e#f1...Packet received: OK | infrun: switching back to stepped thread | infrun: Switching context from Thread 143 to Thread 142 | Sending packet: $Hg8e#4c...Packet received: OK | Sending packet: $g#67...Packet received: 103422e83a8948e02003b21000000000000000000000000900000008000000090000000020037a301068480800000000220000420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020f071402001791c3a89499000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000106848380002f43042000042103422e81068480820000000fff80000 | infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 142] at 0x10684838 | Sending packet: $m10684838,4#73...Packet received: 4ba1db21 | Sending packet: $vCont;s:8e#8f...infrun: prepare_to_wait | Packet received: T2e01:3a440910;40:10a187f4;thread:92; | infrun: target_wait (-1, status) = | infrun: 42000 [Thread 146], | infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_34 | infrun: infwait_normal_state | infrun: TARGET_WAITKIND_STOPPED | infrun: stop_pc = 0x10a187f4 | infrun: context switch | infrun: Switching context from Thread 142 to Thread 146 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | Sending packet: $m10a187f0,4#c5...Packet received: 44000002 | ../../src/gdb/inline-frame.c:339: internal-error: skip_inline_frames: Assertion `find_inline_frame_state (ptid) == NULL' failed. > > infrun: wait_for_inferior () > > infrun: target_wait (-1, status) = > > infrun: 42000 [Thread 146], > > infrun: status->kind = stopped, signal = GDB_SIGNAL_REALTIME_34 > > So how come we see an event for thread 146? That thread shouldn't > have been resumed, so GDB shouldn't be getting an event for it. > > This is sounding like a bug in the target. I thought about this too, and there might be a ptrace request I can use to absolutely limit the resumption to the one thread. I say "might" because only testing will show if the request is supported, and works, on all versions of LynxOS. But I have always been relunctant to do so for 2 reasons [1]: - It affects the program's scheduling; - Can the program lock up if we're trying to single-step a thread that's blocked? Also, what made me consider this change independently of the questions above is that it seems to me that it the situation we are facing here seems to be easily handled. So, to avoid headaches from other "buggy" targets, containing this situation seemed friendlier. Don't we also have other targets that don't have the capability to resume one single thread? -- Joel [1]: I realize that this opens the door for other threads executing this instruction without triggering a breakpoint. I can't explain why I am more concerned by scheduling interference than the probability of missing a breakpoint. I may bite the bullet at some point...