Windows: not getting stack trace of correct thread

61 views
Skip to first unread message

Matthias Buehlmann

unread,
Dec 28, 2021, 7:29:25 AM12/28/21
to google-glog
I'm using glog 0.5.0 (https://github.com/google/glog/archive/refs/tags/v0.5.0.zip) on a Windows project.

first thing I do in main is

  google::InitGoogleLogging(argv[0]);
  google::InstallFailureSignalHandler();

Now, sometimes when the app crashes I'm getting a correct stack trace output, but most of the time I'm getting the stack trace of a thread that did not cause the crash. It then always looks like this:

*** Aborted at 1640614842 (unix time) try "date -d @1640614842" if you are using GNU date ***
    @     0x7ffdf2500ef5 _seh_filter_exe
    @     0x7ff77ea06752 bool __cdecl google::Demangle(char const * __ptr64,char * __ptr64,int)
    @     0x7ffdd35decd0 __C_specific_handler
    @     0x7ffdf4df207f __chkstk
    @     0x7ffdf4da1454 RtlRaiseException
    @     0x7ffdf4df0bae KiUserExceptionDispatcher
    @     0x7ff77e761e02 bool __cdecl google::Demangle(char const * __ptr64,char * __ptr64,int)
    @     0x7ff77e6e1210 bool __cdecl google::Demangle(char const * __ptr64,char * __ptr64,int)
    @     0x7ff77e2433c1 public: void __cdecl google::LogMessage::LogStream::set_ctr(unsigned __int64) __ptr64
    @     0x7ff77e2433c1 public: void __cdecl google::LogMessage::LogStream::set_ctr(unsigned __int64) __ptr64
    @     0x7ff77e222fb9 public: void __cdecl google::LogMessage::LogStream::set_ctr(unsigned __int64) __ptr64
    @     0x7ff77e87dd80 bool __cdecl google::Demangle(char const * __ptr64,char * __ptr64,int)
    @     0x7ffdf33e7034 BaseThreadInitThunk
    @     0x7ffdf4da2651 RtlUserThreadStart
Can this be fixed? is this realted to this https://github.com/google/glog/issues/535 ?

Matthias Buehlmann

unread,
Dec 29, 2021, 6:50:32 AM12/29/21
to google-glog
I noticed something.

If I add the following to my build.rc
build --copt /Z7
build --linkopt=/DEBUG
build --strip=never

build --linkopt=/DEBUG generates a PDB file alongside the exe.
If I run it now, I get a correct stacktrace (it looks like in the previous one it just gets symbolized incorrectly). However, If I send the exe to another computer and run it there, even with the PDB file in the same folder, I again get the erronous stack trace upon crash.

Matthias Buehlmann

unread,
Dec 29, 2021, 8:06:18 AM12/29/21
to google-glog
Another weird thing is: I'm also using google::ion which has it's own stack trace when a CHECK macro fails: https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/base/logging.cc#L65
in those ion stack traces I'm also getting the glog symbols however, despite ion not depending on glog:

CHECK failed: expression='"false"' 
FATAL Dumping stack:
#00 pc 00007ff60d62970b  (google::Demangle+1268283)
#01 pc 00007ff60d558d80  (google::Demangle+413872)
#02 pc 00007ff60d55de21  (google::Demangle+434513)
#03 pc 00007ff60d0ba905  (google::LogMessage::LogStream::set_ctr+298565)
#04 pc 00007ff60d0a9759  (google::LogMessage::LogStream::set_ctr+228505)
#05 pc 00007ff60d097d01  (google::LogMessage::LogStream::set_ctr+156225)
#06 pc 00007ff60d073469  (google::LogMessage::LogStream::set_ctr+6569)
#07 pc 00007ff60d6f446c  (google::Demangle+2099100)
#08 pc 00007ffe2e4d7034  (BaseThreadInitThunk+20)
#09 pc 00007ffe2fa62651  (RtlUserThreadStart+33)



Reply all
Reply to author
Forward
0 new messages