Bug 238694 - [Cocoa] semaphore_timedwait() can return KERN_ABORTED
Summary: [Cocoa] semaphore_timedwait() can return KERN_ABORTED
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-01 20:38 PDT by Myles C. Maxfield
Modified: 2022-04-02 13:25 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.66 KB, patch)
2022-04-01 20:38 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2022-04-01 20:38:18 PDT
[Cocoa] semaphore_timedwait() can return KERN_ABORTED
Comment 1 Myles C. Maxfield 2022-04-01 20:38:58 PDT
Created attachment 456436 [details]
Patch
Comment 2 Geoffrey Garen 2022-04-02 08:43:27 PDT
Comment on attachment 456436 [details]
Patch

Do you know how this happens?

According to documentation, KERN_ABORTED means somebody manually terminated the thread or something like that. That's a bit surprising. Not sure how it would happen. Might be some other bug?
Comment 3 Myles C. Maxfield 2022-04-02 09:04:09 PDT
I only saw it happen while attached to the process in Xcode. I’m not sure exactly what’s happening but it might be due to the debugger.
Comment 4 EWS 2022-04-02 09:37:50 PDT
Committed r292267 (249165@main): <https://commits.webkit.org/249165@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456436 [details].
Comment 5 Radar WebKit Bug Importer 2022-04-02 09:38:15 PDT
<rdar://problem/91202104>
Comment 6 Chris Dumez 2022-04-02 10:06:55 PDT
(In reply to Geoffrey Garen from comment #2)
> Comment on attachment 456436 [details]
> Patch
> 
> Do you know how this happens?
> 
> According to documentation, KERN_ABORTED means somebody manually terminated
> the thread or something like that. That's a bit surprising. Not sure how it
> would happen. Might be some other bug?

I think this can get called if the remote process (holding the other end of the IPC semaphore) is crashing, no?
Comment 7 Geoffrey Garen 2022-04-02 13:25:45 PDT
> I think this can get called if the remote process (holding the other end of
> the IPC semaphore) is crashing, no?

KERN_TERMINATED means the semaphore was destroyed (which I think is what happens when its creator crashes).

If Xcode interruption triggers KERN_ABORTED on our semaphore, I wonder if execution continues correctly after that?