-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
The FailureSignalHandler may cause hang when the program is aborted #235
Comments
OS information: gcc version: Glibc: |
Do you know which implementation of It would be helpful to know which one has this problem. Did you build glog yourself or use it from a package? |
@andschwa I thinks it should be compiled with src/stacktrace_generic-inl.h. I have the backtrace as follows:
|
As written in https://github.com/google/glog/blob/master/INSTALL#L15, libunwind would be definitely the best solution. If I remember correctly and nothing has changed, glibc's backtrace() calls malloc() only when it's called first time. If this is correct, calling DumpStackTraceToString or backtrace in execinfo.h at the beginning of your program could mitigate the issue. If this works, it'd be probably a good idea to do this in InstallFailureSignalHandler. |
We use 'google::InstallFailureSignalHandler();' in our c++ project. But sometimes, the FailureSignalHandler may hang because of the malloc in the GetBacktrace() function.
The signal handler interrupted an in-progress malloc function call which had already held the lock. In this scenario, it will cause a deadlock.
Any ways that I can work around?
The glog version we are using is 0.3.3.
The text was updated successfully, but these errors were encountered: