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-3335] Crash in _os_object_retain called by dispatch_io_write (by DispatchIO.write) #708

Closed
weissi opened this issue Dec 5, 2016 · 1 comment

Comments

@weissi
Copy link
Member

weissi commented Dec 5, 2016

Previous ID SR-3335
Radar rdar://problem/29513290
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug, RunTimeCrash
Assignee None
Priority Medium

md5: 3292f2ad5755906bf415eb0320ddb747

Issue Description:

I was trying to reproduce some hang I'm sometimes seeing with DispatchIO (still possible to be somewhere in my code). Whilst trying to come up with a repro program I reached a stage of a program, that reliably crashes on macOS and Linux.

* thread #​17: tid = 29284, 0x00007ffff7f17b07 libdispatch.so`_os_object_retain + 23, name = 'repro', stop reason = signal SIGILL: illegal instruction operand
  * frame #​0: 0x00007ffff7f17b07 libdispatch.so`_os_object_retain + 23
    frame #​1: 0x00007ffff7f13a64 libdispatch.so`dispatch_io_write + 36
    frame #​2: 0x00007ffff7f2e170 libdispatch.so`_TFC8Dispatch10DispatchIO5writefT6offsetSi4dataVS_12DispatchData5queueCS_13DispatchQueue9ioHandlerFTSbGSqS1__Vs5Int32_T__T_ + 208
    frame #​3: 0x0000000000404548 repro`_TFFFF5repro4mainFT_T_U_FTVs5Int32S0__T_U3_FTSbGSqV8Dispatch12DispatchData_S0__T_U_FT_T_ + 104
    frame #​4: 0x00000000004046a7 repro`_TTRXFo___XFdCb___ + 39
    frame #​5: 0x00007ffff7f10e37 libdispatch.so`_dispatch_call_block_and_release + 7
    frame #​6: 0x00007ffff7f1d2f1 libdispatch.so`_dispatch_queue_serial_drain + 737
    frame #​7: 0x00007ffff7f1d931 libdispatch.so`_dispatch_queue_invoke + 849
    frame #​8: 0x00007ffff7f1f9a9 libdispatch.so`_dispatch_root_queue_drain + 393
    frame #&#8203;9: 0x00007ffff7f44408 libdispatch.so`overcommit_worker_main(unused=<unavailable>) + 152 at manager.c:315
    frame #&#8203;10: 0x00007ffff77dc70a libpthread.so.0`start_thread + 202
    frame #&#8203;11: 0x00007ffff5d7382d libc.so.6`__clone + 109 at clone.S:109

Repro

1. compile and the attached program (swiftc repro.swift && ./repro)
2. you'll see crashes

Notes

Linux

$ swift -version
Swift version 3.0-dev (LLVM 56c58af739, Clang 205968da71, Swift e60daaaee1)
Target: x86_64-unknown-linux-gnu

macOS

$ swift -version
Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9
@weissi
Copy link
Member Author

weissi commented Jul 13, 2017

fixed in Swift 4, potentially earlier.

@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

1 participant