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
freed pointer used in multithread mode #646
Comments
it is a bug that any data race can occur. even in multi=threaded mode one connection is still supposed to only be accessed from only one thread. i'll take a look. |
i'v found the key place: at line 3889: if in work thread,i set like this: and immediately the main thread found that the MG_F_SEND_AND_CLOSE is set,it will free the conn and the conn's proto_data. so,my resolve is add some code when create work thread: |
and also add these code: if (c[1]->prev) if (c[1]->next) |
Please, check with latest version |
freed pointer used in multithread mode.
on line 4977:
mg_call(nc, (pd->endpoint_handler ? pd->endpoint_handler : nc->handler),
MG_EV_HTTP_PART_END, &mp);
may be pd have been freed in somewhere when mg_call called.
The text was updated successfully, but these errors were encountered: