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

Atlantis crashes on Simulator iPhone 15 Pro Max (17.0) #142

Open
DarkSatyr opened this issue Feb 28, 2024 · 8 comments
Open

Atlantis crashes on Simulator iPhone 15 Pro Max (17.0) #142

DarkSatyr opened this issue Feb 28, 2024 · 8 comments

Comments

@DarkSatyr
Copy link

Xcode 15.2

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes: 0x0000000000000001, 0x0000000000000008
VM Region Info: 0x8 is not in any region. Bytes before following region: 4370874360
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 104864000-10487c000 [ 96K] r-x/r-x SM=COW ... App DEV
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [69420]

Thread 3 Crashed:: Dispatch queue: com.apple.NSURLSession-delegate
0 libobjc.A.dylib 0x18005aad0 objc_object::sidetable_clearDeallocating() + 128
1 Atlantis 0x108690454 thunk for @escaping @callee_guaranteed (@guaranteed NSObject?, @guaranteed NSError?) -> () + 80
2 libdispatch.dylib 0x10a2e40f0 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x10a2e593c _dispatch_client_callout + 16
4 libdispatch.dylib 0x10a2edbd8 _dispatch_lane_serial_drain + 916
5 libdispatch.dylib 0x10a2ee91c _dispatch_lane_invoke + 420
6 libdispatch.dylib 0x10a2fb2f8 _dispatch_root_queue_drain_deferred_wlh + 324
7 libdispatch.dylib 0x10a2fa754 _dispatch_workloop_worker_thread + 488
8 libsystem_pthread.dylib 0x1092b3924 _pthread_wqthread + 284
9 libsystem_pthread.dylib 0x1092b26e4 start_wqthread + 8

@NghiaTranUIT
Copy link
Member

when it's crashing:

  1. Please click on the current thread from Xcode
  2. It will show the crashed line in Atlantis
  3. Please share it with me

I'd like to investigate it

@DarkSatyr
Copy link
Author

@NghiaTranUIT here you go (AtlantisHelper::swizzleWebSocketReceiveMessage(
withCompleteHandler handler: AnyObject,
responseHandler: ((String?, Data?, Error?) -> Void)?)
Uploading Screenshot 2024-03-04 at 16.16.03.png…

@DarkSatyr
Copy link
Author

Screenshot 2024-03-04 at 16 16 03

@NghiaTranUIT
Copy link
Member

@DarkSatyr I suggest updating Atlantis to the latest version:

Use this code to ignore the Websocket:

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

May I ask if you're using Intercom library 🤔 ?

Ref: #134 (comment)

@DarkSatyr
Copy link
Author

@NghiaTranUIT
I'm using 1 week old Atlantis version, and yes Intercom lib is 1 of my dependencies
Actually, about web sockets, this was my main intention to use Atlantis framework to log web socket events because Proxyman don't capture those events (we use Kotlin multiplatform lib for api with Ktor for web sockets and REST). If it's possible to intercept such events than I can use only Proxyman app

@NghiaTranUIT
Copy link
Member

we use Kotlin multiplatform lib for api with Ktor for web sockets and REST

It means Atlantis can't capture REST traffic because it's not from URLSession, which is Apple's network lib.
You should follow this doc: https://ktor.io/docs/proxy.html to config HTTP Proxy to ktor lib.
IP = localhost
Port = 9090

Then, Proxyman can capture its traffic 👍

@DarkSatyr
Copy link
Author

@NghiaTranUIT actually it captures REST from Ktor (with localhost:9090) but it doesn't capture web sockets inside kmp lib from ktor

@NghiaTranUIT
Copy link
Member

@DarkSatyr it's understandable because Atlantis framework only captures WS/WSS, which is called from URLWebsocketSessionTask (again, it's from Apple framework). I suppose that Ktor uses a different lib, so Proxyman can't.


May I ask: What engine do you use from Ktor (https://ktor.io/docs/proxy.html)? I suppose that we can override SOCKS Proxy on Ktor, to point to Proxyman SOCKS (In Tool menu -> Proxy Setting -> SOCKS Proxy). Websocket often uses SOCKS Proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants