{ "id": "163982", "key": "TIMOB-24040", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-10-17T08:24:05.000+0000", "created": "2016-10-15T07:33:57.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "backgroundimage", "regression" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" }, { "id": "18322", "name": "Release 5.5.1", "archived": false, "released": true, "releaseDate": "2016-09-28" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-10-20T20:40:57.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5.Reproduce\r\n\r\n1. Create a default classic mobile project\r\n2. Put attached two test code in it.\r\n3. Run the app on iOS 10 device or simulator with SDK 5.5.1.GA\r\n4. After the app running, click the open button. second window will open.\r\n5. Click the close button, second window will close.\r\n6. Click the open button again will cause the crash.\r\n\r\nh5.Crash code\r\n{code}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSRangeException'.\r\n[INFO] : SecondWindow opening\r\n[ERROR] : Reason:\r\n[ERROR] : *** -[__NSCFString substringFromIndex:]: Index 179 out of bounds; string length 178\r\n[ERROR] : Stack trace:\r\n[ERROR] : \r\n[ERROR] : 0 CoreFoundation 0x0000000111691333 __exceptionPreprocess + 147\r\n[ERROR] : 1 libobjc.A.dylib 0x0000000110c6021e objc_exception_throw + 48\r\n[ERROR] : 2 CoreFoundation 0x00000001116fa265 +[NSException raise:format:] + 197\r\n[ERROR] : 3 Foundation 0x000000010c2f31ae -[NSString substringFromIndex:] + 126\r\n[ERROR] : 4 AppTest8 0x000000010aad89e7 +[TiUtils loadAppResource:] + 279\r\n[ERROR] : 5 AppTest8 0x000000010ac00cf1 -[LocalProtocolHandler startLoading] + 337\r\n[ERROR] : 6 CFNetwork 0x000000010eb801b2 ___ZN16CFURLProtocol_NS28_protocolInterface_startLoadEPK20_CFCachedURLResponse_block_invoke + 307\r\n[ERROR] : 7 libdispatch.dylib 0x0000000113ca612e _dispatch_client_callout + 8\r\n[ERROR] : 8 libdispatch.dylib 0x0000000113c885b1 _dispatch_block_invoke_direct + 349\r\n[ERROR] : 9 CFNetwork 0x000000010ea4ceac _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 24\r\n[ERROR] : 10 CoreFoundation 0x00000001115e2014 CFArrayApplyFunction + 68\r\n[ERROR] : 11 CFNetwork 0x000000010ea4cda5 _ZN19RunloopBlockContext7performEv + 137\r\n[ERROR] : 12 CFNetwork 0x000000010ea4cc3e _ZN17MultiplexerSource7performEv + 282\r\n[ERROR] : 13 CFNetwork 0x000000010ea4ca60 _ZN17MultiplexerSource8_performEPv + 72\r\n[ERROR] : 14 CoreFoundation 0x0000000111636311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17\r\n[ERROR] : 15 CoreFoundation 0x000000011161b59c __CFRunLoopDoSources0 + 556\r\n[ERROR] : 16 CoreFoundation 0x000000011161aa86 __CFRunLoopRun + 918\r\n[ERROR] : 17 CoreFoundation 0x000000011161a494 CFRunLoopRunSpecific + 420\r\n[ERROR] : 18 CFNetwork 0x000000010eced082 _ZL27_privateRunloopEmulationSetPv + 258\r\n[ERROR] : 19 libsystem_pthread.dylib 0x000000011404c99d _pthread_body + 131\r\n[ERROR] : 20 libsystem_pthread.dylib 0x000000011404c91a _pthread_body + 0\r\n[ERROR] : 21 libsystem_pthread.dylib 0x000000011404a351 thread_start + 13\r\n[ERROR] : \r\n[ERROR] : 2016-10-15 15:32:36.719 AppTest8[36595:139152] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFString substringFromIndex:]: Index 179 out of bounds; string length 178'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (\r\n[ERROR] : \t0 CoreFoundation 0x000000011169134b __exceptionPreprocess + 171\r\n[ERROR] : \t1 libobjc.A.dylib 0x0000000110c6021e objc_exception_throw + 48\r\n[ERROR] : \t2 CoreFoundation 0x00000001116fa265 +[NSException raise:format:] + 197\r\n[ERROR] : \t3 Foundation 0x000000010c2f31ae -[NSString substringFromIndex:] + 126\r\n[ERROR] : \t4 AppTest8 0x000000010aad89e7 +[TiUtils loadAppResource:] + 279\r\n[ERROR] : \t5 AppTest8 0x000000010ac00cf1 -[LocalProtocolHandler startLoading] + 337\r\n[ERROR] : \t6 CFNetwork 0x000000010eb801b2 ___ZN16CFURLProtocol_NS28_protocolInterface_startLoadEPK20_CFCachedURLResponse_block_invoke + 307\r\n[ERROR] : \t7 libdispatch.dylib 0x0000000113ca612e _dispatch_client_callout + 8\r\n[ERROR] : \t8 libdispatch.dylib 0x0000000113c885b1 _dispatch_block_invoke_direct + 349\r\n[ERROR] : \t9 CFNetwork 0x000000010ea4ceac _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 24\r\n[ERROR] : \t10 CoreFoundation 0x00000001115e2014 CFArrayApplyFunction + 68\r\n[ERROR] : \t11 CFNetwork 0x000000010ea4cda5 _ZN19RunloopBlockContext7performEv + 137\r\n[ERROR] : \t12 CFNetwork 0x000000010ea4cc3e _ZN17MultiplexerSource7performEv + 282\r\n[ERROR] : \t13 CFNetwork 0x000000010ea4ca60 _ZN17MultiplexerSource8_performEPv + 72\r\n[ERROR] : \t14 CoreFoundation 0x0000000111636311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17\r\n[ERROR] : \t15 CoreFoundation 0x000000011161b59c __CFRunLoopDoSources0 + 556\r\n[ERROR] : \t16 CoreFoundation 0x000000011161aa86 __CFRunLoopRun + 918\r\n[ERROR] : \t17 CoreFoundation 0x000000011161a494 CFRunLoopRunSpecific + 420\r\n[ERROR] : \t18 CFNetwork 0x000000010eced082 _ZL27_privateRunloopEmulationSetPv + 258\r\n[ERROR] : \t19 libsystem_pthread.dylib 0x000000011404c99d _pthread_body + 131\r\n[ERROR] : \t20 libsystem_pthread.dylib 0x000000011404c91a _pthread_body + 0\r\n[ERROR] : \t21 libsystem_pthread.dylib 0x000000011404a351 thread_start + 13\r\n[ERROR] : )\r\n[ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException\r\n{code}\r\n\r\nh5.Note\r\n1. Same code is working well on TISDK 5.2.2.GA\r\n2. If you comment out line 20 of ApplicationWindow.js (like following), it will working well on SDK 5.5.0 and 5.5.1.GA\r\n{code}\r\n//backgroundImage : ' ',\r\n{code}\r\n3. If there is webview in second page, it will not crash at all.\r\n ", "attachment": [ { "id": "60529", "filename": "app.js", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2016-10-15T07:33:55.000+0000", "size": 644, "mimeType": "text/javascript" }, { "id": "60530", "filename": "ApplicationWindow.js", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2016-10-15T07:33:55.000+0000", "size": 22438, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS: Set backgroundImage : \"'' for TI.UI.VIEW cause app crash After SDK 5.5.0.GA", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "SDK 5.5.0.GA and 5.5.1.GA\r\niOS 10\r\nXcode 8", "closedSprints": [ { "id": 733, "state": "closed", "name": "2016 Sprint 21 SDK", "startDate": "2016-10-08T00:53:00.000Z", "endDate": "2016-10-22T00:53:00.000Z", "completeDate": "2016-10-24T03:58:08.547Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "399039", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, here is the thing: We fixed unbalanced {{backgroundImage}} calls in {{Ti.UI.View}} in recent Titanium releases by using an internal utility method. And because providing an empty string (rather than an image or {{null}}), the empty string has been handled as an url and caused the crash by searching for the image cash in the second call to that path. With this PR, we check for empty strings manually and prevent it from being cached then (just return nil). \r\n\r\nAnyway, if the customer wants a fix for their current SDK, they can just replace the {{\"\"}} with {{null}} or just leave out the property if they don't set it. Even when they set it later, it is not required to set it with empty values before, our SDK will know how to handle it.\r\n\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/8517\r\nPR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8518 ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-15T11:04:55.000+0000", "updated": "2016-10-15T11:04:55.000+0000" }, { "id": "399076", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "APPROVED", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-17T08:23:55.000+0000", "updated": "2016-10-17T08:23:55.000+0000" }, { "id": "399526", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The bug appears to be resolved. I tested it with this environment:\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.11.6\r\nAppc CLI: 5.5.1\r\nAppc CLI NPM: 4.2.7\r\nTitanium SDK version: 6.0.0.v20161019091022\r\nAppcelerator Studio, build: 4.8.0.201610171310\r\nXcode 8.0 GM\r\n\r\nFirstly, I reproduced the bug using the sample scripts in the description with SDK 5.5.1. I then tested with SDK 6.0.0. I followed the steps; I clicked on \"open\", then \"close\" in the second window, and then \"open\" again. The app did not crash, and instead went back to the second window. I tried this on the simulator and on an iOS 10 device. ", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-20T20:40:37.000+0000", "updated": "2016-10-20T20:40:37.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }