Steps to reproduce
* Create a new app
* run the attached app.js
* app crashes 50% of the times
Logs when crashing:
[DEBUG] Application booted in 557.617009 ms
[INFO] read() begin
[INFO] read() bytes processed begin 1
[INFO] read() bytes processed begin 2
[INFO] read() Timeout
[INFO] read() try 1 start
[INFO] read() try 1 results: [14428770873129952]
[INFO] read() Socket Close Begin: {"mode":3,"port":80,"timeout":310000}
[INFO] read() Socket State : 2
[INFO] read() Socket Try
Log when app does not crash:
[DEBUG] Application booted in 703.873992 ms
[INFO] read() begin
[INFO] read() bytes processed begin 1
[INFO] read() bytes processed begin 2
[INFO] read() Timeout
[INFO] read() try 1 start
[INFO] read() try 1 results: [14428770763385046]
[INFO] read() Socket Close Begin: {"mode":3,"port":80,"timeout":310000}
[INFO] read() Socket State : 2
[INFO] read() Socket Try
[INFO] read() Socket Close End
[INFO] Success!
Notes
I ran this on an iPod touch 5th gen with iOS9 and with Trace enabled (from cli)
How about compiled with SDK 5.0.0 and installed onto a iOS 8.X device? Or compiled with 4.1.1 and installed onto an iOS 9 device?
[~ingo] Tested with: - iOS 8.0.2 - SDK 5.0.0.GA App does not crash Tested with: - iOS 8.0.2 - SDK 4.1.1.GA App does not crash Tested with: - iOS 9.0 - SDK 4.1.1.GA CRASH!!
We have several apps (with 1mio+ downloads) compiled with SDK 3.x that are live on the AppStore. All apps have implemented Pubnub.js and crash after upgrading the device to iOS 9.
Hi, May I suggest to use 5.0.0.GA on iOS9. I just tried the attached app and it works fine with this configuration. Please note that we upgraded sdk to 5.0.0 to support iOS9, so we can't guarantee that older sdks can work with iOS9.
Did you try with SDK 5.0.0.GA on a real device with iOS 9? It will crash. Somehow it does work on the Simulator but not on a real device.
Hello. We also discovered the same problem with iOS 9 devices (simulator is not affected). The application crashes due to
socket.close()
call. I can provide our test app if necessary. This crash caused byENSURE_SOCKET_THREAD(close,_void);
macro call. There is a pull request https://github.com/appcelerator/titanium_mobile/pull/7225 with a fix.[~crossbits] you mind trying the fix in the above pull request? You can create a [custom SDK | http://docs.appcelerator.com/platform/latest/#!/guide/Building_the_Titanium_SDK_From_Source] and test
The pull request looks really good, thanks a lot. I compiled a demo app with a custom SDK based on 5.0.0.GA and the mentioned fix. Tested it on a real device with iOS 9.0.1 and real device with iOS 8.4.1. Pubnub service with TCP socket works on both devices, no crash any more! Also tested successfully on iPhone simulator with iOS 9.0 and iOS 8.4
Thanks for the PR! Here's one for the Master with the same fix: https://github.com/appcelerator/titanium_mobile/pull/7232
@Roman: really appreciate your PR, lifesaver! Have submitted an app update with your fix and got approved by Apple within half a day (due to Expedited Review).
The app does not crash upon several attempts. Verified on: Mac OS 10.10.5 Ti SDK: 5.0.2.v20150929180754, 5.1.0.v20150929231927 Appc Studio: 4.3.1.201509222258 Appc CLI core: 5.0.3-11 iPhone 6 (v9.0)