-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
std.debug: fix some corner cases #23927
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
base: master
Are you sure you want to change the base?
Conversation
b95af2b
to
37ebc96
Compare
This is ready for a review. I think the actual fixes are all straightforward, but the test is generating a lot of stderr spew (both from the dump-stack-trace functions being tested and my verbose |
You can capture the output from the build script, e.g. by adding an "expected output" check. See for example #23892. |
@alexrp Thanks again for the reviews! One more question before I push a new version up: Should I make changes anywhere to get this test to compile/run against targets other than the default on CI? |
I guess you could just change the test's |
37ebc96
to
74336df
Compare
Excellent! Done.
I'm going to postpone this for now. I don't want to disable the native testing, and don't really want to test a bunch of non-standard targets redundantly. I'll play around with this for future changes. Two unrequested changes: (1) I got suspicious that the Darwin-aarch64 alignment hack-around in the test's signal handler was influencing other platforms, so I re-worked the code to more clearly do the hackery only when necessary. |
What's (2)? 👀 Also I'm not entirely sure which change you're referring to. |
74336df
to
3447789
Compare
Oh lol ... I was planning on changing the verification steps in the test a bit, but undid that at the last moment. Didn't quite fix up the message here well enough. So the only thing in this latest push that needs a quick review is the aarch64-darwin ctx-fixup code in the test's signal handler. (Though wait until the tests pass, of course ...) |
105abc5
to
679ac12
Compare
This test creates three nested stack frames and then tests stack trace creation. Add some additional tests of stack traces by invoking "dumpCurrentStackTrace()" and by using a signal handler's "context" parameter to feed backtrace construction. Make the test case at least runnable on a wide variety of systems (including Windows, and WASI). Because `ucontext_t` and `getcontext` are not evenly supported everywhere, some systems are expected only get through parts of the test.
679ac12
to
e965f5d
Compare
Add infinite loop detection to the
std.debug
backtraces. Make the backtrace and stacktrace code more robust on corner-case architectures.Expand the "unwind.zig" test case to exercise
std.debug.dumpCurrentStackTrace()
. And trigger a signal handler so the test can exercisestd.debug.dumpStackTraceFromBase()
andstd.debug.StackIterator.initWithContext()
using a kernel-constructed context.This is preparation for moving
std.debug
away fromgetContext()
(#23801).