dimahardie / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

Deadlock in ExceptionHandler for Mac #449

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install a handler by creating an instance of ExceptionHandler 
2. Call WriteMinidump twice (without shutting down of the process)

What is the expected output? What do you see instead?
The second call of ExceptionHandler::WriteMinidump() leads to a deadlock 
instead of a new dump. The execution halts in 
ExceptionHandler::WriteMinidump(bool) in front of a locked mutex 
(minidump_write_mutex_).

Please use labels and text to provide additional information.
I got your point of calling pthread_mutex_lock() twice in order to wait until 
the mutex is released by the writer thread, but the mutex will be immediately 
relocked if the blocked thread continues - and this is is probably not your 
intention. I solved the deadlock simply by calling pthread_mutex_unlock() right 
after, use of pthread_cond_wait probably would be something more elegant. Not 
sure if this breaks something.

General question: do you give the interface defined in Breakpad.h the 
preference? Or is crash handling with ExceptionHandler also feasible?

Thanks for all your efforts,
Norman

Original issue reported on code.google.com by norman.juchler@dacuda.com on 27 Sep 2011 at 12:17

GoogleCodeExporter commented 9 years ago
Possible duplicate of issue #421.

Original comment by mike.dld on 27 Sep 2011 at 1:45

GoogleCodeExporter commented 9 years ago
True, haven't seen it.

Original comment by norman.juchler@dacuda.com on 27 Sep 2011 at 3:03