From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: In-Kernel NaT consumption trap when debugging highly-parallel
Date: Fri, 26 Mar 2004 00:52:00 +0000 [thread overview]
Message-ID: <16483.32432.235372.587515@napali.hpl.hp.com> (raw)
In-Reply-To: <16482.12999.250663.921106@wombat.chubb.wattle.id.au>
>>>>> On Thu, 25 Mar 2004 12:15:51 +1100, Peter Chubb <peter@chubb.wattle.id.au> said:
Peter> Hi, I'm trying to debug a highly-threaded user-space program,
Peter> but gdb is triggering NaT consumption faults in the middle of
Peter> ptrace.
The attached patch should fix it. Bjorn, I think the same will be needed
for 2.4.
It appears that the combination of gdb 6.x and NPTL is triggering this
bug (which has been there forever). What happened is that gdb was
trying to read r4 in a task that was in the middle of a clone2().
clone2() spills that register (via SAVE_SWITCH_STACK) along with the
(primary) UNaT. Unfortunately, the typo in run_script() which is
fixed by the patch below caused the primary-UNaT address to be
calculated as 0, which would then cause the NULL-pointer dereference.
--david
=== arch/ia64/kernel/unwind.c 1.37 vs edited ==--- 1.37/arch/ia64/kernel/unwind.c Thu Feb 19 11:27:59 2004
+++ edited/arch/ia64/kernel/unwind.c Thu Mar 25 16:34:00 2004
@@ -1746,7 +1746,7 @@
if (!state->pri_unat_loc)
state->pri_unat_loc = &state->sw->ar_unat;
/* register off. is a multiple of 8, so the least 3 bits (type) are 0 */
- s[dst+1] = (*state->pri_unat_loc - s[dst]) | UNW_NAT_MEMSTK;
+ s[dst+1] = ((unsigned long) state->pri_unat_loc - s[dst]) | UNW_NAT_MEMSTK;
break;
case UNW_INSN_SETNAT_TYPE:
prev parent reply other threads:[~2004-03-26 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 1:15 In-Kernel NaT consumption trap when debugging highly-parallel Peter Chubb
2004-03-25 2:15 ` David Mosberger
2004-03-26 0:52 ` David Mosberger [this message]
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=16483.32432.235372.587515@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@vger.kernel.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