Gluonfx编译iOS应用旋转屏幕时崩溃问题求助
Gluon iOS应用屏幕旋转崩溃问题排查求助
我使用GraalVM将Gluon应用编译为iOS应用,部署至多款iPhone和iPad设备。该应用需每秒更新数次图片,初始启动未更新图片时屏幕旋转正常,但首次更新图片后,旋转屏幕(尤其在iPhone设备上)会导致Gluonfx框架崩溃并重启。
iOS崩溃报告
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
问题细节
- 应用展示的图片尺寸较大,支持平移和缩放查看细节
- 在iPad 10代上几乎不会崩溃,但在iPhone 14 Pro上必然触发崩溃,推测与屏幕尺寸相关
- 已尝试的排查手段:重组代码、移除视图、放慢更新速度排查竞态条件、单步调试视图更新,均未解决问题
- iOS模拟器中无法复现该问题,但视图更新速度极慢(使用
Platform.runLater更新需约2秒,而真机及PC端纯JavaFX环境下仅需不到10ms) - 已跟踪内存使用情况,JVM在所有设备上表现一致
FXML视图片段(更新imageView和blurredImageView后开始出现崩溃)
<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> ....
内容的提问来源于stack exchange,提问作者Bo Friis
相关产品推荐
相关产品推荐

