Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27515] iOS: Crash w/ Ti.Filesystem.openStream when deploy-type is test

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-11-06T18:20:25.000+0000
Affected Version/sRelease 8.3.0
Fix Version/sRelease 8.3.0
ComponentsiOS
LabelsengSchedule
ReporterChristopher Williams
AssigneeChristopher Williams
Created2019-10-31T17:54:41.000+0000
Updated2019-11-06T18:20:25.000+0000

Description

On master branch, running the unit test suite locally causes a crash of the app for me. Specifically, the deploy-type being set to test seems to be the trigger here. The Titanium.FileSystem.openStream test crashes with the output:
[INFO]  !TEST_START: openStream()
[ERROR] Script Error {
[ERROR]     column = 32;
[ERROR]     line = 104;
[ERROR]     message = "The iOS reported an error";
[ERROR]     nativeStack = (
[ERROR]         0   CoreFoundation                      0x00007fff23b98bde __exceptionPreprocess + 350
[ERROR]         1   libobjc.A.dylib                     0x00007fff503b5b20 objc_exception_throw + 48
[ERROR]         2   TitaniumKit                         0x000000010357c63d JavascriptNameForClass + 0
[ERROR]         3   TitaniumKit                         0x0000000103587ee5 -[TiFilesystemFileStreamProxy _initWithPageContext:args:] + 845
[ERROR]         4   mocha                               0x000000010299dea8 -[FilesystemModule openStream:] + 968
[ERROR]         5   CoreFoundation                      0x00007fff23b9f95c __invoking___ + 140
[ERROR]         6   CoreFoundation                      0x00007fff23b9cd8f -[NSInvocation invoke] + 287
[ERROR]         7   JavaScriptCore                      0x00007fff269674bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411
[ERROR]         8   JavaScriptCore                      0x00007fff26966f04 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 244
[ERROR]         9   JavaScriptCore                      0x00007fff2696682f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_9ExecStateE + 511
[ERROR]         10  ???                                 0x000031c4d2801027 0x0 + 54721414959143
[ERROR]         11  JavaScriptCore                      0x00007fff2693caa3 llint_entry + 93226
[ERROR]         12  ???                                 0x000031c4d28a6586 0x0 + 54721415636358
[ERROR]         13  ???                                 0x000031c4d28e20b6 0x0 + 54721415880886
[ERROR]         14  ???                                 0x000031c4d28db616 0x0 + 54721415853590
[ERROR]         15  ???                                 0x000031c4d287c8ad 0x0 + 54721415465133
[ERROR]         16  ???                                 0x000031c4d28db91c 0x0 + 54721415854364
[ERROR]         17  ???                                 0x000031c4d28b3aa0 0x0 + 54721415690912
[ERROR]         18  ???                                 0x000031c4d28b267c 0x0 + 54721415685756
[ERROR]         19  JavaScriptCore                      0x00007fff26925ccf vmEntryToJavaScript + 200
[ERROR]         20  JavaScriptCore                      0x00007fff26d361a0 _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 416
[ERROR]         21  JavaScriptCore                      0x00007fff26f82e24 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 196
[ERROR]         22  JavaScriptCore                      0x00007fff26983328 JSObjectCallAsFunction + 488
[ERROR]         23  JavaScriptCore                      0x00007fff26950d1c -[JSValue callWithArguments:] + 252
[ERROR]         24  Foundation                          0x00007fff2568cd5b __NSFireTimer + 72
[ERROR]         25  CoreFoundation                      0x00007fff23afc1e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
[ERROR]         26  CoreFoundation                      0x00007fff23afbed2 __CFRunLoopDoTimer + 1026
[ERROR]         27  CoreFoundation                      0x00007fff23afb52a __CFRunLoopDoTimers + 266
[ERROR]         28  CoreFoundation                      0x00007fff23af629e __CFRunLoopRun + 2238
[ERROR]         29  CoreFoundation                      0x00007fff23af56b6 CFRunLoopRunSpecific + 438
[ERROR]         30  GraphicsServices                    0x00007fff3815cbb0 GSEventRunModal + 65
[ERROR]         31  UIKitCore                           0x00007fff47162a67 UIApplicationMain + 1621
[ERROR]         32  mocha                               0x00000001028ae12c main + 1212
[ERROR]         33  libdyld.dylib                       0x00007fff5123bcf5 start + 1
[ERROR] );
[ERROR]     sourceURL = "file:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti.filesystem.test.js";
[ERROR]     stack = "[native code]\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti.filesystem.test.js:104:32\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:54386\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:58826\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:59671\nnext@file:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:58234\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:58198\nnext@file:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:57886\nfile:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:6535:57982\ntimeslice@file:///Users/cwilliams/Library/Developer/CoreSimulator/Devices/7279613C-5A28-4766-93FC-4752B305BDB3/data/Containers/Bundle/Application/30693FD6-C1D5-49D1-9735-F0C36204FF92/mocha.app/ti-mocha.js:5764:23";
[ERROR] } 
[ERROR] Application received error: /ti.filesystem.test.js:104
[ERROR] stream=Ti.Filesystem.openStream(Ti.Filesystem.MODE_READ,"app.js"),
[ERROR]                                 ^
[ERROR] The iOS reported an error
[ERROR] [native code]
[ERROR] /ti.filesystem.test.js:104:32
[ERROR] /ti-mocha.js:6535:54386
[ERROR] /ti-mocha.js:6535:58826
[ERROR] /ti-mocha.js:6535:59671
[ERROR] next@/ti-mocha.js:6535:58234
[ERROR] /ti-mocha.js:6535:58198
[ERROR] next@/ti-mocha.js:6535:57886
[ERROR] /ti-mocha.js:6535:57982
[ERROR] timeslice@/ti-mocha.js:5764:23
[ERROR]   
[ERROR] libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
[ERROR] TitaniumKit 0x000000010357c63d JavascriptNameForClass + 0
[ERROR] TitaniumKit 0x0000000103587ee5 -[TiFilesystemFileStreamProxy _initWithPageContext:args:] + 845
[ERROR] mocha 0x000000010299dea8 -[FilesystemModule openStream:] + 968
[ERROR] CoreFoundation 0x00007fff23b9f95c __invoking___ + 140
[ERROR] CoreFoundation 0x00007fff23b9cd8f -[NSInvocation invoke] + 287
[ERROR] JavaScriptCore 0x00007fff269674bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411
[ERROR] JavaScriptCore 0x00007fff26966f04 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 244
[ERROR] JavaScriptCore 0x00007fff2696682f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_9ExecStateE + 511
[ERROR] ??? 0x000031c4d2801027 0x0 + 54721414959143
[ERROR] JavaScriptCore 0x00007fff2693caa3 llint_entry + 93226
[ERROR] ??? 0x000031c4d28a6586 0x0 + 54721415636358
[ERROR] ??? 0x000031c4d28e20b6 0x0 + 54721415880886
[ERROR] ??? 0x000031c4d28db616 0x0 + 54721415853590
[ERROR] ??? 0x000031c4d287c8ad 0x0 + 54721415465133
[ERROR] ??? 0x000031c4d28db91c 0x0 + 54721415854364
[ERROR] ??? 0x000031c4d28b3aa0 0x0 + 54721415690912
[ERROR] ??? 0x000031c4d28b267c 0x0 + 54721415685756
[ERROR] JavaScriptCore 0x00007fff26925ccf vmEntryToJavaScript + 200
[DEBUG] Firing app event: uncaughtException
[DEBUG] Firing app event: uncaughtException
[DEBUG] *** Terminating app due to uncaught exception 'org.appcelerator.TiFilesystemFileStreamProxy', reason: 'The iOS reported an error'
[DEBUG] *** First throw call stack:
[DEBUG] ( 
[DEBUG]         0   CoreFoundation                      0x00007fff23b98bde __exceptionPreprocess + 350
[DEBUG]         1   libobjc.A.dylib                     0x00007fff503b5b20 objc_exception_throw + 48
[DEBUG]         2   TitaniumKit                         0x000000010357c63d JavascriptNameForClass + 0
[DEBUG]         3   TitaniumKit                         0x0000000103587ee5 -[TiFilesystemFileStreamProxy _initWithPageContext:args:] + 845
[DEBUG]         4   mocha                               0x000000010299dea8 -[FilesystemModule openStream:] + 968
[DEBUG]         5   CoreFoundation                      0x00007fff23b9f95c __invoking___ + 140
[DEBUG]         6   CoreFoundation                      0x00007fff23b9cd8f -[NSInvocation invoke] + 287
[DEBUG]         7   JavaScriptCore                      0x00007fff269674bb _ZN3JSC24ObjCCallbackFunctionImpl4callEP9JSContextP13OpaqueJSValuemPKPKS3_PS6_ + 411
[DEBUG]         8   JavaScriptCore                      0x00007fff26966f04 _ZN3JSCL34objCCallbackFunctionCallAsFunctionEPK15OpaqueJSContextP13OpaqueJSValueS4_mPKPKS3_PS6_ + 244
[DEBUG]         9   JavaScriptCore                      0x00007fff2696682f _ZN3JSC19APICallbackFunction4callINS_20ObjCCallbackFunctionEEExPNS_9ExecStateE + 511
[DEBUG]         10  ???                                 0x000031c4d2801027 0x0 + 54721414959143
[DEBUG]         11  JavaScriptCore                      0x00007fff2693caa3 llint_entry + 93226
[DEBUG]         12  ???                                 0x000031c4d28a6586 0x0 + 54721415636358
[DEBUG]         13  ???                                 0x000031c4d28e20b6 0x0 + 54721415880886
[DEBUG]         14  ???                                 0x000031c4d28db616 0x0 + 54721415853590
[DEBUG]         15  ???                                 0x000031c4d287c8ad 0x0 + 54721415465133
[DEBUG]         16  ???                                 0x000031c4d28db91c 0x0 + 54721415854364
[DEBUG]         17  ???                                 0x000031c4d28b3aa0 0x0 + 54721415690912
[DEBUG]         18  ???                                 0x000031c4d28b267c 0x0 + 54721415685756
[DEBUG]         19  JavaScriptCore                      0x00007fff26925ccf vmEntryToJavaScript + 200
[DEBUG]         20  JavaScriptCore                      0x00007fff26d361a0 _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 416
[DEBUG]         21  JavaScriptCore                      0x00007fff26f82e24 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 196
[DEBUG]         22  JavaScriptCore                      0x00007fff26983328 JSObjectCallAsFunction + 488
[DEBUG]         23  JavaScriptCore                      0x00007fff26950d1c -[JSValue callWithArguments:] + 252
[DEBUG]         24  Foundation                          0x00007fff2568cd5b __NSFireTimer + 72
[DEBUG]         25  CoreFoundation                      0x00007fff23afc1e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
[DEBUG]         26  CoreFoundation                      0x00007fff23afbed2 __CFRunLoopDoTimer + 1026
[DEBUG]         27  CoreFoundation                      0x00007fff23afb52a __CFRunLoopDoTimers + 266
[DEBUG]         28  CoreFoundation                      0x00007fff23af629e __CFRunLoopRun + 2238
[DEBUG]         29  CoreFoundation                      0x00007fff23af56b6 CFRunLoopRunSpecific + 438
[DEBUG]         30  GraphicsServices                    0x00007fff3815cbb0 GSEventRunModal + 65
[DEBUG]         31  UIKitCore                           0x00007fff47162a67 UIApplicationMain + 1621
[DEBUG]         32  mocha                               0x00000001028ae12c main + 1212
[DEBUG]         33  libdyld.dylib                       0x00007fff5123bcf5 start + 1
[DEBUG] ) 
[DEBUG] libc++abi.dylib: terminating with uncaught exception of type NSException

Comments

  1. Christopher Williams 2019-10-31

    To reproduce, I'm simply running npm run test:ios on master branch of the SDK. Note that this also happens on 8_2_X now too (when running against the master branch of the test suite). This looks to be a recent thing caused by this change: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/200
  2. Christopher Williams 2019-10-31

    https://github.com/sgtcoolguy/titanium_mobile/pull/new/TIMOB-27515
  3. Christopher Williams 2019-11-05

    I think this is ready for QE test (though the unit tests triggered and showed the crash/failures, so they already did the FR!) Note there's an outstanding issue around uncaught exceptions on iOS in async callbacks/event listeners/timers that I mentioned in the PR that is unresolved. I think it deserves a separate ticket to investigate post 8.3.0.
  4. Lokesh Choudhary 2019-11-05

    FR Passed. PR Merged.
  5. Lokesh Choudhary 2019-11-06

    Verified the fix with SDK 8.3.0.v20191106075119. Closing.

JSON Source