-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Segmentation violation on testing with attempted backtrace using debug symbols #46439
Comments
Stack trace of the first test from gdb:
gdb also reported a second crash when I continued execution, which I guess was the crash in the stack trace code, but the crash stack trace was identical to the first one, so I don't know what caused the crash exactly. It might be because I didn't build with debug symbols though. EDIT: well crap, with debug symbols gdb says The second one in your OP actually printed a backtrace with mangled symbol names, but the addr2line calls to extract unmangled symbol names failed. I don't know much about addr2line though, @jbytheway might know more. |
@Qrox - so you're using g++? What OS? (I suspect Catch has an internal RNG for reordering, to make that OS-independent, but it might not.) |
I'm using MinGW-w64 on Windows 10. |
Randomize ordering of tests to check for problems such as seen in CleverRaven#46439.
Let's see what happens with using the PR test infrastructure. From the above two crashes, I am suspecting something with the map code, BTW. |
Huh. Travis did manage to get debug symbols - at least for part of it (quite a bit is still blank), and also had a segmentation error (plus quite a few other test failures!):
It did get a core dump; will have to check if there's some way to access it. (Even if not, the github ones should give us something.) |
Yes, the github one did. I've appealed for someone with a Linux box to take a look - #46476. |
I've narrowed down which tests are needed to run to get the crash. See #46441 for info. |
@anothersimulacrum suggested a small patch that converts it from a segmentation fault to a failure; will put in as PR to close this issue. |
Using a patch suggested by @anothersimulacrum, prevents a segmentation error (instead giving a much more useful failed test).
I am not sure why this isn't being linked as closed by said PR... sigh. |
Finicky, isn't it? |
FYI, the extraction of debug symbols doesn't work on OS X, which is why the backtrace was failing. The ideal solution for this is probably for someone to extend the |
@jbytheway: It was also failing to extract on MinGW-w64 on Windows 10, BTW. @Qrox, I'm thinking your build would have used |
I didn't say that... The test didn't report a backtrace on Windows when crashed, but Catch2 didn't report the crash either, so I think the signal handling code might have caused a second crash before the backtrace was printed. Other backtraces were correctly printed with mangled symbol names, but I didn't build with debug symbols so they didn't report the unmangled names. When I implemented backtrace on Windows it was able to report the unmangled names so I don't think it would be any different this time. On a side note, now I look at the first log in your OP I think the code actually caught the signal and didn't caused a second crash on your end (Catch2 caught the signal, our custom signal handling code tried to print a backtrace, and Catch2 continued to report the same signal). It's just that the stack walking failed and the backtrace was not printed, probably due to corrupted stack? |
OK.
From what @jbytheway was saying, I'm not sure whether the stack was corrupted or the backtracing simply didn't work (and did so in such a way that the stack appeared to be corrupted). What would be involved in implementing libbacktrace use on OS X, other than making sure a copy of libbacktrace was around and having the Makefile use it as it does on Windows? |
libbacktrace is not distributed as a library with GCC so we might need to build it ourselves for OS X. Also the window backtrace code currently uses a combination of |
When running all tests in randomized order (
--order rand
), with two different random seeds, vehicle_level_test gives an error (on beetle edge drop), this becomes a fatal error, and Catch has a segmentation violation on trying to repeat the stack trace with debug symbols.Example:
An earlier test (from seed 1609442887) also had problems with the backtrace:
Steps To Reproduce
Run (using a non-release CDDA compiled with DEBUG_SYMBOLS=1):
tests/cata_test --min-duration 0.2 --rng-seed 1609446657 --order rand
tests/cata_test --min-duration 0.2 --rng-seed 1609442887 --order rand
Expected behavior
(Not failing the test would be good; I am not sure how to handle this one, since it already does
clear_map()
and attempts to get the player out of the way... I have opened a separate issue, #46441, for this.) When a test is failed, a more-usable stack trace would be nice; barring that, not having a segmentation violation would be helpful.Versions and configuration
TilesTerminalAdditional context
test_user_dir.zip
I have had major problems in the past trying to get a core file out of crashes (of other programs), and this one was no exception.
Ping: @jbytheway, @Qrox, @wapcaplet (as people involved with testing overall)
The text was updated successfully, but these errors were encountered: