[TIMOB-17375] Android: Parsing invalid json hangs the app and crashes debugger
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 5.1.1 |
Fix Version/s | Release 3.3.1 |
Components | Android |
Labels | android, core, defect |
Reporter | Szymon Tomasz Stefanek |
Assignee | Ashraf Abu |
Created | 2014-06-14T19:40:15.000+0000 |
Updated | 2016-06-30T04:34:26.000+0000 |
Description
In debug mode, calling JSON.parse() on a piece of invalid json hangs the application and silently terminates the debugging session.
A sample code snippet is as simple as:
try {
var j = JSON.parse("{");
}
catch(e)
{
Ti.API.info("Exception");
}
No code seems to be executed after the JSON.parse() call. The debugger marks the application as terminated without reporting any error and the app on the device hangs (but does not crash).
In Release mode an exception is properly reported and execution of the app continues as expected.
Possibly related to TC-4212
The original reporter of this: [~s.stefanek]. Thanks for your report!
Ah... why I'm no longer the reporter of this issue? :D
Hello [~s.stefanek]! Sorry for the hiccup! Our system does that on ALLOY and STUDIO bugs (when moving bugs from TC). [~pinnamuri] can help us and set you as the reporter :D
I can still reproduce this issue *only with Android* and on current GA stack. *Tested on:* Appcelerator Studio, build: 4.4.0.201511241829 Appc CLI NPM: 4.2.2 Appc CLI Core: 5.1.0 Arrow: 1.3.22 SDK: 5.1.1.GA Node: v4.2.2 OS: El Capitan (10.11.1) Device: Genymotion Emulator (4.4.4) *To reproduce:*
Copy above code snippet into Alloy's index.js file e.g.:
Debug your app to an emulator; *do not set any breakpoints*