From: Jesse Allen <the3dfxdude@gmail.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Davide Libenzi <davidel@xmailserver.org>,
Roland McGrath <roland@redhat.com>,
Andreas Schwab <schwab@suse.de>,
Daniel Jacobowitz <dan@debian.org>,
Eric Pouech <pouech-eric@wanadoo.fr>,
Mike Hearn <mh@codeweavers.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, wine-devel <wine-devel@winehq.com>
Subject: Re: ptrace single-stepping change breaks Wine
Date: Mon, 22 Nov 2004 16:15:21 -0700 [thread overview]
Message-ID: <20041122231521.GA5966@tesore.ph.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0411212212530.20993@ppc970.osdl.org>
On Sun, Nov 21, 2004 at 10:23:41PM -0800, Linus Torvalds wrote:
>
> Ok, how about this patch?
>
> It does basically two things:
>
> - it makes the x86 version of ptrace be a lot more careful about the TF
> bit in eflags, and in particular it never touches it _unless_ the
> tracer has explicitly asked for it (ie we set TF only when doing a
> PTRACE_SINGESTEP, and we clear it only when it has been set by us, not
> if it has been set by the program itself).
>
> This patch also cleans up the codepaths by doing all the common stuff
> in set_singlestep()/clear_singlestep().
>
> - It clarifies signal handling, and makes it clear that we always push
> the full eflags onto the signal stack, _except_ if the TF bit was set
> by an external ptrace user, in which case we hide it so that the tracee
> doesn't see it when it looks at its stack contents.
>
> It also adds a few comments, and makes it clear that the signal handler
> itself is always set up with TF _clear_. But if we were single-stepped
> into it, we will have notified the debugger, so the debugger obviously
> can (and often will) decide to continue single-stepping.
>
> IMHO, this is a nice cleanup, and it also means that I can actually debug
> my "program from hell":
>
> [torvalds@evo ~]$ gdb ./a.out
> GNU gdb Red Hat Linux (6.1post-1.20040607.41rh)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols
> found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".
>
> (gdb) run
> Starting program: /home/torvalds/a.out
> Reading symbols from shared object read from target memory...(no debugging
> symbols found)...done.
> Loaded system supplied DSO at 0xffffe000
> (no debugging symbols found)...(no debugging symbols found)...
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x08048480 in main ()
> (gdb) signal SIGTRAP
> Continuing with signal SIGTRAP.
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x08048487 in main ()
> (gdb) signal SIGTRAP
> Continuing with signal SIGTRAP.
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x08048488 in smc ()
> (gdb) signal SIGTRAP
> Continuing with signal SIGTRAP.
> Copy protected: ok
>
> Program exited with code 01.
> (gdb)
>
> which I think is a sign that this patch actually fixes ptrace.
>
> Does this help with wine? I dunno. Maybe some wine people can comment..
>
For the wine app in question, it does make a difference. However, there is
a new problem. The program gets stuck at the loading screen at 100% CPU.
It's making a call to select, timing out, and then tries select again,
repeats. It's waiting for something that seems to never happen.
I've captured a log, "loop.log.bz2", and shortened to have only the relevent
information after the CMS32_MUTEX is created. Look for occurances of
"select()" -- I think the second one is where it starts. It's on my ftp if
anyone wants to take a look. It probably can be compared to the working-
version log where this doesn't occur, but it might be a pain to spot the
working particular instance.
Jesse
next prev parent reply other threads:[~2004-11-22 23:19 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.58.0411151439270.2222@ppc970.osdl.org>
2004-11-15 22:53 ` ptrace single-stepping change breaks Wine Roland McGrath
2004-11-19 19:00 ` Eric Pouech
2004-11-19 19:20 ` Linus Torvalds
2004-11-19 19:33 ` Eric Pouech
2004-11-19 19:51 ` Linus Torvalds
2004-11-19 20:41 ` Eric Pouech
2004-11-19 21:22 ` Linus Torvalds
2004-11-19 21:23 ` Daniel Jacobowitz
2004-11-19 21:53 ` Linus Torvalds
2004-11-20 21:49 ` Jesse Allen
2004-11-21 4:55 ` Jesse Allen
2004-11-21 21:32 ` Davide Libenzi
2004-11-21 22:33 ` Linus Torvalds
2004-11-21 23:14 ` Davide Libenzi
2004-11-22 1:12 ` Linus Torvalds
2004-11-22 0:13 ` Andreas Schwab
2004-11-22 1:07 ` Linus Torvalds
2004-11-22 4:06 ` Davide Libenzi
2004-11-22 4:29 ` Linus Torvalds
2004-11-22 6:23 ` Linus Torvalds
2004-11-22 11:06 ` Andreas Schwab
2004-11-22 16:27 ` Linus Torvalds
2004-11-22 13:46 ` Davide Libenzi
2004-11-22 23:15 ` Jesse Allen [this message]
2004-11-22 23:48 ` Jesse Allen
2004-11-28 17:01 ` Eric Pouech
2004-11-22 20:52 ` Eric Pouech
2004-11-22 21:10 ` Linus Torvalds
2004-11-22 22:19 ` Mike Hearn
2004-11-22 22:25 ` Linus Torvalds
2004-12-29 2:14 ` Thomas Sailer
2004-12-29 15:02 ` Mike Hearn
2004-12-29 18:53 ` Linus Torvalds
2004-12-29 19:40 ` Jesse Allen
2004-12-29 20:04 ` Linus Torvalds
2004-12-29 21:43 ` Jesse Allen
2004-12-30 0:44 ` Linus Torvalds
2004-12-30 1:13 ` Davide Libenzi
2004-12-30 1:55 ` Linus Torvalds
2004-12-30 4:51 ` Linus Torvalds
2004-12-30 4:58 ` Linus Torvalds
2004-12-30 5:07 ` Davide Libenzi
2004-12-30 7:26 ` Linus Torvalds
2004-12-30 17:59 ` Davide Libenzi
2004-12-30 18:16 ` Linus Torvalds
2004-12-30 19:27 ` Jesse Allen
2004-12-30 19:34 ` Linus Torvalds
2004-12-30 22:46 ` Linus Torvalds
2004-12-30 23:00 ` Daniel Jacobowitz
2004-12-30 23:17 ` Linus Torvalds
2004-12-31 5:36 ` Daniel Jacobowitz
2004-12-31 5:47 ` Linus Torvalds
2004-12-31 7:00 ` Jesse Allen
2004-12-31 15:10 ` Daniel Jacobowitz
2004-12-31 17:19 ` Linus Torvalds
2005-01-01 23:20 ` Daniel Jacobowitz
2005-01-29 9:25 ` Kari Hurtta
2004-12-30 23:15 ` Andi Kleen
2004-12-31 0:38 ` Linus Torvalds
2004-12-31 12:35 ` Andi Kleen
2004-12-31 15:16 ` Davide Libenzi
2004-12-31 17:30 ` Linus Torvalds
2004-12-31 19:55 ` Jesse Allen
2004-12-31 17:14 ` Linus Torvalds
2004-12-31 4:55 ` Jesse Allen
2004-12-31 5:05 ` Linus Torvalds
2004-12-31 5:38 ` Daniel Jacobowitz
2004-12-30 19:19 ` Davide Libenzi
2004-12-30 5:06 ` Davide Libenzi
2004-12-30 4:28 ` Jesse Allen
2004-12-29 20:56 ` Jesse Allen
2004-12-29 19:35 ` Thomas Sailer
2004-12-29 20:13 ` Jesse Allen
2004-12-30 1:49 ` Thomas Sailer
2004-12-30 2:10 ` Linus Torvalds
2004-12-30 2:39 ` Thomas Sailer
2004-12-30 2:57 ` Thomas Sailer
2004-12-30 3:15 ` Thomas Sailer
2004-12-30 4:15 ` Andrew Morton
2004-12-30 10:09 ` Thomas Sailer
2004-12-30 13:06 ` Mike Hearn
2004-12-31 13:13 ` Thomas Sailer
2004-12-31 13:31 ` Mike Hearn
2004-12-31 15:42 ` Jesse Allen
2004-12-31 15:56 ` Davide Libenzi
2004-12-31 15:59 ` Jesse Allen
2004-12-31 22:01 ` Linus Torvalds
2005-01-01 22:04 ` Davide Libenzi
2005-01-01 22:14 ` Linus Torvalds
2005-01-02 3:46 ` Davide Libenzi
2005-01-07 4:51 ` minor nit with decoding popf instruction - was " John Kacur
2005-01-07 6:48 ` Linus Torvalds
2005-01-08 5:05 ` John Kacur
2004-12-31 15:51 ` Thomas Sailer
[not found] ` <1104873315.3557.87.camel@littlegreen>
2005-01-04 21:21 ` Andrew Morton
2005-01-05 10:43 ` Thomas Sailer
2005-01-05 11:24 ` Ingo Molnar
2005-01-05 11:40 ` Alexandre Julliard
2004-12-30 12:11 ` Mike Hearn
2004-11-20 3:40 ` Roland McGrath
2004-11-19 20:59 ` Grzegorz Kulewski
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=20041122231521.GA5966@tesore.ph.cox.net \
--to=the3dfxdude@gmail.com \
--cc=akpm@osdl.org \
--cc=dan@debian.org \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mh@codeweavers.com \
--cc=pouech-eric@wanadoo.fr \
--cc=roland@redhat.com \
--cc=schwab@suse.de \
--cc=torvalds@osdl.org \
--cc=wine-devel@winehq.com \
/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;
as well as URLs for NNTP newsgroup(s).