-
Notifications
You must be signed in to change notification settings - Fork 129
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
GC issues on nimbus-verified-proxy #1501
Comments
The GO run-time is scheduling the goroutines on multiple threads by default. This doesn't play well with the default Nim garbage collector which access the memory heap metadata through a thread-local variable (and generally assumes that memory allocated by a particular thread will only be access by the same thread in the future). To work around this mismatch in expectations, I would recommend running all Nim code on a separate dedicated thread (most easily created though the functions in the Nim standard library which know how to initialize new threads with the required GC TLS metadata). You would communicate between the GO code and the Nim code through standard IPC mechanisms, such as unix domain sockets/named pipes. |
https://github.com/status-im/status-desktop/pull/9805/files#diff-0e9f723c1b6c935c40d3bbc96b65ab7632f91e6ae563bd4f5fe2103befe64094R189 implements such a trivial cross-thread mechanism for posting things onto a thread that normally runs the chronos event loop - it can of course be replaced with something more efficient in the future (which depends on some targeted updates to chronos)( but this doesn't, for practical purposes, matter in this case. |
Thanks for advice! Can you please provide a bit more detail on how this can be achieved? I tried 2 things:
|
Will try to provide more details about issues encountered with
|
Fixed by using context pointers. Superseded by #1882 |
In scope of nimbus-verified-proxy integration with status-go (status-im/status-go#3282), it turned out that various GC options that Nim provides do not work properly when invoked from Golang wrapper (https://github.com/siphiuel/lc-proxy-wrapper).
Below are the following options i've tried and respective results:
--gc:markAndSweep
: FAIL, runtime exception "URL hostname is missing"--gc:refc
: FAIL, runtime SIGSEGV--gc:boehm
: OK, this is what being used now--gc:go
: FAIL, compilation error:Error: system module needs: unsureAsgnRef
--gc:arc/orc
: FAIL, compilation error identical to the one described in Migration to v2 nim-lang/Nim#20017Is it ok to use
--gc:boehm
for the time being, are there any known issues? So far i haven't encountered any during testing.The text was updated successfully, but these errors were encountered: