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

Threading: Race condition and crash on QttpResponse::close #31

Open
ctenter-scs opened this issue Apr 17, 2018 · 0 comments
Open

Threading: Race condition and crash on QttpResponse::close #31

ctenter-scs opened this issue Apr 17, 2018 · 0 comments

Comments

@ctenter-scs
Copy link

Sometimes the server can run into a race condition while processing events, which leads to a memory access violation and causes the program to crash.

The main thread receives events from qt and calls the default event handler.
This eventually leads to a call to uv_write() on QttpResponse::close().

The second thread is started in HttpServer::startServer and runs a libuv event loop.

The issue seems to come from the uv_write() call in the main thread. According to the libuv devs, this call is not safe and should be moved to the event thread using uv_async_send:
https://groups.google.com/forum/#!topic/libuv/iHzv3x-VOr4

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