Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ORC] Crash when GC attempts to collect element #4

Open
shayanhabibi opened this issue Sep 18, 2021 · 4 comments
Open

[ORC] Crash when GC attempts to collect element #4

shayanhabibi opened this issue Sep 18, 2021 · 4 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@shayanhabibi
Copy link
Contributor

Orc crashes when a Continuation (or any ref object) passed through the queue reaches the end of its life span and the final =destroy is run.

This is evident by incrementing the ref count of an object by 1 before the end of its lifespan and comparing the behaviour before and after.

ARC does not share this issue; the final =destroy can be called without issue and the memory is collected appropriately.

@shayanhabibi
Copy link
Contributor Author

AFAIK this is a ORC bug

@shayanhabibi shayanhabibi added bug Something isn't working wontfix This will not be worked on labels Sep 18, 2021
@PhilippMDoerner
Copy link

What would need to be done to make a ref reach the end of its lifetime? Like what would a small example look like?

@disruptek
Copy link
Contributor

block:
  var x = new (ref int)
  x[] = 3
# x reached the end of its lifetime

@disruptek
Copy link
Contributor

To restate the problem, the issue is that Nim's ORC tracking of each memory graph is thread-local, so moves across threads leave such references in a bogus state should they be collected in a "foreign" thread...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants