thamagates / mongoose

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

worker_thread accesses a NULL pointer and crashes #156

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Embed mongoose in an application
2. Stale execution of your page-generating callback - for example, hit a 
breakpoint in the debugger and suspend the program for some time

What is the expected output? What do you see instead?
Mongoose derefences a NULL pointer and crashes.

What version of the product are you using? On what operating system?
Mongoose 2.8 built with Visual Studio 2008 SP1 running on Windows 7 x86

Please provide any additional information below.

As far as I can follow the bug, in get_socket(), pthread_cond_timedwait() 
fails, which causes get_socket to return FALSE, and after that worker_thread 
uses 

pthread_mutex_lock(&conn.ctx->thr_mutex);

but conn is filled with zeros.

I don't know internals of mongoose well yet, so I am not sure what is the root 
cause. If you need more details, please tell me what should I look for.

Original issue reported on code.google.com by umbra.te...@gmail.com on 25 Jun 2010 at 11:24

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 25 Jun 2010 at 11:49