-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage collection appears to cause a memory error #49
Comments
Got a memory fault with SBCL
The crash does not occur using SBCL 2.2.4. We were seeing crashes internally when trying to use SBCL 2.3.0 with sbcl-librarian, so we bisected and found sbcl/sbcl@53d80ca as the potentially breaking change for us. You may be encountering the same issue. |
Crashed with an the same error on the commit before sbcl/sbcl@53d80ca |
On SBCL master with this patch to the minimal example: diff --git a/src/build-image.lisp b/src/build-image.lisp
index 8b8f8cf..d702ea7 100644
--- a/src/build-image.lisp
+++ b/src/build-image.lisp
@@ -9,5 +9,7 @@
parsejson-api
sbcl-librarian:handles)
+(push (lambda () (sb-thread:release-foreground)) sb-ext:*init-hooks*)
+
(sbcl-librarian:build-bindings parsejson "." :initialize-lisp-args `("--dynamic-space-size" ,(format nil "~a" (expt 2 13))))
(sbcl-librarian:build-core-and-die parsejson ".") I get this:
or a hang |
|
The thing to do here is to minimize the reproducer as much as possible and submit a bug upstream with a carefully bisected commit attached. |
Update: I tried building this against SBCL 2.4.4 and the error doesn't seem to appear anymore |
When SBCL's garbage collector is invoked, it seems to mess with memory in such a way that my shared library fails (with some fairly obscure errors).
I've created a repo on github with a minimal example project which reproduces the error (on Linux, haven't tried other OSs). The error, in this example, happens when parsing a ~100KB JSON file after a call to
(sb-ext:gc)
, although the same class of error will occur if the GC is triggered indirectly. Smaller files can trigger the error if the dynamic space size is reduced.The project has a dependency on
quilc
. I assume the error can be reproduced without quilc, but, in my limited testing, including quilc as a dependency causes the error 100% of the time.I don't know enough about SBCL and it's garbage collector to be sure, but it seems as though GC is affecting the pointer that is received by my
parse
function such that it points to invalid memory.This is the error I am seeing currently, though it has been different in the past
The text was updated successfully, but these errors were encountered: