ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

mongoose 2.8 dumps core #173

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have experienced a core dump with mongoose 2.8 under Scientific Linux 5.1
which is essentially RHEL5. I looked at the core dump and I believe I 
understand the problem but do not know what the right way to fix it is. The 
core dump happens at line 4530 in the worker_thread when trying to lock the 
mutex. Inspecting the core dump reveals that conn is 0, as set with the 
memset on line 4508. Appararently the reading loop below 4508 fails for 
an unknown reason. Then the code below  the loop becomes wrong, as the ctx is 
0. My idea to fix this would be to have a local mg_context and assign it to the 
one in the conn when available and to the one passed as a parameter else.  But 
I am am unsure if this is a good solution; there must be a reason why the code 
makes a local copy of the mg_context when reading. 

Going to 2.10 is not an option due to the API change. In fact, the existence of 
a ready made dispatcher was a reason why I decided for mongoose in the first 
place.  

Original issue reported on code.google.com by mkoenne...@gmail.com on 14 Sep 2010 at 9:00

GoogleCodeExporter commented 9 years ago
Integrate changes made to worker_thread() function from 
http://mongoose.googlecode.com/svn/trunk/mongoose.c

This should fix crash issue.

Original comment by valenok on 14 Sep 2010 at 7:31