Skip to content

[iOS] [ParparVM] Crash / Uncaught Signal during optDouble in JSONObject on iOS [bug] #5531

Description

@DurankGts

Summary

Description:
Calling JSONObject.optDouble(String key, double defaultValue) causes a silent thread abort/native crash (EXC_BAD_ACCESS / SIGSEGV) on iOS when compiled with ParparVM, whereas it works as expected on the Simulator and Android.

Minimal reproducer

Description:
Calling JSONObject.optDouble(String key, double defaultValue) causes a silent thread abort/native crash (EXC_BAD_ACCESS / SIGSEGV) on iOS when compiled with ParparVM, whereas it works as expected on the Simulator and Android.

Steps to Reproduce:
Parse a JSON string into a JSONObject on iOS.

Call optDouble on a nested or root JSONObject passing a primitive or fallback double value, for example:

Java
JSONObject loc = geom.optJSONObject("location");
if (loc != null) {
// Code halts abruptly at this line on iOS
double lat = loc.optDouble("lat", -999.0);
}
Observe that execution stops immediately on that line without throwing a Java Throwable or reaching subsequent logging statements.

Steps to reproduce

Description:
Calling JSONObject.optDouble(String key, double defaultValue) causes a silent thread abort/native crash (EXC_BAD_ACCESS / SIGSEGV) on iOS when compiled with ParparVM, whereas it works as expected on the Simulator and Android.

Steps to Reproduce:
Parse a JSON string into a JSONObject on iOS.

Call optDouble on a nested or root JSONObject passing a primitive or fallback double value, for example:

Java
JSONObject loc = geom.optJSONObject("location");
if (loc != null) {
// Code halts abruptly at this line on iOS
double lat = loc.optDouble("lat", -999.0);
}
Observe that execution stops immediately on that line without throwing a Java Throwable or reaching subsequent logging statements.

Expected and observed behavior

Expected Behavior:
optDouble should return either the double value associated with the key or the fallback defaultValue provided, without crashing the execution thread on iOS.
Actual Behavior:
On iOS native builds, the call fails silently at the C/Objective-C transpilation level during unboxing/casting of the return value. Java try-catch (Throwable) blocks fail to catch the error because it triggers a native signal/memory access issue rather than a handled Java exception.

Codename One version

7.0.264

JDK version

17

Target environment

Framework: Codename One

OS: iOS 26 (Target Device)

Component: JSONObject / ParparVM (Bytecode-to-C Transpiler)

Last known working version

work perfect in ant structure

Logs and diagnostics

Screenshots or recordings

No response

Report checks

  • I searched existing issues and discussions for this behavior.
  • The reproducer contains no credentials, signing keys, or private customer data.
  • I understand that triage is not a commitment to a fix date.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions