From: Jason Wessel <jason.wessel@windriver.com>
To: Roland McGrath <roland@redhat.com>
Cc: Chuck Ebbert <cebbert@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: i386 single-step vs int $0x80 issues
Date: Mon, 21 Apr 2008 13:00:56 -0500 [thread overview]
Message-ID: <480CD658.6030801@windriver.com> (raw)
In-Reply-To: <20080416023650.E3CBDEFFEA@magilla.localdomain>
Roland McGrath wrote:
> Jason made a change, 1e2e99f0e4aa6363e8515ed17011c210c8f1b52a on 2007-7-6:
>
> i386: fix regression, endless loop in ptrace singlestep over an int80
>
> I'm trying to figure out what the full story behind that was. The
> log message includes source for a test program. I cannot reproduce
> anything like the problem described. I tried it when building the
> kernel sources from the state just before that commit, as well as
> the current kernel with that commit's patch reverted.
>
> The list traffic I found about this did not seem to say it was an
> intermittent problem. I really cannot understand how the failure
> mode described could have been happening (except in one racy way on
> SMP only, that I don't know how to provoke). The logic of the
> change is wrong IMHO, and it broke some cases that worked before it
> (stepping into sigreturn).
Certainly I am interested in making all the cases work correctly. The
failure behavior was observed on an SMP system. I re-tested to
confirm the problem was still there.
>
> The description of the behavior of the test suggests it assumed
> that libc calls like write would use an int $0x80 syscall, which
> is not something you can rely on. I replaced the "write" call in
> the test with:
>
> asm volatile ("push %%ebx; mov %1,%%ebx; int $0x80; pop %%ebx"
> : "=a" (ret)
> : "g" (1), "a" (4), "c" (str), "d" (sizeof str - 1)
> : "ebx");
>
> But still I could not find any way to reproduce the failure mode
> that Jason's report described.
>
> The patch below and the comments it includes describe what's going
> on, why the 1e2e99f0... change was wrong, and revert it while fixing
> the one thing I saw wrong with Chuck's 635cf99a... change.
>
> But I'm not submitting this change now. Firstly, I really want to
> understand what it was that Jason saw and if there is some scenario
> here I have overlooked. Secondly, while doing this I realized there
> are some 32/64 differences in how all this handling works, and I
> think I'll rejigger it all some more to clean it up.
>
>
Certainly I'll sign off on a "tested-by" or "acked-by" header. I
tested your changes with the tip of the kernel tree on the same system
where I first saw the problem and it does not occur.
Ideally the handling on 32/64 can be closer to the same logic.
Thanks,
Jason.
next prev parent reply other threads:[~2008-04-21 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-16 2:36 i386 single-step vs int $0x80 issues Roland McGrath
2008-04-21 18:00 ` Jason Wessel [this message]
2008-04-21 21:25 ` Roland McGrath
2008-04-22 18:16 ` Jason Wessel
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=480CD658.6030801@windriver.com \
--to=jason.wessel@windriver.com \
--cc=cebbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=tglx@linutronix.de \
/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