Skip to content
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

Race condition #61

Open
arauhala opened this issue Jun 29, 2018 · 0 comments
Open

Race condition #61

arauhala opened this issue Jun 29, 2018 · 0 comments

Comments

@arauhala
Copy link

arauhala commented Jun 29, 2018

There is a race condition in the mmap allocator memory management. Following sequence can happen:

  1. Memory in address X is allocated. X is put into allocatedMemoryReferences
  2. Memory in address X is released with 'close' request. X is removed from allocatedMemoryReferences
  3. MemoryReference for address X has been garbage collected, and it is put into the 'queue'.
  4. Memory in address X is reallocated. X is is put into allocatedMemoryReferences
  5. Memory in address X is popped from 'queue', and because X is in allocatedMemoryReferences, it gets released second time.
  6. Memory in address X is assumed to be allocated, and so it is used, which causes a segfault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant