-
Notifications
You must be signed in to change notification settings - Fork 30
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
Some Memory in Runtime Not Recognized by Garbage Collector #56
Comments
In fact, the segfault has nothing to do with multithreading. It can be reproduced with a single-threaded program ( There is a warning in the bdwgc documentation as follows
In our compiler, we sometimes stored the gc allocated memory pointer inside data structures allocated by the standard malloc. Therefore, when the gc started to collect memory, it would mistakenly collect the memory region referenced by these pointers. It explained why it only appeared after thousands of iterations. The memory was used a lot after thousands of iterations so the gc started to work. In addition, I tried to manually invoke However, this type of problem cannot be easily solved by replacing
In conclusion, this issue is not related to the newly added multithreading support, and I believe it requires some non-trivial work to fix this problem. |
Thanks for the digging Yiteng, I've update the issue title to reflect the actual problem. |
It sounds like the problem is pointers from data structures that the compiler statically allocates? I would think that a ctor section could be generated to report such data structures to the GC via the call you describe |
Yes, I believe this is a reasonable way to resolve this problem. |
While both concurrency and reflection are individually supported, calling any of the reflection methods in a multithreaded program can cause segfaults. This is a high priority issue and was introduced when multithreading support was introduced with: #52
The text was updated successfully, but these errors were encountered: