-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable stacktrace support in gitian builds #3006
Conversation
8316048
to
e75bc09
Compare
Latest commits changes how stacktrace support is compiled. From now on, basic stacktrace and crash info support is compiled in unconditionally on all platforms. The only thing that is conditionally now is the hooking into exception/assert handling. |
4390979
to
c131da3
Compare
Also added experimental support for MacOS, but as always, I'm unable to verify if it actually works. My hope here is that by manually loading the .debug file instead of the actual binary when initializing libbacktrace, we're able to get debug info to work. This worked fine for Windows builds, so lets hope it works here as well. @UdjinM6 maybe you find some time to test this again? I can also provide you with pre-built binaries from a Gitian run. As an alternative, you could do your own Gitian build ( When debug info has not been generated yet and dashd is run with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below + should add *.debug
into .gitignore
.
In general, stacktraces still don't work for me on mac - No debug information available for stacktrace
when providing -printcrashinfo=<smth>
(stackframeInfos
is empty even after GetStackFrameInfos
).
EDIT: this ^^^ is for a local build via make -C src osx_debug
btw.
EDIT2: doesn't matter actually, same results for the gitian build.
This causes check-symbols to fail horribly and also turned out to be not required when using libbacktrace. It was only required when using "backtrace()" from "<execinfo.h>"
…conditional This also renames the --enable-stacktraces option to --enable-crash-hooks
d0c898c
to
f89c24b
Compare
Rebased on develop, handled review comments, and also added printing of crash description in the case where no debug info is present. @UdjinM6 did you also try the case where the .debug files were already present when the crash happened? |
Yep. I also tried to specify the exact path to |
Hmm ok, looks like I have no other choice but to actually look into the dSYM bundle structure and make generating that thing part of the build process... |
After some discussion in Slack and some more testing done by @UdjinM6, we figured out that using a dSYM bundle works. I've added some commits so that the Also, turned out that we have to always include at least some debug information for this to work instead of making it dependent on |
aa10c2d
to
0259927
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! 👍
Works for me on mac in both cases now (w and w/out debug files).
ACK after f89c24b is removed.
Instead of making it dependent on "--enable-crash-hooks". We will need the debug info every time now, even in release builds.
Removed f89c24b |
dfc6c30
to
6672b39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, utACK
This reverts commit 780bffe.
This reverts commit 780bffe.
* Remove use of -rdynamic This causes check-symbols to fail horribly and also turned out to be not required when using libbacktrace. It was only required when using "backtrace()" from "<execinfo.h>" * Remove spurious ], from configure.ac * Add -DENABLE_STACKTRACES=1 to CMakeLists.txt * Remove unused method my_backtrace_simple_callback * Use fs::path().filename() instead of basename() * Add static g_exeFileName and g_exeFileBaseName * Use .exe.dbg file when available * Use uint64_t instead of uintptr_t * Implement GetBaseAddress() for unix and win32 * Implement unified crash_info and use it everywhere before printing crash info * Print a serialized version of crash_info when there is no debug info * Implement "-printcrashinfo" command line option * Compile stacktrace support unconditionally and only make crash hooks conditional This also renames the --enable-stacktraces option to --enable-crash-hooks * Enable crash hooks in win/linux Gitian builds * Try to load .debug file on MacOS and enable crash hooks for osx Gitian builds * Check for dsymutil and if it needs --flat * Create .debug files in osx Gitian build * Handle review comments * Also print crash description when no stacktrace is available * Unconditionally add -g1 debug information Instead of making it dependent on "--enable-crash-hooks". We will need the debug info every time now, even in release builds. * Put MacOS debug info into dSYM symbols instead of plain .debug files * Implement MacOS specific GetBaseAddress
This PR enables stacktrace support in the release builds done by Gitian.
It expects debug information to be present in
dashd.debug
(linux) anddashd.exe.dbg
(windows). These debug files are split/stripped as part of the Gitian build already. If debug information is not present, a serialized crash info is printed which can then be used later to extract the stacktrace. This allows easier debugging and support when users report unexpected crashes. They can now provide us with the serialized crash info and we are able to extract the stacktraces even when the user did not run with debug info. We might consider releasing debug files as well in the future.With the debug file present, it looks like:
Without the debug file present, it looks like:
This can then be used to extract the stacktrace with the same executable but with the debug file present:
As you can see, this was invoked with
wine
. Serialized stacktraces can be taken from native Windows and then be extracted with wine, and vice versa.