[TIMOB-26857] iOS: Crash when parsing JSON from Ti.Filesystem.File.getFile()
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 8.0.0, Release 8.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | engSchedule |
Reporter | Hans Knöchel |
Assignee | Abir Mukherjee |
Created | 2019-02-25T08:38:07.000+0000 |
Updated | 2020-12-04T19:50:15.000+0000 |
Description
We had one (always reproducible) crash that occurs everything we open a certain window. Recently we integrated Crashlytics into our Titanium app and now are finally able to catch that exception (attached). It seems like the core has an issue converting some numbers correctly:
0 JavaScriptCore
WTFCrashWithInfo(int, char const*, char const*, int, unsigned long long, unsigned long long, unsigned long long) + 12
1 JavaScriptCore
JSC::JSObject::toPrimitive(JSC::ExecState*, JSC::PreferredPrimitiveType) const + 4016
This can be reproduced using our app (steps as discussed).
Note: This is *no* duplicate of TIMOB-26852.
Attachments
File | Date | Size |
---|---|---|
crash.rtf | 2019-02-25T09:47:03.000+0000 | 4034 |
currencies.json | 2019-02-25T16:17:34.000+0000 | 27017 |
Apparently the crash was caused by JSON parsing when repeatedly calling the following code:
Can be easily avoided by switching to
require('/currencies.json');
. However we should still check why the first version crashes after repeated calls.@Hans Knöchel How were you able to integrate crashlytics in titanium? I tried https://github.com/hansemannn/titanium-crashlytics and few other resources but didnt get any luck
You can add '.text' to solve your problem JSON.parse(Ti.Filesystem.getFile('/currencies.json').read().text);