becvert / cordova-plugin-websocket-server

Cordova WebSocket Server Plugin
MIT License
84 stars 35 forks source link

[iOS] PSWebSocketServer SIGTRAP exception #50

Closed asa47 closed 5 years ago

asa47 commented 6 years ago

Hello,

I am receiving some crash logs, and I would like to investigate the issues. The following is the crash summary:

LOCATION: PSWebSocketServer.m line 770 in [PSWebSocketServer dealloc] EXCEPTION: SIGTRAP

The PSWebSocketServer.m file is not present in the project, so I am struggling to identify the cause of the error. I am assuming that the file is generated during compilation from the WebSocketServer.swift.

Any advice? Kind Regards

becvert commented 6 years ago

Hello, I just made my fork of PocketSocket public. You'll find what you want there. I build libPocketSocket.a from that. Good luck. Regards

asa47 commented 6 years ago

Thanks for the reply.

One more question, how can I generate the libPocketSocket.a from the project? Do I need a script in the Build Phase, or can it be done automatically by Xcode?

Kind Regards

becvert commented 6 years ago

I just run build-pocket-socket.sh in a shell.

asa47 commented 6 years ago

Thanks, I have been able to narrow down the cause of the issue, even thought I am still not completely sure on how to solve it.

I can replicate the exception by closing the app.

Basically if the app-server is connected to one or more client devices, and we close the app (by swiping up); it triggers the SIGTRAP exception in the background, which can be located at line 770 in the PSWebSocketServer.m:

- (void)dealloc { [self executeWorkAndWait:^{ [self disconnect:YES]; }]; } }

It does not seem to be a "serious" issue, but please let me know and is it advisable to comment the [self disconnect:YES]; line? Or shall I leave it?

Kind Regards

becvert commented 6 years ago

Honestly I don't know what's best. It's just in the logs, isn't it? the user does not see the app crash? Maybe you could ask zwopple/PocketSocket/issues

becvert commented 5 years ago

Closing old issue. Feel free to reopen.