Bug 2105729 - pangzero and frozen-bubble won't launch and segfault on F36
Summary: pangzero and frozen-bubble won't launch and segfault on F36
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL2
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Raits
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-09 23:17 UTC by Sergio Basto
Modified: 2022-07-16 21:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-16 21:55:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
PATCH to fix crash on systems where libXi.so.6 is not installed (467 bytes, patch)
2022-07-11 14:30 UTC, Hans de Goede
no flags Details | Diff
PATCH to fix crash on systems where libXi.so.6 is not installed (643 bytes, patch)
2022-07-14 08:02 UTC, Petr Pisar
no flags Details | Diff

Description Sergio Basto 2022-07-09 23:17:31 UTC
Description of problem:

pangzero segfault on Fedora 35 KDE X11 and F36 

frozen-bubble also segfault on F36 , but runs on F35 .

more details here 
https://bugzilla.rpmfusion.org/show_bug.cgi?id=6325

Comment 1 Hans de Goede 2022-07-10 13:45:49 UTC
I'll try to take a look at this, but:

a) I'm very busy with other stuff, so it may take quite some time before I get around to this
b) I only took perl-SDL because it is a dependency of frozen-bubble, I know almost nothing about perl ...

Comment 2 Petr Pisar 2022-07-11 10:52:04 UTC
frozen-bubble in F37 connected to X11 in F35:

(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007ffff7486c0e in X11_Xinput2UngrabTouch (window=0x555556c2dd10, _this=<optimized out>) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/x11/SDL_x11xinput2.c:385
#2  X11_SetWindowMouseGrab (_this=<optimized out>, window=0x555556c2dd10, grabbed=<optimized out>) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/x11/SDL_x11window.c:1799
#3  0x00007ffff7454d3f in SDL_UpdateWindowGrab (window=0x555556c2dd10) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/SDL_video.c:2816
#4  0x00007ffff74bdd7c in SDL_OnWindowFocusGained (window=0x555556c2dd10) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/SDL_video.c:3031
#5  SDL_SendWindowEvent.isra.0 (window=window@entry=0x555556c2dd10, windowevent=windowevent@entry=12 '\f', data1=data1@entry=0, data2=data2@entry=0)
    at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/events/SDL_windowevents.c:168
#6  0x00007ffff73cfb86 in SDL_SetKeyboardFocus (window=0x555556c2dd10) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/events/SDL_keyboard.c:660
#7  0x00007ffff74770c4 in X11_DispatchFocusIn (_this=0x555556bc8e50, data=0x555556c3eec0) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/x11/SDL_x11events.c:440
#8  0x00007ffff747c46b in X11_DispatchEvent (_this=_this@entry=0x555556bc8e50, xevent=xevent@entry=0x7fffffffdca0) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/x11/SDL_x11events.c:962
#9  0x00007ffff747d99b in X11_PumpEvents (_this=0x555556bc8e50) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/video/x11/SDL_x11events.c:1694
#10 0x00007ffff73cf149 in SDL_PumpEventsInternal (push_sentinel=push_sentinel@entry=SDL_TRUE) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/events/SDL_events.c:847
#11 0x00007ffff73cf44f in SDL_WaitEventTimeout_REAL (event=0x7fffffffdeb0, timeout=0) at /usr/src/debug/SDL2-2.0.22-2.fc37.x86_64/src/events/SDL_events.c:1024
#12 0x00007ffff75464a1 in SDL_PumpEvents () at /usr/src/debug/sdl12-compat-1.2.52-1.fc37.x86_64/src/SDL12_compat.c:5898
#13 0x00007ffff757181e in XS_SDL__Events_pump_events (my_perl=<optimized out>, cv=0x555556083830) at lib/SDL/Events.xs:60
#14 0x00007ffff7d1eed0 in Perl_pp_entersub (my_perl=0x5555555592a0) at /usr/src/debug/perl-5.36.0-488.fc37.x86_64/pp_hot.c:5352
#15 0x00007ffff7d10850 in Perl_runops_standard (my_perl=0x5555555592a0) at /usr/src/debug/perl-5.36.0-488.fc37.x86_64/run.c:41
#16 0x00007ffff7c80eae in S_run_body (oldscope=<optimized out>, my_perl=<optimized out>) at /usr/src/debug/perl-5.36.0-488.fc37.x86_64/perl.c:2716
#17 perl_run (my_perl=0x5555555592a0) at /usr/src/debug/perl-5.36.0-488.fc37.x86_64/perl.c:2644
#18 0x000055555555534a in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at /usr/src/debug/perl-5.36.0-488.fc37.x86_64/perlmain.c:110

Frame #1 calls X11_XIUngrabTouchBegin():

void
X11_Xinput2UngrabTouch(_THIS, SDL_Window *window)
{
#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    Display *display = data->videodata->display;

    XIGrabModifiers mods;

    mods.modifiers = XIAnyModifier;
    mods.status = 0;

→   X11_XIUngrabTouchBegin(display, XIAllDevices, data->xwindow, 1, &mods);
#endif
}

(gdb) info locals 
data = <optimized out>
display = <optimized out>
mods = {modifiers = -2147483648, status = 0}

I will try to minimize the the reproducer.

Comment 3 Hans de Goede 2022-07-11 14:21:56 UTC
The problem of the posted backtrace is that /usr/lib64/libXi.so.6 is not there and SDL2 dlopen()'s everything...

Arguably this is a bug in the posted SDL2 code snippet since it does not do a runtime check for
the global "int SDL_X11_HAVE_XINPUT2" variable.

Comment 4 Hans de Goede 2022-07-11 14:22:58 UTC
Note that on Fedora Workstation gnome-shell brings in libXi so I guess that you are both using a different spin ?

Comment 5 Hans de Goede 2022-07-11 14:30:59 UTC
Created attachment 1896084 [details]
PATCH to fix crash on systems where libXi.so.6 is not installed

This SDL2 patch fixes things for me in the libXi.so.6 missing case.

Comment 6 Sergio Basto 2022-07-11 14:55:17 UTC
Hello,
I just checked, I already got /usr/lib64/libXi.so.6 installed on F35 and F36 so it segfault with libXi.so.6 installed

Comment 7 Hans de Goede 2022-07-11 19:52:38 UTC
(In reply to Sergio Basto from comment #6)
> Hello,
> I just checked, I already got /usr/lib64/libXi.so.6 installed on F35 and F36
> so it segfault with libXi.so.6 installed

Can you collect a backtrace?

Run:

gdb /usr/bin/perl

answer "y" to the question about using debuginfod and then inside gfb do:

run /usr/bin/frozen-bubble

And then once it crashes type "bt" on the gdb prompt and copy and paste the output here.

Comment 8 Sergio Basto 2022-07-13 21:00:42 UTC
bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fffdf70e330 in __glXGetDrawableAttribute () from /lib64/libGLX_mesa.so.0
#2  0x00007fffe9f4d2c4 in X11_GL_GetSwapInterval (_this=0x555556bb3db0) at /usr/src/debug/SDL2-2.0.22-2.fc36.x86_64/src/video/x11/SDL_x11opengl.c:933
#3  X11_GL_GetSwapInterval (_this=_this@entry=0x555556bb3db0) at /usr/src/debug/SDL2-2.0.22-2.fc36.x86_64/src/video/x11/SDL_x11opengl.c:917
#4  0x00007fffe9f4d38e in X11_GL_SetSwapInterval (_this=0x555556bb3db0, interval=0)
    at /usr/src/debug/SDL2-2.0.22-2.fc36.x86_64/src/video/x11/SDL_x11opengl.c:890
#5  0x00007fffe9eb775e in GL_CreateRenderer (window=0x555556c2a8c0, flags=<optimized out>)
    at /usr/src/debug/SDL2-2.0.22-2.fc36.x86_64/src/render/opengl/SDL_render_gl.c:1849
#6  0x00007fffe9ea8b98 in SDL_CreateRenderer_REAL (window=0x555556c2a8c0, index=0, flags=2)
    at /usr/src/debug/SDL2-2.0.22-2.fc36.x86_64/src/render/SDL_render.c:977
#7  0x00007ffff79b16a7 in SDL_SetVideoMode (width=width@entry=640, height=height@entry=480, bpp=<optimized out>, bpp@entry=24, 
    flags12=<optimized out>) at /usr/src/debug/sdl12-compat-0.0.1~git.20211125.4e4527a-4.fc36.x86_64/src/SDL12_compat.c:5172
#8  0x00007ffff7dce67c in XS_SDL__Video_set_video_mode (my_perl=<optimized out>, cv=<optimized out>) at lib/SDL/Video.xs:137
#9  0x00007ffff7b0a790 in Perl_pp_entersub () from /lib64/libperl.so.5.34
#10 0x00007ffff7b02260 in Perl_runops_standard () from /lib64/libperl.so.5.34
#11 0x00007ffff7a7eace in perl_run () from /lib64/libperl.so.5.34
#12 0x000055555555534a in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>)
    at /usr/src/debug/perl-5.34.1-486.fc36.x86_64/perlmain.c:110

Comment 9 Hans de Goede 2022-07-13 21:16:25 UTC
Thanks, that is a bit of a weird backtrace.

What GPU are you using and which driver are you using with this GPU ? Is this perhaps inside a virtual-machine ?

Comment 10 Sergio Basto 2022-07-14 06:15:56 UTC
yes inside a virtual-machine (virtualbox vm)

what I notice is a mixup of SDL1 with SDL2

SDL_SetVideoMode (width=width@entry=640, height=height@entry=480, bpp=<optimized out>, bpp@entry=24, 
    flags12=<optimized out>) at /usr/src/debug/sdl12-compat-0.0.1~git.20211125.4e4527a-4.fc36.x86_64/src/SDL12_compat.c:5172

Comment 11 Petr Pisar 2022-07-14 08:01:12 UTC
Installing libXi fixes the crash for me. (Again kvm-virtalized F37 with X11 server on F35.)
If I uninstall libXi and install patched SDL2, the crash goes away in a windowed mode (frozen-bubble --no-fullscreen), but remains in a fullscreeen mode (frozen-bubble --fullscreen). Funny thing is that if I start frozen-bubble with --no-fullscreen, and then press "f" to switch to fullscreen, there is no crash.
If I install libXi again and keep using patched SDL2, there is no crash regardless of fullscreen.

This is a backtrace of patched SDL2 in fullscreen:

#0  0x0000000000000000 in  ()
#1  0x00007f7e6594f1b8 in X11_Xinput2GrabTouch (window=0x55f7169ac900, _this=0x55f7169478b0) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/x11/SDL_x11xinput2.c:369
#2  X11_SetWindowMouseGrab (_this=0x55f7169478b0, window=0x55f7169ac900, grabbed=<optimized out>) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/x11/SDL_x11window.c:1787
#3  0x00007f7e6591d1af in SDL_UpdateWindowGrab (window=0x55f7169ac900) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/SDL_video.c:2816
#4  0x00007f7e6598632c in SDL_OnWindowFocusGained (window=0x55f7169ac900) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/SDL_video.c:3031
#5  SDL_SendWindowEvent.isra.0 (window=window@entry=0x55f7169ac900, windowevent=windowevent@entry=12 '\f', data1=data1@entry=0, data2=data2@entry=0)
    at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/events/SDL_windowevents.c:168
#6  0x00007f7e65897ff6 in SDL_SetKeyboardFocus (window=0x55f7169ac900) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/events/SDL_keyboard.c:660
#7  0x00007f7e6593f524 in X11_DispatchFocusIn (_this=0x55f7169478b0, data=0x55f7169c17f0) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/x11/SDL_x11events.c:440
#8  0x00007f7e659448cb in X11_DispatchEvent (_this=_this@entry=0x55f7169478b0, xevent=xevent@entry=0x7ffde50b9c60) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/x11/SDL_x11events.c:962
#9  0x00007f7e65945dfb in X11_PumpEvents (_this=0x55f7169478b0) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/video/x11/SDL_x11events.c:1694
#10 0x00007f7e658975b9 in SDL_PumpEventsInternal (push_sentinel=push_sentinel@entry=SDL_TRUE) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/events/SDL_events.c:847
#11 0x00007f7e658978bf in SDL_WaitEventTimeout_REAL (event=0x7ffde50b9e70, timeout=0) at /usr/src/debug/SDL2-2.0.22-4.fc37.x86_64/src/events/SDL_events.c:1024
#12 0x00007f7e65cbf4a1 in SDL_PumpEvents () at /lib64/libSDL-1.2.so.0
#13 0x00007f7e65ce981e in XS_SDL__Events_pump_events () at /usr/lib64/perl5/vendor_perl/auto/SDL/Events/Events.so
#14 0x00007f7e6611eed0 in Perl_pp_entersub () at /lib64/libperl.so.5.36
#15 0x00007f7e66110850 in Perl_runops_standard () at /lib64/libperl.so.5.36
#16 0x00007f7e66080eae in perl_run () at /lib64/libperl.so.5.36
#17 0x000055f713c3334a in main ()

Probably we need to patch X11_Xinput2GrabTouch() in a similar way as you patched X11_Xinput2UngrabTouch().
I tried that and it fixed my crash. I will amend the patch here.

Comment 12 Petr Pisar 2022-07-14 08:02:10 UTC
Created attachment 1896977 [details]
PATCH to fix crash on systems where libXi.so.6 is not installed

Comment 13 Petr Pisar 2022-07-14 08:54:08 UTC
(In reply to Sergio Basto from comment #10)
> yes inside a virtual-machine (virtualbox vm)
> 
> what I notice is a mixup of SDL1 with SDL2
> 
> SDL_SetVideoMode (width=width@entry=640, height=height@entry=480,
> bpp=<optimized out>, bpp@entry=24, 
>     flags12=<optimized out>) at
> /usr/src/debug/sdl12-compat-0.0.1~git.20211125.4e4527a-4.fc36.x86_64/src/
> SDL12_compat.c:5172

That's because SDL1 is a wrapper around SDL2.

Sergio, could you try different games which use directly SDL1 (sdl12-compat RPM package) without perl-SDL (e.g. xblast) and games which use directly SDL2 without SDL1 (e.g. supertux)?

Comment 14 Sergio Basto 2022-07-14 10:38:33 UTC
testing xblast-x11 not xblast on my F35 (and F36 I tested in a vm) 
gdb xblast-x11
run
could not load font 24
could not load font 18
could not load font 14
X Error of failed request:  BadFont (invalid Font parameter)
Major opcode of failed request:  56 (X_ChangeGC)
Resource id in failed request:  0x0
Serial number of failed request:  504
Current serial number in output stream:  527

Comment 15 Petr Pisar 2022-07-14 11:41:31 UTC
xblast-x11 does not use SDL at all. The BadFont probably means that xblast-x11 requests a font which is not installed.
To test SDL1, you need to execute xblats-sdl program from xblast package.

Comment 16 Petr Pisar 2022-07-14 12:45:00 UTC
(In reply to Petr Pisar from comment #15)
> The BadFont probably means that xblast-x11 requests a font which is not installed.

It's this bug #2107144 in xblast. A workaround is deleting ~/.xblast_tnt directory.

Comment 17 Hans de Goede 2022-07-16 19:22:05 UTC
Sergio, I've tried to reproduce your crash by creating a fresh F36 vm using a standard workstation install under the rpmfusion virtualbox pkg as hypervisor and then did:

sudo dnf install frozen-bubble

And I'm not seeing any crash. Did you perhaps at one point try to enable the known to be broken virtualbox 3d accel bits? Or mabe you have installed the virtualbox guest addons from virtualbox upstream instead of sticking with the Fedora packaged version of the virtualbox guest addons ?

###

As for the libXi.so.6 missing problem. I was about to submit a merge-request for this upstream, but upstream SDL actually fixed this themselves about 2 weeks ago:

https://github.com/libsdl-org/SDL/commit/fdb86b8266

Comment 18 Sergio Basto 2022-07-16 21:55:43 UTC
(In reply to Hans de Goede from comment #17)

ah disabling in vm settings -> display -> 3D acceleration , indeed fixes frozen-bubble . 

also pangozero is fixed .

in resume all fixed :) 

Thank you , the bug can be closed as not a bug , upstream , works for me , errata , I don't know what I should choose !


Note You need to log in before you can comment on or make changes to this bug.