[TIMOB-24139] iOS: App is crashed if it contain Button with backgroundImage property (regression)
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-11-11T14:21:50.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.0.0 |
Components | iOS |
Labels | regression |
Reporter | Quang Pham |
Assignee | Hans Knöchel |
Created | 2016-11-11T08:58:33.000+0000 |
Updated | 2016-11-11T19:19:21.000+0000 |
Description
Steps to reproduce:
1. Click Show window button
2. Click Back button
3. Click Show window button again
=> window is crashed.
Remove the backgroundImage property of button, App is not crashed anymore.
SDK: 6 RC 6.0.0.v20161101155110
IOS simulator + device iPhone 5C
OSX 10.11.6
Attachments
File | Date | Size |
close3.png | 2016-11-11T14:12:32.000+0000 | 5673 |
test.zip | 2016-11-11T08:54:52.000+0000 | 10480672 |
[~ptquang86] Thanks for the report! *This is a regression from 5.5.1.GA* I can reproduce this using OS: Mac OS X 10.11.6 Appc core: 6.0.0-69 Appc NPM: 4.2.8-9 Ti SDK: 6.0.0.v20161110183702 Xcode: 8.1 iOS 10.1 simulator
Test-case:
The crash is reproducible when you open the window for the second time and the reason seems to be that the image cache has an invalid memory address during the second access. We had a similar issue in TIMOB-24040, but it was regarding empty background images. I need to dive into the recent changes between 5.5.x and 6.0.0 to see what happened. Thx for reporting! *EDIT*: The issue was caused by [this commit](https://github.com/appcelerator/titanium_mobile/commit/7ee97f46b21ab05434d3c588e1ae24450a6eb5f0), investigating ...
PR (master): https://github.com/appcelerator/titanium_mobile/pull/8598 PR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8599 The issue was that when we replaced the method to get the image, we didn't retain the resulting value as before. This PR fixes that!
CR and FT Passed! APPROVED!
Verified fix using this environment: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.12.1 Appc CLI: 6.0.0-69 Appc CLI NPM: 4.2.8-9 Titanium SDK version: 6.0.0. v20161111062138 Appcelerator Studio, build: 4.8.0.201611020954 Xcode 8.1 GM Device: iPhone 7 iOS 10.0.1 Simulator: iOS 10.1 Simulator An app was installed using Han's demo code. With an earlier build, Ti SDK 6.0.0.v20161031201605, I clicked on the "Show Window" button, then clicked "Back", then clicked "Show Window" a second time. At that point, the app crashed. When I tried the same steps with the latest Ti SDK 6.0.0. v20161111062138, the app did not crash. This fix was validated on both Simulator and Device.