|
From: Julian S. <js...@ac...> - 2005-08-01 17:21:37
|
On Monday 01 August 2005 15:46, Duncan Sands wrote: > > > I've noticed that I need to use smc-check=all, rather than > > > smc-check=stack, when running a multithreaded program that > > > uses trampolines. Presumably valgrind hasn't understood > > > that the new thread's stack is a stack. Is this the > > > intended behaviour? > > > > No, certainly not. It sounds like a bug in the is-this-a-stack? > > department. Can you send a binary I can try? The cause of this is that with --smc-check=stack (the default) V does self-checking translations for code taken from segments which have the SF_GROWDOWN flag set. Unfortunately that appears to be only the initial thread at least on NPTL, and not the child stack threads. (Tom/Jeremy, is that indeed the case with NPTL?) My proposed fix (which I just tried and it works) is to instead do a self-checking translation if the segment from which the translation is to be taken is the same one into which the requesting thread's simulated stack pointer points. If you see what I mean. Does anyone see anything that could go disastrously wrong as a result? J |