Bug 2190055

Summary: glib2 segfault
Product: [Fedora] Fedora Reporter: Stepbro <william>
Component: openboxAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 38CC: jonathan.buch+fedora, mlichvar, tdawson
Target Milestone: ---Keywords: Desktop, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-27 14:58:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch seemingly fixing the crash none

Description Stepbro 2023-04-27 00:31:11 UTC
In "Fedora LXDE" dragging any window overtop of "Counter-Strike: Global Offensive" while it is in fullscreen causes openbox to segfault

Reproducible: Always

Steps to Reproduce:
1.Install "Fedora LXDE" From Fedora spins.
2.Install steam from rpmfusion & install cs:go from steam.
3.Open cs:go and fullscreen it.
4. Drag any window from the secondary display to the display the game is fullscreened on with quite a bit of speed.
5. Openbox segfaults and the window title bars go away.
6. cry.
Actual Results:  
Window title-bars flash then disappear and you are no longer able to change which window is selected.

Expected Results:  
Render the window overtop of the game like it did in F37.

Comment 1 Miroslav Lichvar 2023-04-27 08:35:56 UTC
Thanks for the reproducer. This might be a duplicate of bug #2178299.

Comment 2 Jonathan Buch 2023-04-27 14:47:06 UTC
Created attachment 1960415 [details]
Patch seemingly fixing the crash

Analyzed this.

Reproducing it is even simpler for me:

* Open a Google Chrome window in fullscreen
* ctrl+n

There are reports for this:
https://retrace.fedoraproject.org/faf/reports/648708/

addr2line -e /lib64/libobt.so.2 0x7df9
/usr/src/debug/openbox-3.6.1-21.fc38.x86_64/obt/signal.c:281
addr2line -e /usr/bin/openbox 0x1e7d3
/usr/src/debug/openbox-3.6.1-21.fc38.x86_64/openbox/client.c:2726
addr2line -e /usr/bin/openbox 0x31062
/usr/src/debug/openbox-3.6.1-21.fc38.x86_64/openbox/event.c:583

/var/log/messages (see signal.c:281)
34278:Apr 20 13:03:27 geras /usr/libexec/gdm-x-session[26132]: How are you gentlemen? All your base are belong to us. (Openbox received signal 11)

client.c:2726

    /* now recalc any windows in the fullscreen layer which have not
       had their layer recalced already */
    for (; it; it = g_list_next(it)) {
        if (window_layer(it->data) < OB_STACKING_LAYER_FULLSCREEN) break;
        else if (WINDOW_IS_CLIENT(it->data) &&
                 !WINDOW_AS_CLIENT(it->data)->visited)
            client_calc_layer_internal(x->data);

The iteration over GList *stacking_list at fault here, or rather the call to client_calc_layer_internal() which affects the stacking_list.  I guess the glist cannot be touched while iterating.

I created a patch for me, it works, however as I have no idea what the code is even supposed to do, it might fail somehow somewhere later.

But hey, at least my desktop doesn't crash anymore.

Comment 3 Miroslav Lichvar 2023-04-27 14:58:45 UTC

*** This bug has been marked as a duplicate of bug 2178299 ***