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

Fix crash due to improper memory context handling in some cases #28

Merged
merged 2 commits into from
Dec 27, 2016

Conversation

amitlan
Copy link
Contributor

@amitlan amitlan commented Dec 19, 2016

AsyncSource mechanism which uses a separate thread to read data can
sometimes try to manipulate an address that may be invalid because of
memory context reset or delete by the main thread.

Fix that by implementing a dedicated memory context for AsyncSource,
which is only manipulated in the reading thread.

Fixes #27.

AsyncSource mechanism which uses a separate thread to read data can
sometimes try to manipulate an address that may be invalid because of
memory context reset or delete by the main thread.

Fix that by implementing a dedicated memory context for AsyncSource,
which is only manipulated in the reading thread.

Fixes #27.
@amitlan
Copy link
Contributor Author

amitlan commented Dec 20, 2016

The commit message says: ... memory context reset or delete by the main thread, but that's not entirely accurate. I now understand that bug is not really caused by failure of communication between different threads, but within the same thread by different modules.

Anyway, separation of memory context helps solve the problem, but I am open to any criticism of that.

Commit 5a1bc58 introduced a new context for AsyncSource's needs,
but failed to allocate the memory for buffer during initializion in
that context.  Fix that.

Also, add some comments.
@amitlan amitlan merged commit 6f6b540 into master Dec 27, 2016
@amitlan amitlan deleted the fix-multi-process-load-crash branch December 27, 2016 01:31
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

Successfully merging this pull request may close these issues.

None yet

1 participant