Wayland crash and potential patch

12 views
Skip to first unread message

Albrecht Schlosser

unread,
Oct 17, 2021, 2:13:52 PM10/17/21
to fltk.coredev
Hi Manolo,

when testing the Wayland port (commit 611fe0fee48cea6) for a totally
different reason [1] I found a crash related to menu handling.

My demo program is attached as menu_test.cxx. The crash happens when you
open a menu as advised by the program, then move the mouse away from the
menu and wait for the popup (all within 5 seconds after the start).
Close the popup (the menu is still open), move back to the menu, and
move the mouse around so that another menu item opens. Or something very
similar.

If you miss the 5 second interval you can use the "Restart Timer" menu
for another test.

Stack trace attached: crash.txt. The top two lines (#0 and #1) show the
issue: "this=0x0".

The fix is to provide another "target" (whatever that means here, I just
fixed the symptoms). Maybe the patch must be totally different. My proof
of concept is attached as wayland_menu_crash.diff. It fixes the crash
for me.

Not directly related: I observed some menu positioning issues after the
test scenario is completed (after the patch was applied). I found
similar issues with other WM's, so this may not be the fault of the
Wayland port.

A second Wayland port related issue is that the menus are not positioned
correctly after pressing ctrl/+/- to zoom. It seemed to work fine if you
set the FLTK_SCALING_FACTOR env. variable before the start, but I'm not
entirely sure about the latter.

Other than that, I didn't have much time to test the Wayland port but
I'll go ahead and do some more tests. Thanks for the great work!

––––

[1] STR #1986, STR #1896, and STR 3179 are about similar menu issues in
conjunction with popup message. I thought this issue was generally fixed
but today I managed to crash my WM (Linux Mint: Cinnamon) with such a
menu/popup test. I tested with different WM's and found totally
different behaviors. One of my tests was Wayland (Weston).

menu_test.cxx
crash.txt
wayland_menu_crash.diff

Manolo

unread,
Oct 17, 2021, 3:51:06 PM10/17/21
to fltk.coredev
Le dimanche 17 octobre 2021 à 20:13:52 UTC+2, Albrecht Schlosser a écrit :
Hi Manolo,

when testing the Wayland port (commit 611fe0fee48cea6) for a totally
different reason [1] I found a crash related to menu handling.
Thanks for the patch. I'll look into it.

……

A second Wayland port related issue is that the menus are not positioned
correctly after pressing ctrl/+/- to zoom. It seemed to work fine if you
set the FLTK_SCALING_FACTOR env. variable before the start, but I'm not
entirely sure about the latter.
GUI scaling is ready for testing with the Mutter and KDE compositors, but not yet
with Weston, unfortunately. I'll post when these problems are fixed, hopefully.

Manolo

unread,
Oct 18, 2021, 3:44:45 AM10/18/21
to fltk.coredev
Le dimanche 17 octobre 2021 à 20:13:52 UTC+2, Albrecht Schlosser a écrit :
Hi Manolo,

when testing the Wayland port (commit 611fe0fee48cea6) for a totally
different reason [1] I found a crash related to menu handling.

My demo program is attached as menu_test.cxx. The crash happens when you
open a menu as advised by the program, then move the mouse away from the
menu and wait for the popup (all within 5 seconds after the start).
Close the popup (the menu is still open), move back to the menu, and
move the mouse around so that another menu item opens. Or something very
similar.
Thanks for the patch. I've completed it a bit for another possible problem and
committed to the wayland branch (7ea7f99 ).
Reply all
Reply to author
Forward
0 new messages