Skip to content
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

InstallFailureSignalHandler can not get the detailed stack errors #777

Closed
kintzhao opened this issue Jan 4, 2022 · 7 comments
Closed

InstallFailureSignalHandler can not get the detailed stack errors #777

kintzhao opened this issue Jan 4, 2022 · 7 comments

Comments

@kintzhao
Copy link

kintzhao commented Jan 4, 2022

this is my test code: test.cpp, glog is v0.5.0

#include <glog/logging.h>
 
void bar(int x) {
  CHECK_EQ(x, 1);
}
 
void foo(int x) {
  bar(x + 1);
}

int main(int argc, char** argv) {
  google::InstallFailureSignalHandler();
  foo(1);
}

build :

g++ -g -O3 test.cpp -lglog -o test

My result Output, But it has not the detailed stack error!

kint@kint:/tmp/test$ ./test 
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0104 17:09:37.170971 11615 test.cpp:4] Check failed: x == 1 (2 vs. 1) 
*** Check failure stack trace: ***
*** Aborted at 1641287377 (unix time) try "date -d @1641287377" if you are using GNU date ***
PC: @     0x7fa7af57dfb7 gsignal
*** SIGABRT (@0x3e800002d5f) received by PID 11615 (TID 0x7fa7b02c8740) from PID 11615; stack trace: ***
    @     0x7fa7af57e040 (unknown)
    @     0x7fa7af57dfb7 gsignal
    @     0x7fa7af57f921 abort
    @     0x7fa7afedb1f9 (unknown)
    @     0x7fa7afedd0cd google::LogMessage::Fail()
    @     0x7fa7afedef33 google::LogMessage::SendToLog()
    @     0x7fa7afedcc28 google::LogMessage::Flush()
    @     0x7fa7afedf999 google::LogMessageFatal::~LogMessageFatal()
    @     0x560754badd4c (unknown)
    @     0x560754badba3 (unknown)
    @     0x7fa7af560bf7 __libc_start_main
    @     0x560754badbda (unknown)
Aborted (core dumped)

Test by the reference Google glog prints no stack trace

@kintzhao
Copy link
Author

kintzhao commented Jan 4, 2022

ubuntu 18.04

kint@kint:~/SoftInstall/3rd/glog$ g++ -v 
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 

@TommyWu-fdgkhdkgh
Copy link
Contributor

Hi @kintzhao

I use the same test code, and the same environment, but I still can get the full stack trace, and cannot reproduce the issue.

$ g++ -g -O3 test.cpp -lglog -o test
$ ./test
WARNING: Logging before InitGoogleLogging() is written to STDERR
F20220104 23:52:52.990535  6777 test.cpp:4] Check failed: x == 1 (2 vs. 1)
*** Check failure stack trace: ***
*** Aborted at 1641311572 (unix time) try "date -d @1641311572" if you are using GNU date ***
PC: @                0x0 (unknown)
*** SIGABRT (@0x3e800001a79) received by PID 6777 (TID 0x7fabf79b1e80) from PID 6777; stack trace: ***
    @     0x7fabf6b9c040 (unknown)
    @     0x7fabf6b9bfb7 gsignal
    @     0x7fabf6b9d921 abort
    @     0x7fabf7582399 google::logging_fail()
    @     0x7fabf7584afd google::LogMessage::Fail()
    @     0x7fabf75871c2 google::LogMessage::SendToLog()
    @     0x7fabf758450a google::LogMessage::Flush()
    @     0x7fabf7588279 google::LogMessageFatal::~LogMessageFatal()
    @     0x562dbcc59ccc bar()
    @     0x562dbcc59b23 main
    @     0x7fabf6b7ebf7 __libc_start_main
    @     0x562dbcc59b5a _start
$ uname -a
Linux tommy-X450VP 5.8.0 #1 SMP Sun Aug 29 20:50:24 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

@sergiud
Copy link
Collaborator

sergiud commented Jan 4, 2022

@fdgkhdkgh Thanks for looking into the issue.

@kintzhao You seem to be confusing a detailed stack trace with symbol resolution. There's clearly a detailed stack trace present. What is missing are symbol names. Given your problem is not reproducible, you need to find out why symbols are not resolved in your particular case.

@kintzhao
Copy link
Author

kintzhao commented Jan 5, 2022

$ uname -a
Linux kint 5.4.0-91-generic #102~18.04.1-Ubuntu SMP Thu Nov 11 14:46:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu118.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1
18.04)

@kintzhao
Copy link
Author

kintzhao commented Jan 5, 2022

kint@kint:/tmp/test$ file test
test: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=03eb02089288b6c25d198177f36c22def7b213d8, with debug_info, not stripped

@kintzhao
Copy link
Author

kintzhao commented Jan 5, 2022

kint@kint:/tmp/test$ g++ -ggdb test.cpp -lglog -o test
kint@kint:/tmp/test$ ldd test
linux-vdso.so.1 (0x00007fff68f36000)
libglog.so.0 => /usr/lib/x86_64-linux-gnu/libglog.so.0 (0x00007f6ed7c48000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6ed78bf000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6ed76a7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ed72b6000)
libgflags.so.2.2 => /usr/lib/x86_64-linux-gnu/libgflags.so.2.2 (0x00007f6ed7091000)
libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f6ed6e76000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6ed6c57000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6ed68b9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6ed807c000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6ed6693000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6ed648f000)

@sergiud
Copy link
Collaborator

sergiud commented Feb 28, 2022

Let me close the issue since your problem cannot be reproduced and we're already preparing the 0.6 release.

You can test glog 0.6.0-rc1 and report back in case you still observe the issue and provide a full reproducer, i.e. a CMakeLists.txt and a minimum working example as you initially did.

@sergiud sergiud closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants