Coder Social home page Coder Social logo

Comments (26)

FranzBusch avatar FranzBusch commented on June 12, 2024 2

We just released a new version that backs out the new API: https://github.com/apple/swift-nio/releases/tag/2.61.0. Please confirm that this fixes the crash

from swift-nio.

weissi avatar weissi commented on June 12, 2024 1

@dnadoba this has a stack trace

Incident Identifier: 1086025F-7F64-42EC-8CAF-D9724CBAB527
CrashReporter Key:   40D309A8-4B1A-C8AB-A1EF-CB71C1CC050A
Hardware Model:      MacBookPro14,3
Process:             APP_NAME [82754]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/2EF156A4-64B6-40FC-AC71-03A0E58CE698/data/Containers/Bundle/Application/0A73DFE0-D246-4BB8-AFC9-1D6ED0F5AA61/APP_NAME.app/APP_NAME
Identifier:          com.APP_NAME.app
Version:             1.0 (1)
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      Exited process [82767]
Coalition:           com.apple.CoreSimulator.SimDevice.2EF156A4-64B6-40FC-AC71-03A0E58CE698 [3117]
Responsible Process: SimulatorTrampoline [6243]

Date/Time:           2023-10-25 13:32:11.6325 +0100
Launch Time:         2023-10-25 13:31:53.8895 +0100
OS Version:          macOS 13.6 (22G120)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                          	       0x11646ac52 __abort_with_payload + 10
1   dyld                          	       0x116484fd7 abort_with_payload_wrapper_internal + 82
2   dyld                          	       0x116485009 abort_with_payload + 9
3   dyld_sim                      	       0x10aa9f8eb abort_with_payload + 26
4   dyld_sim                      	       0x10aa5f4eb dyld4::halt(char const*) + 375
5   dyld_sim                      	       0x10aa5bc1c dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3070
6   dyld_sim                      	       0x10aa5be42 _dyld_sim_prepare + 379
7   dyld                          	       0x116407424 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1490
8   dyld                          	       0x116405abc dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 249
9   dyld                          	       0x1164053bd start + 1805


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000002000209  rbx: 0x0000000000000000  rcx: 0x00007ff7bbfd5518  rdx: 0x00007ff7bbfd5990
  rdi: 0x0000000000000006  rsi: 0x0000000000000004  rbp: 0x00007ff7bbfd5560  rsp: 0x00007ff7bbfd5518
   r8: 0x00007ff7bbfd5590   r9: 0x0000000000000000  r10: 0x0000000000000184  r11: 0x0000000000000246
  r12: 0x0000000000000184  r13: 0x00007ff7bbfd5990  r14: 0x0000000000000004  r15: 0x0000000000000006
  rip: 0x000000011646ac52  rfl: 0x0000000000000246  cr2: 0x0000000116484f85
  
Logical CPU:     0
Error Code:      0x02000209 
Trap Number:     133


Binary Images:
       0x1163ff000 -        0x11649afff dyld (*) <3df96f32-b9c9-3566-a6b7-4daebc6d6563> /usr/lib/dyld
       0x10aa5a000 -        0x10aaa7fff dyld_sim (*) <7276a69b-e3b9-3f23-957f-061350a501b4> /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
       0x103f25000 -        0x105a8cfff com.APP_NAME.app (1.0) <36759cd9-8a20-3153-9489-5dc59fd4fddf> /Users/USER/Library/Developer/CoreSimulator/Devices/2EF156A4-64B6-40FC-AC71-03A0E58CE698/data/Containers/Bundle/Application/0A73DFE0-D246-4BB8-AFC9-1D6ED0F5AA61/APP_NAME.app/APP_NAME
[...]

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

EOF

but it seems to be crashing in dyld. @MatthewTHFisher this seems unrelated to SwiftNIO, it's crashing in dyld before your binary could be loaded. Can you try again? Maybe with a clean build?

from swift-nio.

dfed avatar dfed commented on June 12, 2024 1

I just hit this, and my crash was on device. Rolling back to 2.59.0 fixed the issue for me as well.

from swift-nio.

chocoford avatar chocoford commented on June 12, 2024 1

Same problem on macOS 12.3

Termination Reason:    Namespace DYLD, Code 4 Symbol missing
Symbol not found: _swift_getExtendedExistentialTypeMetadata
Referenced from: /Applications/MyApp_Test.app/Contents/MacOS/MyApp_Test
Expected in: /usr/lib/swift/libswiftCore.dylib
(terminated at launch; ignore backtrace)

Application Specific Information:
Symbol not found: _swift_getExtendedExistentialTypeMetadata
Referenced from: /Applications/MyApp_Test.app/Contents/MacOS/MyApp_Test
Expected in: /usr/lib/swift/libswiftCore.dylib

from swift-nio.

dnadoba avatar dnadoba commented on June 12, 2024

Could you provide us with a crash report? Here is some information how to gather crash reports.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Here is a crash report from one of the sessions APP_NAME-2023-10-25-133231.txt

from swift-nio.

dnadoba avatar dnadoba commented on June 12, 2024

hm... this doesn't include a backtrace/stacktrace. Do you have this as well? The crashing thread is the most important thing but from the other running threads would be good as well. Preferably symbolicated.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

After performing a clean build the issue still persists. I also get this output in Xcode

dyld[97022]: Symbol not found: _swift_getExtendedExistentialTypeMetadata
  Referenced from: /Users/mfisher/Library/Developer/CoreSimulator/Devices/2EF156A4-64B6-40FC-AC71-03A0E58CE698/data/Containers/Bundle/Application/BA1A2580-3370-4FEB-A252-270AFE4B17E0/APP_NAME.app/APP_NAME
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCore.dylib

from swift-nio.

weissi avatar weissi commented on June 12, 2024

After performing a clean build the issue still persists

And if you downgrade to NIO 2.59.0 it disappears?

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Just tried again, downgraded to NIO 2.59.0 and performed a clean build, the app runs as expected

from swift-nio.

Lukasa avatar Lukasa commented on June 12, 2024

@weissi do you recall if dyld in the simulator logs to the host unified log?

from swift-nio.

weissi avatar weissi commented on June 12, 2024

@weissi do you recall if dyld in the simulator logs to the host unified log?

I would very much assume so but I don't know for a fact

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Just an update, I cloned the NIO package and ran the tests against an iOS 15.5 simulator (setting the packages minimum platform to iOS 15) and it crashed on me there too.

The test file is NIOHTTP1Tests/HTTPClientUpgradeTests.swift and failed at line 972 with message Thread 1: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff8)

let upgraders: [any NIOTypedHTTPClientProtocolUpgrader<Bool>] = Array(clientUpgraders.map { $0 as! any NIOTypedHTTPClientProtocolUpgrader<Bool> })

I have a slight suspicion that this is related to the casting of a generic type. Maybe linked to this issue apple/swift#64657

from swift-nio.

Lukasa avatar Lukasa commented on June 12, 2024

@MatthewTHFisher Does Console.app have dyld logs that are relevant here?

Either way, given the dyld issue I think you'll want to use Feedback Assistant to file an issue with an attached sysdiagnose. If you do this, please provide a feedback number on this issue so we can correlate.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

@MatthewTHFisher Does Console.app have dyld logs that are relevant here?

Tried to look in the Console.app but couldn't spot any useful dyld logs.

I have however managed to replicate this issue on a new project within Xcode and have written the steps to reproduce this result.

  1. Create a new iOS App project in Xcode.
  2. Project > Info > Set iOS deployment target to iOS 15.0
  3. Target > General > Set minimum deployment to iOS 15.0

  4. Project > Package Dependencies > Add swift-nio package to project making sure to get version 2.60.0. When asked to choose package products choose, NIO, NIOHTTP1, and NIOWebSocket.
  5. (Optional, not sure if this mattered) Add import NIO to the list of dependencies in a file, I added it to ContentView.swift (SwiftUI).
  6. Then run the app on a iOS 15 sim.

At this point when the app launches and crashes I get the same error message in Xcode as experienced earlier (just with different project names):

After performing a clean build the issue still persists. I also get this output in Xcode

dyld[97022]: Symbol not found: _swift_getExtendedExistentialTypeMetadata
  Referenced from: /Users/mfisher/Library/Developer/CoreSimulator/Devices/2EF156A4-64B6-40FC-AC71-03A0E58CE698/data/Containers/Bundle/Application/BA1A2580-3370-4FEB-A252-270AFE4B17E0/APP_NAME.app/APP_NAME
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCore.dylib

I have also attached the crash report here > Swift-NIO-2-60-0-Check-2023-10-26-094542.txt

To get around this issue on the above new project, try running the project with swift-nio set to 2.59.0 on an iOS 15 sim, or try running with swift-nio still set to 2.60.0 but on an iOS 16 sim.

from swift-nio.

FranzBusch avatar FranzBusch commented on June 12, 2024

Can you try using Xcode 15 and see if you can still reproduce this? This looks like a compiler bug where we emitted _swift_getExtendedExistentialTypeMetadata when it wasn't present for older runtimes and it looks like it was fixed some time ago already.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Can you try using Xcode 15 and see if you can still reproduce this? This looks like a compiler bug where we emitted _swift_getExtendedExistentialTypeMetadata when it wasn't present for older runtimes and it looks like it was fixed some time ago already.

Just had a colleague test this on their MacBook (M1 chip, Xcode 15.0.0) and the result was the same. The app crashed on launch with the following output.

dyld[93329]: Symbol not found: _swift_getExtendedExistentialTypeMetadata
Referenced from: /Users/NAME/Library/Developer/CoreSimulator/Devices/7CDA09D2-9CE5-4C68-9A1F-2FB91CED61E7/data/Containers/Bundle/Application/79A75945-2ADC-464F-BA20-AAF1F3722270/Swift-NIO-2-60-0-Check.app/Swift-NIO-2-60-0-Check
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftCore.dylib

from swift-nio.

FranzBusch avatar FranzBusch commented on June 12, 2024

Thanks for all the investigation. At this point, can you please file a feedback using Apple feedback tool, attach all of the information you provided here and please send us the feedback number.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Feedback has been submitted titled "swift-nio version 2.60.0 is causing apps to crash when launched on iOS 15 simulators" and has a feedback number of FB13302639.

Edit:
In the meantime we have updated our app to use swift-nio version 2.59.0 exactly to avoid the issues with the latest version.

from swift-nio.

Lukasa avatar Lukasa commented on June 12, 2024

Thanks git bisect: "de07e573d6fbce99cc72a558ce61dbb1ccddb205 is the first bad commit"

from swift-nio.

FranzBusch avatar FranzBusch commented on June 12, 2024

Thanks for all the reports. I opened a PR #2579 that backs out the new APIs that are the culprit for this crash for now. I would appreciate if @MatthewTHFisher you could re-run your test but point at my PR branch.

from swift-nio.

MatthewTHFisher avatar MatthewTHFisher commented on June 12, 2024

Thanks for all the reports. I opened a PR #2579 that backs out the new APIs that are the culprit for this crash for now. I would appreciate if @MatthewTHFisher you could re-run your test but point at my PR branch.

Just tested using two methods against your branch @FranzBusch:

  • Downloaded your branch and ran the packages tests against my iOS 15.5 simulator. These all passed without any crashes.
  • Performed these steps again but with your branch, and the app runs on my iOS 15.5 simulator as expected without crashing.

from swift-nio.

dfed avatar dfed commented on June 12, 2024

Confirmed that 2.61.0 does not cause a crash on my iOS 15 device.

from swift-nio.

Kyle-Ye avatar Kyle-Ye commented on June 12, 2024

This is recently fixed upstream by apple/swift#69475 on Swift 5.10.

from swift-nio.

ashgti avatar ashgti commented on June 12, 2024

With this issue closed, should is the NIOWebSocketServer unblocked (see https://github.com/apple/swift-nio/blob/main/Sources/NIOWebSocketServer/Server.swift#L51) or is there additional work that need to be done to enable the WebSocketServer example code again?

from swift-nio.

FranzBusch avatar FranzBusch commented on June 12, 2024

We have to wait for a new compiler/Xcode release that includes this fix and then we can ship it again. We don't want to add the APIs only for Linux right now but also for Darwin. Once the releases have shipped we will add them back with the appropriate compiler guards around them.

For the time being you can probably just copy what we have backed out and it will work as long as you don't deploy to older iOS/macOS/etc. versions.

from swift-nio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.