Few cents about my commits

Fix: TimeoutException $classname.finalize() timed out after 10 seconds

|

This issue is rare and affects most user. It can be seen once registered for default Java exception handler.
Scenario for this crash is following:

  • iOS application goes to background/suspend (just enough to minimize it);
  • resumed after > 10s.

Crash is rare but more user you have more crashes you will see.

Root case

FinalizerWatchdogDaemon looks after FinalizerDaemon and responsible to terminate App if object spends too much time in .finalize() call. Scenario is following:

  • FinalizerDaemon picks object to dispose and calls .finalize() to allow object performing clean-ups;
  • FinalizerWatchdogDaemon detects it and startes looking for it;
  • Application is minimized/suspended;
  • all threads are suspended (including Daemons);
  • (time passed, 10+ seconds);
  • Application is resumed;
  • .finalize() is still busy;
  • FinalizerWatchdogDaemon has already counted 10+ seconds its being observing class doing finalization and terminates app, considering that finalizer is stuck.

Trying to reproduce

AltPods: pods updated - 1.22.0-SNAPSHOT

|

AltPods were updated to v1.22.0-SNAPSHOT to sync with recent releases.

Updated pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.22.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

Fixing: ld: unaligned pointer(s) for architecture arm64

|

Xcode started complaining about unaligned pointer in RoboVM binaries since 8.3 (issue #123) but these warnings (altogether with other possible) were suppressed with -w option. But with Xcode13.3 it started failing with error ld: unaligned pointer(s) for architecture arm64 on some projects (while compiled ok but probably with changes to it might fail).

Trying to reproduce

RoboVM 2.3.16 release and 2.3.17-SNAPSHOT

|

Idea plugin is not available at Idea Marketplace yet as in review!
But can be downloaded manually from MobiVM site.

2.3.16: What’s new

  • Fixed: ‘duplicate symbol xxx.spfpoffset’ in debug build when using GoogleMobileAds pod PR626
  • Framework target: can produce XCFramework, can produce m1 simulator slice PR624
  • Fixed: missing bitcode in VM libs (introduced by m1 support changes) PR624
  • Fixed #621 – hang of SKStoreReviewController.requestReview by PR615. WARNING: window is to be retained in user code now !!!
  • ByteBuffer J9 API desugaring PR615
  • ios15 binding PR613

2.3.17-SNAPSHOT:

  • Fixed: missing simulator arch in Idea picker PR642
  • New: ios15.4 bindings PR635
  • Changes: to swiftSupport configuration parameter PR638
  • Changes: Debugger – can suspend any thread PR628

Happy coding!
Please report any issue to tracker.

AltPods: pods updated - 1.21.0-SNAPSHOT

|

AltPods were updated to v1.21.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.21.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

Debugger -- suspend any thread

|

RoboVM code can be stopped only when code reach instrumented hook callbacks (ones that being injected after every line by compiler). As result pausing application will in most cases not stop the application and will not show valid call stack:

Root case

  • Thread state is not delivered from VM to debugger so always reported as running;
  • “Paused” thread doesn’t show any call stack due no ability to pause it other places than instrumented hooks code;

Approach

AltPods: pods updated - 1.20.0-SNAPSHOT

|

AltPods were updated to v1.20.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.20.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

AltPods: pods updated - 1.19.0-SNAPSHOT

|

AltPods were updated to v1.19.0-SNAPSHOT to sync with recent releases.

Updated pods

New pods

These pods were pushed to https://oss.sonatype.org/content/repositories/snapshots maven repo under 1.19.0-SNAPSHOTS version. Source code @github

Updates are not fully tested, please open issue if bug found.

AltPods: pods updated - 1.18.0-SNAPSHOT

|

ios12: class_copyProtocolList crash

|

Issue was reported on gitter and caused crash inside ObjC library of RoboVM with following stacktrace:

0 _mapStrHash(_NXMapTable*, void const*) + 4
1 _NXMapMember(_NXMapTable*, void const*, void**) + 52
2 NXMapGet + 20
3 getProtocol(char const*) + 28
4 class_copyProtocolList + 328
5 [J]org.robovm.objc.ObjCRuntime.class_copyProtocolList(JJ)J + 4358277632

Issue was reproduced on iOS12 simulator. Sample was simplified to following RoboVM/Java snippet: