help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] JIT crashes due non-executable memory


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] JIT crashes due non-executable memory
Date: Sun, 9 Jun 2013 08:25:34 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jun 08, 2013 at 10:02:16PM +0200, Holger Hans Peter Freyther wrote:

> Hi,

Dear Paolo

> So I think that the oop will be swept when it should not? Any idea on
> how to continue to debug this? Tracing all flag assignments with hw
> watchpoints is a bit... difficult.

I added various asserts and the below is hit the first. An OOP is swept
while it is still marked as F_XLAT_REACHABLE. Now this appears to be
complicated. The native code can only set the F_XLAT_REACHABLE but it is
never cleared (two processes can enter the same method so there is no
point in setting it back).

How did you intend the garbage collection to work here?

a.) Never delete native code?
b.) Start to walk the context list(s)? As part of the native code?
c.) Allow it to be collected and re-generate 
d.) Mark the OOP when it is put into the context?

But then again, why is the CompiledMethod GCed? It should be reachable
from the Method Dictionary of the method?



diff --git a/libgst/oop.c b/libgst/oop.c
index 6b79935..2cb3cd7 100644
--- a/libgst/oop.c
+++ b/libgst/oop.c
@@ -1435,11 +1435,14 @@ _gst_sweep_oop (OOP oop)
 
 #ifdef ENABLE_JIT_TRANSLATION
   if (oop->flags & F_XLAT)
+    {
     /* Unreachable, always free the native code.  It is *not* optional
        to free the code in this case -- and I'm not talking about memory
        leaks: a different method could use the same OOP as this one and
        the old method would be executed instead of the new one! */
-    _gst_release_native_code (oop);
+      assert ((oop->flags & F_XLAT_REACHABLE) == 0);
+      _gst_release_native_code (oop);
+    }
 #endif




reply via email to

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