Gluonfx iOS app crashes when phone is rotated

90 views Asked by At

I have built a Gluon app that is compiled using graalvm to iOS app, deployed to various iphones and ipads. App is showing images that is updated several times a second. When I start the app and no images have been updated yet, rotation seems to work fine. But after first update, and I rotate, especially on iphones, the gluonfx framework crashes and restarts showing the nag-message.

Crash report from iOS shows:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000538
Exception Codes: 0x0000000000000001, 0x0000000000000538
VM Region Info: 0x538 is not in any region.  Bytes before following region: 68719475400
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      commpage (reserved)     1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [1245]

Triggered by Thread:  0

Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter


Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   vtd-monitor                            0x102c69248 sendNotch + 144
1   vtd-monitor                            0x102c69bec -[Display OrientationDidChange:] + 28
2   CoreFoundation                         0x19b6674c8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
3   CoreFoundation                         0x19b666e90 ___CFXRegistrationPost_block_invoke + 88
4   CoreFoundation                         0x19b666dd8 _CFXRegistrationPost + 440
5   CoreFoundation                         0x19b666328 _CFXNotificationPost + 724

App showing relatively large images, that can be panned and zoomed to se small details. On an iPad gen 10, its almost impossible to make it crash, but my iPhone 14 pro its a sure thing. Same iOS app is deployed on both, and the obvious thing is clearly the screen size. I have tried to do things in different ways, removing code, rewriting with no luck.

FXML View (snippet), when the imageView and blurredImageView are updated, things starts to crash.


        <StackPane fx:id="stackPane">

            <!-- <ImageView fx:id="backgroundImage" fitWidth="500" fitHeight="300" 
                /> -->
            <!-- Horizontal Layout -->
            <HBox fx:id="horizontalLayout" spacing="10">

                <StackPane alignment="CENTER" HBox.hgrow="ALWAYS">

                    <ScrollPane fx:id="imageScrollPane" VBox.vgrow="ALWAYS"
                        HBox.hgrow="ALWAYS" fitToWidth="true" fitToHeight="true">
                        <StackPane alignment="CENTER">
                            <ImageView fx:id="blurredImageView" />
                            <ImageView fx:id="imageView" />
                        </StackPane>
                    </ScrollPane>

                    <!-- BorderPane for Text GridPanes -->
                    <BorderPane style="-fx-background-color: transparent;"
                        mouseTransparent="true">
                        
....

                    </BorderPane>


                </StackPane>

            </HBox>



        </StackPane>

        
</center>
       
....


Anyone seens this crash error before? Any ideas?

Best regards

Bo

I have tried to reorganize, rewrite the code. I tried to remove one of the views, removing the stackedpane. I tried to slow down code, to possible identify race-conditions. I tried to single-step view updates, still same results.

Again, the problem happens every time on iphones with a small screen and very rarely in ipads - on some ipads, i have never seen the problem.

I have tracked the memory usage, but the JVM reports same behaviour on all devices.

I cannot provoke any problems when running the app in Simulator (iphone models, ipad models), besides its running really slow (like two seconds to update views using Platform.runLater, where on real devices and on pure javafx on the pc, its less that 10ms.

Any advice, ideas are welcome.

0

There are 0 answers