-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
@trap fixups
#14799
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
@trap fixups
#14799
Changes from all commits
34a23db
fb04ff4
48e7296
c839c18
cdb9cc8
8558983
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8261,6 +8261,7 @@ pub const FuncGen = struct { | |
| _ = inst; | ||
| const llvm_fn = self.getIntrinsic("llvm.trap", &.{}); | ||
| _ = self.builder.buildCall(llvm_fn.globalGetValueType(), llvm_fn, undefined, 0, .Cold, .Auto, ""); | ||
| _ = self.builder.buildUnreachable(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry about that! That's why I was seeing BTW, the CI just failed and it's the exact same CI failure that I've been getting on my two PRs where I previously updated
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened #14802 to hopefully prevent this from happening again. I haven't diagnosed the failure yet but I suspect it is likely caused by some of the recent changes to the C backend, or perhaps due to a limitation of our C WASI shims. I'm sorry that happened to you and others, that must have been very confusing. |
||
| return null; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
I've previously explained my reasoning for SIGILL but now I think SIGILL is not much better or as good as SIGTRAP, anyway.
After some more research, now I would like to give out my recommendation to maybe use SIGSTOP or SIGKILL here as they are AFAIK the only signals that cannot be caught which I believe would be more appropriate here? I was going to demonstrate how they cannot be caught but these two asserts are perhaps demonstrative enough:
zig/lib/std/os/linux.zig
Lines 1160 to 1161 in e7f128c
Raising signals that cannot be caught might be more appropriate as
trap/@trapis not a debugging tool but rather something that should in fact terminate the program for sure, as far as I understand it.The difference between SIGSTOP and SIGKILL seems to be that SIGSTOP actually stops the program for later resumption which seems inappropriate so perhaps SIGKILL is best and safest of all here.
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.
I think "trap" is the best signal because it's called "trap". If the world doesn't treat it that way, the world is broken.