eburtsev / google-glog

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

fatal signal handler is not signal-safe #191

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Write a simple program that segfaults, and run it with ThreadSanitizer enabled, 
and you get a lot of warnings like the following:

==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 google::LogDestination::log_destination(int) /home/todd/git/XXX/thirdparty/glog-0.3.3/src/logging.cc:771 (libglog.so.0+0x00000000c170)
    #2 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:104 (libstdc++.so.6+0x0000000b9f38)
    #2 _S_construct_aux<char const*> /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1725 (libstdc++.so.6+0x0000000bba57)
    #3 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 google::LogDestination::log_destination(int) /home/todd/git/XXX/thirdparty/glog-0.3.3/src/logging.cc:771 (libglog.so.0+0x00000000c170)
    #2 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:104 (libstdc++.so.6+0x0000000b9f38)
    #2 _S_construct_aux<char const*> /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1725 (libstdc++.so.6+0x0000000bba57)
    #3 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 google::LogDestination::log_destination(int) /home/todd/git/XXX/thirdparty/glog-0.3.3/src/logging.cc:771 (libglog.so.0+0x00000000c170)
    #2 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:104 (libstdc++.so.6+0x0000000b9f38)
    #2 _S_construct_aux<char const*> /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1725 (libstdc++.so.6+0x0000000bba57)
    #3 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 google::LogDestination::log_destination(int) /home/todd/git/XXX/thirdparty/glog-0.3.3/src/logging.cc:771 (libglog.so.0+0x00000000c170)
    #2 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================
==================
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=18871)
    #0 operator new(unsigned long) ??:0 (exe+0x000000409bc6)
    #1 __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:104 (libstdc++.so.6+0x0000000b9f38)
    #2 _S_construct_aux<char const*> /build/buildd/gcc-4.8-4.8.1/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:1725 (libstdc++.so.6+0x0000000bba57)
    #3 main /home/todd/git/XXX/src/tserver/tablet_server_main.cc:138 (exe+0x00000044452e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal ??:0 operator 
new(unsigned long)
==================

This is glog 0.3.3.

This is likely to be the root cause of issue #183

Original issue reported on code.google.com by tlip...@gmail.com on 26 Mar 2014 at 7:17