[TIMOB-991] Crash on startup in iPhone OS 4.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.4.0 |
Components | iOS |
Labels | ios, iphone, mobile |
Reporter | Blain Hamon |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:40:53.000+0000 |
Updated | 2011-04-17T01:54:54.000+0000 |
Description
When running any Titanium 0.9+ app in 4.0, the app crashes on start. Jeff and I tracked it down to inside TiJSCore, namely calling vm_map returns a mapped area in 3.x, but returns 4 (Invalid parameters) with address 0. TiJSCore next tries to dereference the 0 address, crashing.
In some situations, building for 4.0 works but then it crashes on 3.x. We may need to compare the arguments generated in each case, and dynamically try (Or try multiple times) to get the memory to stop the crasher.
Attachments
File | Date | Size |
---|---|---|
archive.zip | 2011-04-15T02:40:56.000+0000 | 11950081 |
The plot thickens. Why does this one project have vm_map fail and succeed in the same run? (Built in b2)
Words fail me. When building for 4.0b4 or 3.2, running on a 3.1.3 device:
foo(NULL); will succeed. {vm_address_t resultaddress = 0; foo(&resultaddress);} will fail.
You read that right. A nonzero value in an unused variable will cause an error in a called function. I spent several minutes saying, "What?!"
For 3.2 or 4.0b4 on a 4.0b4 device, the unused variable has no effect, as what should happen.
This does not explain why there is a failure for 4.0 against the old 3.1-era TiJSCore code, but we at least have a workaround, and we can safely build tiJSCore with 3.2 as the base SDK, and it should be backwards and forwards compatible.
Fix implemented in TiJSCore.