[GH-ISSUE #134] AtlantisHelper crashes when using websockets and Intercom's new package #81

Closed
opened 2026-03-03 19:11:37 +03:00 by kerem · 28 comments
Owner

Originally created by @chadparker on GitHub (Aug 9, 2023).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/134

Originally assigned to: @NghiaTranUIT on GitHub.

Xcode 14.3.1 (14E300c)

Screenshot 2023-08-09 at 8 04 04 AM
Originally created by @chadparker on GitHub (Aug 9, 2023). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/134 Originally assigned to: @NghiaTranUIT on GitHub. Xcode 14.3.1 (14E300c) <img width="954" alt="Screenshot 2023-08-09 at 8 04 04 AM" src="https://github.com/ProxymanApp/atlantis/assets/438307/58ae3735-3d1a-4e97-9851-084f23d8aeca">
kerem 2026-03-03 19:11:37 +03:00
  • closed this issue
  • added the
    Done
    bug
    labels
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 9, 2023):

Hey @chadparker just wondering: What Atlantis version and iOS version you're using?

I'd like to investigate it 👍

<!-- gh-comment-id:1671591999 --> @NghiaTranUIT commented on GitHub (Aug 9, 2023): Hey @chadparker just wondering: What Atlantis version and iOS version you're using? I'd like to investigate it 👍
Author
Owner

@chadparker commented on GitHub (Aug 9, 2023):

Atlantis 1.21.1
iOS 15.4 and 16.4

<!-- gh-comment-id:1671658311 --> @chadparker commented on GitHub (Aug 9, 2023): Atlantis 1.21.1 iOS 15.4 and 16.4
Author
Owner

@chadparker commented on GitHub (Aug 9, 2023):

We have narrowed it down to moving to Intercom's new iOS package.

https://github.com/intercom/intercom-ios   <--- Atlantis worked just fine
https://github.com/intercom/intercom-ios-sp   <--- Atlantis crashed as shown above

When I revert back to the previous version Atlantis works again with websockets.

We were also having issues with the debugger not working while using the newer package:

(lldb) po hourlySummaries.count
error: expression failed to parse:
error: stat cache file '/Users/distiller/project/DerivedData/archive/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache' not found
error: stat cache file '/Users/distiller/project/DerivedData/archive/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache' not found

error: couldn't IRGen expression. Please check the above error messages for possible root causes.

but reverting to the previous version of Intercom fixes that as well. Very surprising it would cause issues like this. Going to send them a support message now.

<!-- gh-comment-id:1672176421 --> @chadparker commented on GitHub (Aug 9, 2023): We have narrowed it down to moving to Intercom's new iOS package. ``` https://github.com/intercom/intercom-ios <--- Atlantis worked just fine https://github.com/intercom/intercom-ios-sp <--- Atlantis crashed as shown above ``` When I revert back to the previous version Atlantis works again with websockets. We were also having issues with the debugger not working while using the newer package: ``` (lldb) po hourlySummaries.count error: expression failed to parse: error: stat cache file '/Users/distiller/project/DerivedData/archive/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache' not found error: stat cache file '/Users/distiller/project/DerivedData/archive/SDKStatCaches.noindex/iphonesimulator16.4-20E238-.sdkstatcache' not found error: couldn't IRGen expression. Please check the above error messages for possible root causes. ``` but reverting to the previous version of Intercom fixes that as well. Very surprising it would cause issues like this. Going to send them a support message now.
Author
Owner

@NghiaTranUIT commented on GitHub (Aug 10, 2023):

Thanks for the update. Let me know if it's Atlantis bug, then I can check it.

<!-- gh-comment-id:1672359499 --> @NghiaTranUIT commented on GitHub (Aug 10, 2023): Thanks for the update. Let me know if it's Atlantis bug, then I can check it.
Author
Owner

@yuravake commented on GitHub (Oct 4, 2023):

Having the same issue here, @chadparker did you had a chance to fix this?

<!-- gh-comment-id:1746968684 --> @yuravake commented on GitHub (Oct 4, 2023): Having the same issue here, @chadparker did you had a chance to fix this?
Author
Owner

@chadparker commented on GitHub (Oct 4, 2023):

No, @yuravake we sent a support message to Intercom, and they suggested to try their next release but it didn't fix the issue. We reverted our Intercom version for now. Could you create a support ticket with Intercom to raise visibility into this?

<!-- gh-comment-id:1747728941 --> @chadparker commented on GitHub (Oct 4, 2023): No, @yuravake we sent a support message to Intercom, and they suggested to try their next release but it didn't fix the issue. We reverted our Intercom version for now. Could you create a support ticket with Intercom to raise visibility into this?
Author
Owner

@yuravake commented on GitHub (Oct 5, 2023):

@chadparker yes, will do.

<!-- gh-comment-id:1748122014 --> @yuravake commented on GitHub (Oct 5, 2023): @chadparker yes, will do.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 5, 2023):

Hi @chadparker @yuravake do you think that I should have a function to enable/disable the WebSocket Interceptor on Atlantis ? So, you can opt-out and prevent internal crashes from the Intercom app.

<!-- gh-comment-id:1748158509 --> @NghiaTranUIT commented on GitHub (Oct 5, 2023): Hi @chadparker @yuravake do you think that I should have a function to enable/disable the WebSocket Interceptor on Atlantis ? So, you can opt-out and prevent internal crashes from the Intercom app.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 5, 2023):

By default, Atlantis performs the Method Swizzling from all available classes, including the main app, 3rd-party frameworks, and libraries.

I suggest:

  • Only perform the method swizzling for the current app.
  • Ignore 3rd-party libs.

It might solve all problems.

<!-- gh-comment-id:1748160230 --> @NghiaTranUIT commented on GitHub (Oct 5, 2023): By default, Atlantis performs the Method Swizzling from all available classes, including the main app, 3rd-party frameworks, and libraries. I suggest: - Only perform the `method swizzling` for the current app. - Ignore 3rd-party libs. It might solve all problems.
Author
Owner

@chadparker commented on GitHub (Oct 6, 2023):

@NghiaTranUIT That sounds like a good solution; that would be a great function to have! I'm not very familiar with the Atlantis code, but if you could give me things to try I'll definitely let you know if it fixes things.

<!-- gh-comment-id:1751343096 --> @chadparker commented on GitHub (Oct 6, 2023): @NghiaTranUIT That sounds like a good solution; that would be a great function to have! I'm not very familiar with the Atlantis code, but if you could give me things to try I'll definitely let you know if it fixes things.
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 7, 2023):

@chadparker @yuravake can you check with the latest version of Intercom ?

Here is my setup:

Result:

  • No crash
  • Atlantis can intercept Intercom traffic

CleanShot 2023-10-07 at 09 42 31@2x


  • Tested with Intercom v15.2.1 (Sep 5) and it works fine too. I couldn't reproduce the WebSocket crash 😢
<!-- gh-comment-id:1751572681 --> @NghiaTranUIT commented on GitHub (Oct 7, 2023): @chadparker @yuravake can you check with the latest version of Intercom ? Here is my setup: - Atlantis v1.22.0 (latest) - Intercome v16.0.3 (latest - https://github.com/intercom/intercom-ios-sp) - Proxyman v4.12.0 (latest) Result: - No crash ✅ - Atlantis can intercept Intercom traffic ![CleanShot 2023-10-07 at 09 42 31@2x](https://github.com/ProxymanApp/atlantis/assets/5878421/e3a0ee87-1ad8-4e76-8940-c8a50e5803f6) --------- - Tested with Intercom v15.2.1 (Sep 5) and it works fine too. I couldn't reproduce the WebSocket crash 😢
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 7, 2023):

@NghiaTranUIT That sounds like a good solution; that would be a great function to have! I'm not very familiar with the Atlantis code, but if you could give me things to try I'll definitely let you know if it fixes things.

Turn out it's not technically feasible:

  • Atlantis tries to intercept the URLSession from Apple framework (CFNetwork.framework)
  • However, I couldn't query if the URLSession is called from the main app or 3rd-library. There is no such information in runtime (Or I haven't found it yet). The only info I can retrieve is the current framework, which bundles the URLSession class. which is CFNetwork.framework
<!-- gh-comment-id:1751573996 --> @NghiaTranUIT commented on GitHub (Oct 7, 2023): > @NghiaTranUIT That sounds like a good solution; that would be a great function to have! I'm not very familiar with the Atlantis code, but if you could give me things to try I'll definitely let you know if it fixes things. Turn out it's not technically feasible: - Atlantis tries to intercept the URLSession from Apple framework (CFNetwork.framework) - However, I couldn't query if the URLSession is called from the main app or 3rd-library. There is no such information in runtime (Or I haven't found it yet). The only info I can retrieve is the current framework, which bundles the URLSession class. which is `CFNetwork.framework`
Author
Owner

@yuravake commented on GitHub (Oct 9, 2023):

@NghiaTranUIT unfortunately, we can still reproduce this crash on the latest versions(

<!-- gh-comment-id:1753404121 --> @yuravake commented on GitHub (Oct 9, 2023): @NghiaTranUIT unfortunately, we can still reproduce this crash on the latest versions(
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 10, 2023):

@yuravake can you share with me your setup?

  • iOS version
  • iOS device or simulator
  • Xcode version.
  • Atlantis version
  • Intercom version
<!-- gh-comment-id:1754141958 --> @NghiaTranUIT commented on GitHub (Oct 10, 2023): @yuravake can you share with me your setup? - iOS version - iOS device or simulator - Xcode version. - Atlantis version - Intercom version
Author
Owner

@djbe commented on GitHub (Nov 6, 2023):

Have the same exact crash.

Some info:

  • iOS 17.0 (21A328)
  • Simulator (iPhone 15 Pro)
  • Xcode 15.0 (15A240d)
  • Atlantis 1.22.0
  • Intercom 16.2.3
<!-- gh-comment-id:1795812368 --> @djbe commented on GitHub (Nov 6, 2023): Have the same exact crash. Some info: - iOS 17.0 (21A328) - Simulator (iPhone 15 Pro) - Xcode 15.0 (15A240d) - Atlantis 1.22.0 - Intercom 16.2.3
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 8, 2023):

Hix, not sure why I can't reproduce the crash:

@djbe can you share your setup?

  • Is Atlantis installed via Cocoapods or SPM?
  • Is Intercom installed via Cocoapods or SPM?
  • What func is called that causes the crash? (You can trace it from the Xcode's call stack)

Thanks in advance 🙇


  • My setup: Install Atlantis and Intercom (Same version) via SPM. It works fine, no crash.

Screenshot 2023-11-08 at 10 27 14

<!-- gh-comment-id:1800955883 --> @NghiaTranUIT commented on GitHub (Nov 8, 2023): Hix, not sure why I can't reproduce the crash: @djbe can you share your setup? - Is Atlantis installed via Cocoapods or SPM? - Is Intercom installed via Cocoapods or SPM? - What func is called that causes the crash? (You can trace it from the Xcode's call stack) Thanks in advance 🙇 -------------- - My setup: Install Atlantis and Intercom (Same version) via SPM. It works fine, no crash. ![Screenshot 2023-11-08 at 10 27 14](https://github.com/ProxymanApp/atlantis/assets/5878421/72cfc65b-fd83-4cab-a6f8-1c91f4a86803)
Author
Owner

@djbe commented on GitHub (Nov 8, 2023):

  • Both are installed via CocoaPods
  • By trace, do you mean bt?
Output of `bt`
(lldb) bt
* thread #6, queue = 'com.apple.NSURLSession-delegate', stop reason = EXC_BAD_ACCESS (code=2, address=0x16d618000)
    frame #0: 0x00000001051b3840 libsystem_platform.dylib`_platform_memmove + 112
    frame #1: 0x00000001800c2ce4 libsystem_blocks.dylib`_Block_copy + 92
  * frame #2: 0x00000001047443d4 Atlantis`closure #1 in static AtlantisHelper.swizzleWebSocketReceiveMessage(message=0x00006000000213d0, error=nil, responseHandler=0x0000000104761230 Atlantis`partial apply forwarder for closure #1 (Swift.Optional<Swift.String>, Swift.Optional<Foundation.Data>, Swift.Optional<Swift.Error>) -> () in closure #1 (Swift.AnyObject, Swift.AnyObject) -> () in Atlantis.NetworkInjector._swizzleURLSessionWebSocketReceiveMessageSelector(Swift.AnyObject.Type) -> () at <compiler-generated>, originalHandler=0x000000016d6127f8) at AtlantisHelper.swift:75:13
    frame #3: 0x00000001047449cc Atlantis`thunk for @escaping @callee_guaranteed (@guaranteed NSObject?, @guaranteed NSError?) -> () at <compiler-generated>:0
    frame #4: 0x00000001074780f0 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #5: 0x000000010747993c libdispatch.dylib`_dispatch_client_callout + 16
    frame #6: 0x0000000107481bd8 libdispatch.dylib`_dispatch_lane_serial_drain + 916
    frame #7: 0x000000010748291c libdispatch.dylib`_dispatch_lane_invoke + 420
    frame #8: 0x000000010748f2f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324
    frame #9: 0x000000010748e754 libdispatch.dylib`_dispatch_workloop_worker_thread + 488
    frame #10: 0x000000010549f924 libsystem_pthread.dylib`_pthread_wqthread + 284
Output of `bt all`
(lldb) bt all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76
    frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532
    frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20
    frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156
    frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148
    frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #7: 0x000000018986ebc0 GraphicsServices`GSEventRunModal + 160
    frame #8: 0x0000000114e4bfdc UIKitCore`-[UIApplication _run] + 868
    frame #9: 0x0000000114e4fc54 UIKitCore`UIApplicationMain + 124
    frame #10: 0x0000000114311ab8 UIKitCore`UIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 100
    frame #11: 0x0000000102abb274 Terhills`static UIApplicationDelegate.main() at <compiler-generated>:0
    frame #12: 0x0000000102abb1f0 Terhills`static AppDelegate.$main(self=Terhills.AppDelegate) at <compiler-generated>:0
    frame #13: 0x0000000102abb2f0 Terhills`main at AppDelegate.swift:9:13
    frame #14: 0x0000000103685558 dyld_sim`start_sim + 20
    frame #15: 0x000000010302e058 dyld`start + 2224
  thread #2
    frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #3
    frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread
  thread #4
    frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #5, name = 'com.apple.uikit.eventfetch-thread'
    frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76
    frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532
    frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20
    frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156
    frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148
    frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #7: 0x0000000180dafa98 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
    frame #8: 0x0000000180dafcbc Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 60
    frame #9: 0x0000000114eee304 UIKitCore`-[UIEventFetcher threadMain] + 404
    frame #10: 0x0000000180dd627c Foundation`__NSThread__start__ + 720
    frame #11: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104
* thread #6, queue = 'com.apple.NSURLSession-delegate', stop reason = EXC_BAD_ACCESS (code=2, address=0x16d618000)
    frame #0: 0x00000001051b3840 libsystem_platform.dylib`_platform_memmove + 112
    frame #1: 0x00000001800c2ce4 libsystem_blocks.dylib`_Block_copy + 92
  * frame #2: 0x00000001047443d4 Atlantis`closure #1 in static AtlantisHelper.swizzleWebSocketReceiveMessage(message=0x00006000000213d0, error=nil, responseHandler=0x0000000104761230 Atlantis`partial apply forwarder for closure #1 (Swift.Optional<Swift.String>, Swift.Optional<Foundation.Data>, Swift.Optional<Swift.Error>) -> () in closure #1 (Swift.AnyObject, Swift.AnyObject) -> () in Atlantis.NetworkInjector._swizzleURLSessionWebSocketReceiveMessageSelector(Swift.AnyObject.Type) -> () at <compiler-generated>, originalHandler=0x000000016d6127f8) at AtlantisHelper.swift:75:13
    frame #3: 0x00000001047449cc Atlantis`thunk for @escaping @callee_guaranteed (@guaranteed NSObject?, @guaranteed NSError?) -> () at <compiler-generated>:0
    frame #4: 0x00000001074780f0 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #5: 0x000000010747993c libdispatch.dylib`_dispatch_client_callout + 16
    frame #6: 0x0000000107481bd8 libdispatch.dylib`_dispatch_lane_serial_drain + 916
    frame #7: 0x000000010748291c libdispatch.dylib`_dispatch_lane_invoke + 420
    frame #8: 0x000000010748f2f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324
    frame #9: 0x000000010748e754 libdispatch.dylib`_dispatch_workloop_worker_thread + 488
    frame #10: 0x000000010549f924 libsystem_pthread.dylib`_pthread_wqthread + 284
  thread #7
    frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #8
    frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #9
    frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread
  thread #10, name = 'com.apple.CFSocket.private'
    frame #0: 0x0000000106bf31a8 libsystem_kernel.dylib`__select + 8
    frame #1: 0x00000001803d48a0 CoreFoundation`__CFSocketManager + 612
    frame #2: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104
  thread #11, name = 'com.apple.CFStream.LegacyThread'
    frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76
    frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532
    frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20
    frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156
    frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148
    frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #7: 0x00000001803e35b4 CoreFoundation`_legacyStreamRunLoop_workThread + 260
    frame #8: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104
  thread #12, name = 'com.apple.NSURLConnectionLoader'
    frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76
    frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532
    frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20
    frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156
    frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148
    frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #7: 0x00000001844256c8 CFNetwork`___lldb_unnamed_symbol13732 + 336
    frame #8: 0x0000000180dd627c Foundation`__NSThread__start__ + 720
    frame #9: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104
  thread #13
    frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread
  thread #14
    frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #15
    frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread
<!-- gh-comment-id:1800959732 --> @djbe commented on GitHub (Nov 8, 2023): - Both are installed via CocoaPods - By trace, do you mean `bt`? <details> <summary>Output of `bt`</summary> ``` (lldb) bt * thread #6, queue = 'com.apple.NSURLSession-delegate', stop reason = EXC_BAD_ACCESS (code=2, address=0x16d618000) frame #0: 0x00000001051b3840 libsystem_platform.dylib`_platform_memmove + 112 frame #1: 0x00000001800c2ce4 libsystem_blocks.dylib`_Block_copy + 92 * frame #2: 0x00000001047443d4 Atlantis`closure #1 in static AtlantisHelper.swizzleWebSocketReceiveMessage(message=0x00006000000213d0, error=nil, responseHandler=0x0000000104761230 Atlantis`partial apply forwarder for closure #1 (Swift.Optional<Swift.String>, Swift.Optional<Foundation.Data>, Swift.Optional<Swift.Error>) -> () in closure #1 (Swift.AnyObject, Swift.AnyObject) -> () in Atlantis.NetworkInjector._swizzleURLSessionWebSocketReceiveMessageSelector(Swift.AnyObject.Type) -> () at <compiler-generated>, originalHandler=0x000000016d6127f8) at AtlantisHelper.swift:75:13 frame #3: 0x00000001047449cc Atlantis`thunk for @escaping @callee_guaranteed (@guaranteed NSObject?, @guaranteed NSError?) -> () at <compiler-generated>:0 frame #4: 0x00000001074780f0 libdispatch.dylib`_dispatch_call_block_and_release + 24 frame #5: 0x000000010747993c libdispatch.dylib`_dispatch_client_callout + 16 frame #6: 0x0000000107481bd8 libdispatch.dylib`_dispatch_lane_serial_drain + 916 frame #7: 0x000000010748291c libdispatch.dylib`_dispatch_lane_invoke + 420 frame #8: 0x000000010748f2f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324 frame #9: 0x000000010748e754 libdispatch.dylib`_dispatch_workloop_worker_thread + 488 frame #10: 0x000000010549f924 libsystem_pthread.dylib`_pthread_wqthread + 284 ``` </details> <details> <summary>Output of `bt all`</summary> ``` (lldb) bt all thread #1, queue = 'com.apple.main-thread' frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8 frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76 frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532 frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20 frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156 frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148 frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572 frame #7: 0x000000018986ebc0 GraphicsServices`GSEventRunModal + 160 frame #8: 0x0000000114e4bfdc UIKitCore`-[UIApplication _run] + 868 frame #9: 0x0000000114e4fc54 UIKitCore`UIApplicationMain + 124 frame #10: 0x0000000114311ab8 UIKitCore`UIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 100 frame #11: 0x0000000102abb274 Terhills`static UIApplicationDelegate.main() at <compiler-generated>:0 frame #12: 0x0000000102abb1f0 Terhills`static AppDelegate.$main(self=Terhills.AppDelegate) at <compiler-generated>:0 frame #13: 0x0000000102abb2f0 Terhills`main at AppDelegate.swift:9:13 frame #14: 0x0000000103685558 dyld_sim`start_sim + 20 frame #15: 0x000000010302e058 dyld`start + 2224 thread #2 frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8 thread #3 frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread thread #4 frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8 thread #5, name = 'com.apple.uikit.eventfetch-thread' frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8 frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76 frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532 frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20 frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156 frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148 frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572 frame #7: 0x0000000180dafa98 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208 frame #8: 0x0000000180dafcbc Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 60 frame #9: 0x0000000114eee304 UIKitCore`-[UIEventFetcher threadMain] + 404 frame #10: 0x0000000180dd627c Foundation`__NSThread__start__ + 720 frame #11: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104 * thread #6, queue = 'com.apple.NSURLSession-delegate', stop reason = EXC_BAD_ACCESS (code=2, address=0x16d618000) frame #0: 0x00000001051b3840 libsystem_platform.dylib`_platform_memmove + 112 frame #1: 0x00000001800c2ce4 libsystem_blocks.dylib`_Block_copy + 92 * frame #2: 0x00000001047443d4 Atlantis`closure #1 in static AtlantisHelper.swizzleWebSocketReceiveMessage(message=0x00006000000213d0, error=nil, responseHandler=0x0000000104761230 Atlantis`partial apply forwarder for closure #1 (Swift.Optional<Swift.String>, Swift.Optional<Foundation.Data>, Swift.Optional<Swift.Error>) -> () in closure #1 (Swift.AnyObject, Swift.AnyObject) -> () in Atlantis.NetworkInjector._swizzleURLSessionWebSocketReceiveMessageSelector(Swift.AnyObject.Type) -> () at <compiler-generated>, originalHandler=0x000000016d6127f8) at AtlantisHelper.swift:75:13 frame #3: 0x00000001047449cc Atlantis`thunk for @escaping @callee_guaranteed (@guaranteed NSObject?, @guaranteed NSError?) -> () at <compiler-generated>:0 frame #4: 0x00000001074780f0 libdispatch.dylib`_dispatch_call_block_and_release + 24 frame #5: 0x000000010747993c libdispatch.dylib`_dispatch_client_callout + 16 frame #6: 0x0000000107481bd8 libdispatch.dylib`_dispatch_lane_serial_drain + 916 frame #7: 0x000000010748291c libdispatch.dylib`_dispatch_lane_invoke + 420 frame #8: 0x000000010748f2f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324 frame #9: 0x000000010748e754 libdispatch.dylib`_dispatch_workloop_worker_thread + 488 frame #10: 0x000000010549f924 libsystem_pthread.dylib`_pthread_wqthread + 284 thread #7 frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8 thread #8 frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8 thread #9 frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread thread #10, name = 'com.apple.CFSocket.private' frame #0: 0x0000000106bf31a8 libsystem_kernel.dylib`__select + 8 frame #1: 0x00000001803d48a0 CoreFoundation`__CFSocketManager + 612 frame #2: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104 thread #11, name = 'com.apple.CFStream.LegacyThread' frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8 frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76 frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532 frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20 frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156 frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148 frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572 frame #7: 0x00000001803e35b4 CoreFoundation`_legacyStreamRunLoop_workThread + 260 frame #8: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104 thread #12, name = 'com.apple.NSURLConnectionLoader' frame #0: 0x0000000106be8c10 libsystem_kernel.dylib`mach_msg2_trap + 8 frame #1: 0x0000000106bf9da4 libsystem_kernel.dylib`mach_msg2_internal + 76 frame #2: 0x0000000106bf0e34 libsystem_kernel.dylib`mach_msg_overwrite + 532 frame #3: 0x0000000106be8f88 libsystem_kernel.dylib`mach_msg + 20 frame #4: 0x00000001803c5ed8 CoreFoundation`__CFRunLoopServiceMachPort + 156 frame #5: 0x00000001803c05b8 CoreFoundation`__CFRunLoopRun + 1148 frame #6: 0x00000001803bfd28 CoreFoundation`CFRunLoopRunSpecific + 572 frame #7: 0x00000001844256c8 CFNetwork`___lldb_unnamed_symbol13732 + 336 frame #8: 0x0000000180dd627c Foundation`__NSThread__start__ + 720 frame #9: 0x00000001054a34c0 libsystem_pthread.dylib`_pthread_start + 104 thread #13 frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread thread #14 frame #0: 0x0000000106bea74c libsystem_kernel.dylib`__workq_kernreturn + 8 thread #15 frame #0: 0x000000010549e6dc libsystem_pthread.dylib`start_wqthread ``` </details>
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 8, 2023):

Thanks @djbe . I'm working on the fix now.

  • Provide a flag to turn off the method swizzling in WebSocket classes => Prevent unexpected crashes 👍
<!-- gh-comment-id:1801005283 --> @NghiaTranUIT commented on GitHub (Nov 8, 2023): Thanks @djbe . I'm working on the fix now. - Provide a flag to turn off the method swizzling in WebSocket classes => Prevent unexpected crashes 👍
Author
Owner

@djbe commented on GitHub (Nov 8, 2023):

Hmmm, definitely better than what I'm doing currently (disable Intercom in debug builds).

Any idea on the root cause? Presumably it's something that Intercom and Atlantis are both doing (with web sockets), but what 🤷

<!-- gh-comment-id:1801813256 --> @djbe commented on GitHub (Nov 8, 2023): Hmmm, definitely better than what I'm doing currently (disable Intercom in debug builds). Any idea on the root cause? Presumably it's something that Intercom and Atlantis are both doing (with web sockets), but what 🤷
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 9, 2023):

Sorry for the delay.

@djbe @yuravake @chadparker If you don't mind, let's update Atlantis to v1.23.0 and use this code:

Atlantis.start(hostName: "<Your host name>", shouldCaptureWebSocketTraffic: false)

It will skip the Method Swillzing on the WS/WSS connection, which prevents the unexpected crash on the Intercom package 👍

Any idea on the root cause? Presumably it's something that Intercom and Atlantis are both doing (with web sockets), but what 🤷

I'm still investigating it, but not found a solution yet. This fix can help you workaround it 👍

<!-- gh-comment-id:1803057604 --> @NghiaTranUIT commented on GitHub (Nov 9, 2023): Sorry for the delay. @djbe @yuravake @chadparker If you don't mind, let's update Atlantis to [v1.23.0](https://github.com/ProxymanApp/atlantis/releases/tag/1.23.0) and use this code: ```swift Atlantis.start(hostName: "<Your host name>", shouldCaptureWebSocketTraffic: false) ``` It will skip the Method Swillzing on the WS/WSS connection, which prevents the unexpected crash on the Intercom package 👍 > Any idea on the root cause? Presumably it's something that Intercom and Atlantis are both doing (with web sockets), but what 🤷 I'm still investigating it, but not found a solution yet. This fix can help you workaround it 👍
Author
Owner

@djbe commented on GitHub (Nov 9, 2023):

Can confirm that with the flag set to false, the crash no longer occurs 🎉

<!-- gh-comment-id:1804040730 --> @djbe commented on GitHub (Nov 9, 2023): Can confirm that with the flag set to `false`, the crash no longer occurs 🎉
Author
Owner

@zocario commented on GitHub (Nov 13, 2023):

Hello @NghiaTranUIT and thanks for the fix 👍 For your information we have the same issue with the iOS SDK of Gleap (https://docs.gleap.io/ios/) and using the flag fixes it, maybe it could help you to locate the root cause.

<!-- gh-comment-id:1808281998 --> @zocario commented on GitHub (Nov 13, 2023): Hello @NghiaTranUIT and thanks for the fix 👍 For your information we have the same issue with the iOS SDK of Gleap (https://docs.gleap.io/ios/) and using the flag fixes it, maybe it could help you to locate the root cause.
Author
Owner

@chaseklingelzen commented on GitHub (Jan 18, 2024):

For what it's worth, we are on Intercom 16.4.0 and that was the reason Atlantis wouldn't work for us. Once we removed Intercom, Atlantis worked great.

<!-- gh-comment-id:1898662872 --> @chaseklingelzen commented on GitHub (Jan 18, 2024): For what it's worth, we are on Intercom 16.4.0 and that was the reason Atlantis wouldn't work for us. Once we removed Intercom, Atlantis worked great.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 18, 2024):

@chadparker if you want to keep the Intercom, you can use v1.23.0, and opt-out the WebSocket interception 👍

<!-- gh-comment-id:1898683384 --> @NghiaTranUIT commented on GitHub (Jan 18, 2024): @chadparker if you want to keep the Intercom, you can use v1.23.0, and opt-out the WebSocket interception 👍
Author
Owner

@chadparker commented on GitHub (Jan 19, 2024):

@chadparker Thank you! I have opted out of websockets for Atlantis and it works. Thanks again!

<!-- gh-comment-id:1900641117 --> @chadparker commented on GitHub (Jan 19, 2024): @chadparker Thank you! I have opted out of websockets for Atlantis and it works. Thanks again!
Author
Owner

@markanderson-underdog commented on GitHub (Feb 22, 2024):

Hey! I'm a new Atlantis user and I'm encountering this same problem, and just found this issue. I can also confirm that adding the shouldCaptureWebSocketTraffic to false fixes the app crash! However, as the name implies, I now cannot see messages from Websocket traffic in Proxyman, which is what I want to use Atlantis for. Is there any other solution planned, or workaround that others have found?

<!-- gh-comment-id:1960365825 --> @markanderson-underdog commented on GitHub (Feb 22, 2024): Hey! I'm a new Atlantis user and I'm encountering this same problem, and just found this issue. I can also confirm that adding the `shouldCaptureWebSocketTraffic` to `false` fixes the app crash! However, as the name implies, I now cannot see messages from Websocket traffic in Proxyman, which is what I want to use Atlantis for. Is there any other solution planned, or workaround that others have found?
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 23, 2024):

@markanderson-underdog unfortunately, there is no workaround atm because I can't reproduce the crash on my side with Atlantis + Intercome.

I suggest disabling the Intercome if possible to see the WS/WSS traffic.

May I ask:

  • What Intercome lib version you're using? and steps to reproduce the crash?
<!-- gh-comment-id:1960645393 --> @NghiaTranUIT commented on GitHub (Feb 23, 2024): @markanderson-underdog unfortunately, there is no workaround atm because I can't reproduce the crash on my side with Atlantis + Intercome. I suggest disabling the Intercome if possible to see the WS/WSS traffic. May I ask: - What Intercome lib version you're using? and steps to reproduce the crash?
Author
Owner

@markanderson-underdog commented on GitHub (Feb 23, 2024):

@NghiaTranUIT awesome! By removing the line of code where we init() the Intercom SDK by calling Intercom.setApiKey(), the app crash no longer occurs and I can view Websocket traffic using Atlantis 🎉

The Intercom version is 1.6.5 (the latest), and we're using SPM for both Intercom and Atlantis.

The STR is as simple as just launching the application, and letting the SDKs initialize. Below is the full variable debugger when the crash in Atlantis. Please let me know if there's anything else I can provide!
Screenshot 2024-02-23 at 9 00 04 AM

<!-- gh-comment-id:1961395305 --> @markanderson-underdog commented on GitHub (Feb 23, 2024): @NghiaTranUIT awesome! By removing the line of code where we `init()` the Intercom SDK by calling `Intercom.setApiKey()`, the app crash no longer occurs and I can view Websocket traffic using Atlantis 🎉 The Intercom version is 1.6.5 (the latest), and we're using SPM for both Intercom and Atlantis. The STR is as simple as just launching the application, and letting the SDKs initialize. Below is the full variable debugger when the crash in Atlantis. Please let me know if there's anything else I can provide! <img width="771" alt="Screenshot 2024-02-23 at 9 00 04 AM" src="https://github.com/ProxymanApp/atlantis/assets/152224715/89a07f77-bc56-47f5-995a-798ac903d1e9">
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#81
No description provided.