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-4677] Intermittent crash in TestFoundation/TestURLSession #692

Closed
pushkarnk opened this issue Apr 24, 2017 · 5 comments
Closed

[SR-4677] Intermittent crash in TestFoundation/TestURLSession #692

pushkarnk opened this issue Apr 24, 2017 · 5 comments

Comments

@pushkarnk
Copy link

Previous ID SR-4677
Radar None
Original Reporter @pushkarnk
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee dgrove-oss (JIRA)
Priority Medium

md5: 449ba526e5ae862c14b254de13d2ee31

Issue Description:

This time its a dispatch crash. Very intermittent. All I could retrieve from the crash is the backtrace:

* thread #​10, name = 'TestFoundation', stop reason = signal SIGSEGV: invalid address (fault address: 0x38)
  * frame #​0: 0x00007ffff7edee67 libdispatch.so`_dispatch_unote_register + 631
    frame #​1: 0x00007ffff7ed93fb libdispatch.so`_dispatch_source_refs_register + 123
    frame #​2: 0x00007ffff7eda1fb libdispatch.so`_dispatch_source_invoke + 2171
    frame #​3: 0x00007ffff7ed4bf6 libdispatch.so`_dispatch_queue_serial_drain + 326
    frame #​4: 0x00007ffff7ed5130 libdispatch.so`_dispatch_mgr_queue_drain + 64
    frame #​5: 0x00007ffff7edb2cd libdispatch.so`_dispatch_mgr_invoke + 141
    frame #​6: 0x00007ffff7edb08b libdispatch.so`_dispatch_mgr_thread + 11
    frame #​7: 0x00007ffff7ed73b4 libdispatch.so`_dispatch_root_queue_drain + 372
    frame #​8: 0x00007ffff7ed71b8 libdispatch.so`_dispatch_worker_thread + 440
    frame #​9: 0x00007ffff6c866ba libpthread.so.0`start_thread + 202
    frame #​10: 0x00007ffff5d1482d libc.so.6`__clone at clone.S:109

If I have other findings, I'll post them here.

@pushkarnk
Copy link
Author

Saw this failure with "TestURLSession.test_dataTaskWithURL()" today

@swift-ci
Copy link

Comment by David Grove (JIRA)

Ran more than 10,000 times with no crashes. Unable to reproduce.

@swift-ci
Copy link

swift-ci commented Sep 7, 2017

Comment by David Grove (JIRA)

I've been able to reproduce a crash with this backtrace using the FTP tests from https://github.com/saiHemak/swift-corelibs-foundation/tree/ftpimplementation.

There is definitely a local problem with this code; _dispatch_muxnote_create can return NULL under certain odd circumstances and dispatch_unote_register is blindly dereferencing the result of calling _dispatch_muxnote_create when it is NULL, causing a segfault. Putting in the obvious check for NULL and returning false from dispatch_unote_register appears to be sufficient to allow the FTP tests to pass. I'm preparing a dispatch PR with the fix.--

It is still possible there is a higher-level bug in the layers above here, but the lowlevel code is definitely missing a check for a NULL return that can (does) happen.

@swift-ci
Copy link

swift-ci commented Sep 7, 2017

Comment by David Grove (JIRA)

submitted #300 with a proposed fix.

@swift-ci
Copy link

swift-ci commented Sep 7, 2017

Comment by David Grove (JIRA)

PR merged.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants