Skip to content
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

[SR-3175] Include signal # in subtask termination message #45763

Closed
ddunbar opened this issue Nov 10, 2016 · 8 comments
Closed

[SR-3175] Include signal # in subtask termination message #45763

ddunbar opened this issue Nov 10, 2016 · 8 comments
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@ddunbar
Copy link
Member

ddunbar commented Nov 10, 2016

Previous ID SR-3175
Radar None
Original Reporter @ddunbar
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Driver, StarterBug
Assignee matthew carroll (JIRA)
Priority Medium

md5: 148e80b2f79c8a6c1956072cc7f6048e

Issue Description:

It would be nice if the Swift driver would report the terminating signal number when it delivers a "signalled" message as part of -parseable-output.

@belkadan
Copy link
Contributor

The place to look here is in the (multiple) implementations of TaskQueue under swift/lib/Basic, and its use in swift/lib/Driver/Compilation.cpp.

@modocache
Copy link
Mannequin

modocache mannequin commented Nov 16, 2016

@ddunbar, it'd be easier for a newcomer to pick up this starter task if you included a command-line invocation that demonstrates the problem. Do you have one handy? 🙂

@belkadan
Copy link
Contributor

swiftc -Xfrontend -debug-crash-immediately empty.swift should work.

@swift-ci
Copy link
Collaborator

Comment by Markus Chmelar (JIRA)

swiftc -Xfrontend -debug-crash-immediately empty.swift -parseable-output produces

...
"kind": "signalled",
"name": "compile",
"pid": 2835,
"output": "0 swift ......,
"error-message": "Illegal instruction: 4"
...

Isn't the error-message the signal? Or do you mean to add the raw number of the signal to the output as well?

@belkadan
Copy link
Contributor

I think the request is for the raw number, yeah. Using the output of strsignal isn't very stable.

@swift-ci
Copy link
Collaborator

Comment by Chris Double (JIRA)

This looks relatively easy to fix for the Unix TaskQueue implementation - it has the signal value, calls strsignal on it and passes the string to the callback. Extending the callback signature to include the integer signal value would enable it to receive it and be added to the parseable-output.

The Default TaskQueue implementation uses the return value of llvm::sys::Wait to identify if a signal occurred. The Unix implementation of that function has the signal value, calls strsignal and then returns '-2' with the error message set. The actual signal integer is discarded. The Windows implementation doesn't have a signal value at all - it sets the error message explicitly to a couple of hard coded strings.

Given this, what should the value of the raw number of the signal be in the parseable output on Default TaskQueue backends? Not included at all and just have it added if the Unix TaskQueue implementation is used?

@belkadan
Copy link
Contributor

That would be my preference, and then we document that the information may not be available on all platforms (but that if it is ever provided it should not be removed in future versions of the compiler).

@swift-ci
Copy link
Collaborator

Comment by Matthew Carroll (JIRA)

#6787

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Projects
None yet
Development

No branches or pull requests

3 participants