[TIMOB-15365] EXC_ARM_DA_ALIGN in KrollContext StringFormatCallback()
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | n/a |
| Reporter | Paul Mietz Egli |
| Assignee | Unknown |
| Created | 2013-09-13T20:26:11.000+0000 |
| Updated | 2018-02-28T20:03:30.000+0000 |
Description
I started running into a memory alignment issue on iOS 7 that wasn't present in 6.1: the code for formatting a string has been throwing EXC_ARM_DA_ALIGN errors. I found [this web page](http://www.splinter.com.au/what-do-do-with-excarmdaalign-on-an-iphone-ap/) which briefly explains the cause and gives a workaround.
I wasn't able to reproduce the bug with a simple test of different String.format() calls, but I was able to fix the problem in the app that was crashing by replacing lines 384-386 in KrollContext.m with the following:
double tmp = TiValueToNumber(jsContext, valueRef, NULL);
memcpy(argList, &tmp, sizeof(tmp));
argList += sizeof(double);
I made a similar change in the boolean arg value at lines 390-392.
No comments