|
From: Eric P. <eri...@wa...> - 2006-01-26 20:31:30
|
Hi folks, I've just been trying to make Wine run under valgrind (3.1.0). Things greately evolved since our last tries: we can now run lots of applications, and a major part of our test suite under valgrind. congrats folks!! The down side being of course some more bugs to fix <g>. I've posted two patches in bugzilla to improve some parts, which hopefully can make for 3.2.0. There's still a showstopper for a better Wine support. The way we handle SEH (structured exception handling in Windows's terms) doesn't work with valgrind (tested on x86). Basically, Wine needs to translate some Unix signals into exceptions (in Windows language). For lots of reason, we decided to implement this situation with: - grabbing information about the signal (sigcontext, cause of the signal - btw, on the two patches I'm talking of is about trapno information that we do need). This is done in the unix signal handler - from the unix signal handler, push that information onto the stack (thread stack, not the signal handler stack) - change EIP in the sigcontext to the address of a dedicated function of ours - when the finish the signal handler, execution will resume in the dedicated function, where we can transfer all signal information, but executed on the thread stack (not the signal stack) We had to do it for reasons dealing mainly for race issues. What doesn't currently work in valgrind is changing the EIP in the sigcontext. Current implementation of restore_sigcontext() in coregrind/m_sigframe/sigframe-x86-linux.c doesn't restore EIP into VEX: when we return from the signal handler, execution resumes at the opcode with first generated the signal. Back to square one :-/ I simply tried to set EIP back in the restore_sigcontext() function, but this leads to a crash in IR (about unsupported opcode). I suppose I'm missing something (like resetting some other elements for execution in some other places). Anything I could do about this ? TIA -- Eric Pouech |