-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Intermittent Segfaults #391
Comments
It only appears that this happens if an assertion fails. I can reliably produce at least 1 segfault if I run my tests 1000 times with a failing assertion, but if all my assertions pass, I don't get any segfaults. |
well... the test suite of doctest contains at least a couple dozen failing asserts and has been running on CI for a couple of years now and I've never encountered a sporadic failure like what you are describing. It could be that parts of your code corrupt some memory (could be the stack for example) and that's why it could show up as being in doctest. Also the code around If you can provide a small minimal example where this is reproduced and uses only doctest I'll take a look. |
Hey Viktor, Thanks for the reply! I compiled a binary with only doctest and a failing assertion and couldn't reproduce the issue, so it looks like the problem is with my own code. Will give the address sanitizer a try and see what that uncovers. |
Description
I have kind of a weird situation where I have to run my unit tests a large number of times, and because of this, I uncovered an issue where maybe 5-10 times out of 1000, doctest will segfault.
After compiling my tests, I ran something like this in bash:
for i in {1..1000}; do echo "Test #$i" 2>&1 >> output; echo >> output; ./test_core 2>&1 >> output; echo >> output; done
I saved a core dump from one of the crashes, loaded it into gdb, and though I can't see any function names in the backtrace, when I list the code around where the error occurs, I get this:
Steps to reproduce
Extra information
Looking at my git log to see when I checked out your code so you know what I was testing, I see this:
commit d5aa2bf (HEAD -> master, tag: 2.3.8)
Compiler: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Operating System: Ubuntu 18.04
Doctest version: 2.3.8
The text was updated successfully, but these errors were encountered: