> The cause of this crash is that in revision 7291 the behavior of
> VG_(record_ExeContext)() has been changed: in revision 7290 and before
> it was allowed to record the exe context from within
> VG_TRACK(pre_thread_create)(), but from revision 7291 on this results
> in a crash.

As per
http://www.mail-archive.com/valgrind-developers%40lists.sourceforge.net/msg01282.html
and also
http://www.mail-archive.com/valgrind-developers%40lists.sourceforge.net/msg01324.html

the cause of the crash is that drd is calling VG_(record_ExeContext) for 
a thread which all the registers are zero, leading to the unwinder crashing.

Not sure what 7291 has to do with it.  7291 simply created a copy of 
trunk 7290 post release.

My guess is the important change is this, in 7300:

--- trunk/coregrind/m_stacktrace.c      2007-12-12 11:42:33 UTC (rev 7299)
+++ trunk/coregrind/m_stacktrace.c      2007-12-15 22:13:05 UTC (rev 7300)
@@ -97,11 +97,9 @@
    /* Assertion broken before main() is reached in pthreaded programs;  the
     * offending stack traces only have one item.  --njn, 2002-aug-16 */
    /* vg_assert(fp_min <= fp_max);*/
-
-   if (fp_min + VG_(clo_max_stackframe) <= fp_max) {
-      /* If the stack is ridiculously big, don't poke around ... but
-         don't bomb out either.  Needed to make John Regehr's
-         user-space threads package work. JRS 20021001 */
+   if (fp_min + 512 >= fp_max) {
+      /* If the stack limits look bogus, don't poke around ... but
+         don't bomb out either. */
       ips[0] = ip;
       return 1;
    } 

That change gets rid of an essentially bogus check and replaces it with
something more reasonable.  Unfortunately I think the bogus check
caught the case where drd passes SP=0 (etc) and so had the unintended
side effect of avoiding the segfault.

Basically you can't call VG_(record_ExeContext) with a zero stack 
pointer as is happening now.  So don't do the call -- wait till you
have a valid SP and only then call it.  In any case there is no loss
since the previous arrangement would have gotten you only a 1-element
stack trace with the top/only IP value being zero.

J

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to