[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [PATCH] jit: Fix test failures with Magritte, SUnit and

From: Holger Hans Peter Freyther
Subject: [Help-smalltalk] [PATCH] jit: Fix test failures with Magritte, SUnit and other routines
Date: Mon, 10 Jun 2013 09:01:47 +0200

From: Holger Hans Peter Freyther <address@hidden>

The tests crash when returning to a previous context. In the case of the
Magritte test it is crashing on return to Delay class>>#runDelayProcess.

This appears to occur when resuming an existing image. It is because
the F_XLAT and F_XLAT_REACHABLE flags are cleared on saving of the image.
On image resume the refresh_native_ips method will re-generate the
native code and set the F_XLAT flag for active contexts. As the native
code is not executed the F_XLAT_REACHABLE will not be set. This makes it
possible for maybe_release_xlat to release the native code without
updating the context. This will eventually cause a segmentation fault
as the native code is gone.

The solution appears to be easy. Once the native_ip is updated the
F_XLAT_REACHABLE is set. This way it is guaranteed that the native code
will not be collected.

2013-06-10  Holger Hans Peter Freyther  <address@hidden>

        * interp-jit.inl: Set the F_XLAT_REACHABLE flag in refresh_native_ips.
 libgst/interp-jit.inl |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libgst/interp-jit.inl b/libgst/interp-jit.inl
index 0e8fa27..78fa94c 100644
--- a/libgst/interp-jit.inl
+++ b/libgst/interp-jit.inl
@@ -353,6 +353,10 @@ refresh_native_ips (OOP contextOOP)
          virtualIP = TO_INT (context->ipOffset);
          native_ip =
            _gst_map_virtual_ip (context->method, receiverClass, virtualIP);
+         /* The above might have freshly translated the method for us
+            and the F_XLAT_REACHABLE is not set yet. Set the flag right
+            to assure we can safely return to this method. */
+         context->method->flags |= F_XLAT_REACHABLE;
 #ifndef OPTIMIZE
          if (!native_ip)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]