liyh1984 / google-glog

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

Process sleeps forever in FailureSignalHandler it is interrupted by another signal. #227

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When FailureSignalHandler is interrupted by another signal, the second signal 
handler checks to see if it is running in the same thread as a previous 
handler. If so, it invokes InvokeDefaultSignalHandler(signal_number), and 
sleeps forever. Due to the sleep, the second signal handler never exits and the 
process is stuck in this state until it is killed with a SIGKILL.

What steps will reproduce the problem?
1. Run the process under gdb, and put a breakpoint in FailureSignalHandler.
2. Send a signal to the process (SIGTERM/SIGABRT).
3. After the above breakpoint is hit, send another signal. After resuming, you 
can see that the process sleeps forever.

What is the expected output? What do you see instead?
The process sleeps in that state forever.

What version of the product are you using? On what operating system?
glog-0.3.3. Saw the problem both on ubuntu and centos-7.

- 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 
x86_64 GNU/Linux

- 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Nov 6 15:06:03 UTC 2014 x86_64 x86_64 
x86_64 GNU/Linux

Please provide any additional information below.
Attaching a patch that should hopefully fix the problem.

Original issue reported on code.google.com by sa...@cohesity.com on 27 Dec 2014 at 10:36

Attachments: