[Bug 12948] zmud does not run under Ubuntu 8.04 (...turn off system debuggers)

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Oct 19 07:02:45 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=12948





--- Comment #11 from Anastasius Focht <focht at gmx.net>  2008-10-19 07:02:43 ---
Hello,

revisiting... some unsatisfying stuff never leaves my mind ;-)

After reanalyzing the logs I came to conclusion this might be a Linux 2.6
kernel bug.
The main problem is that the child thread wakes up - creating mutexes before
the father (debugger) - when it isn't supposed to.
After debug_process() the child should be left in stopped state until the debug
events are handled in father debugger loop (see log, child main thread received
SIGSTOP).

The father restores the child's entry point to original state using
WriteProcessMemory().
Wine(server) uses ptrace() facility to carry out the task of writing process
memory.

1. ptrace PTRACE_ATTACH which should generate SIGSTOP.
2. waits until target is stopped (SIGSTOP seen).
3. carries out the memory write.
4. ptrace PTRACE_DETACH to continue in normal untraced mode (resume execution,
depending on state)

The last step should leave the child in stopped state because as it was already
with earlier debug_process() and the father (debugger) loop didn't handle the
initial debug events yet.

What happens is that sometimes the child main thread is unconditionally woken
up so I think ptrace() is to blame here.
As quickfix I looked at thread state before the ptrace sequence and doing
PTRACE_DETACH( ... SIGSTOP) if the target was in stopped state before to
prevent spurious wakeup after detach.
But even that doesn't seem to work reliably .. sucks.

At least the problem seems to be harder to reproduce in my late 2.6.26 kernels.

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list