You are not logged in.

#1 2023-03-14 16:42:10

LeonN
Member
Registered: 2022-12-19
Posts: 66

[SOLVED] Openbox crashes when alt-tabing steam games

Hello, community. I just reinstalled arch on my laptop. I just installed a fee packsges: nvidia , nvidia-utils, nvidia-prime, nvidia-settings, lightdm, lightdm-gtk-greeter, yay, openbox tint2. After doing that, I installed steam and then Dota2. When I tried to alt-tab. Openbox log out my session and I was prompted to lightdm. After logging in and start Steam again, I tried to launch Dota 2 and I got a message saying that the game was already running. I rebooted my system and now I can launch the game, but the same problems keeps happening. Also, I tried to alt-tab with anothee game, Half Life 1 and the behavioir is the same.  Is there any log file to take a look at to see what the cause of this is? Or maybe some idea on how to fix it? Thank you

Last edited by LeonN (2023-12-31 20:13:17)

Offline

#2 2023-03-14 19:06:58

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

It's something to do with glib2 2.74.6 -> 2.76.0 update... I reported a bug for what it's worth: https://bugzilla.icculus.org/show_bug.cgi?id=6669

Offline

#3 2023-03-14 19:40:26

LeonN
Member
Registered: 2022-12-19
Posts: 66

Re: [SOLVED] Openbox crashes when alt-tabing steam games

How exactly should I downgrade glib2 to that version?

Offline

#4 2023-03-14 19:52:16

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

As root:

# pacman -U https://archive.archlinux.org/packages/g/glib2/glib2-2.74.6-1-x86_64.pkg.tar.zst

and if you also have a lib32 version

# pacman -U https://archive.archlinux.org/packages/l/lib32-glib2/lib32-glib2-2.74.6-1-x86_64.pkg.tar.zst

Then add:

IgnorePkg = glib2 lib32-glib2

to /etc/pacman.conf

But downgrading isn't really a permanent solution. Sooner or later we will need to upgrade glib2 and then this will come back to bite us in the a**.

Last edited by karabaja4 (2023-03-14 19:55:36)

Offline

#5 2023-03-14 20:05:01

LeonN
Member
Registered: 2022-12-19
Posts: 66

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Before this time, I tested openbox and I was able to play dota, I could even alt-tab and iconify it; however, there were some unexpected crashes while playing, where the whole system freezes and I had to force a shut down. That's the reason I'm testing the game on a clen openbox installation. I don't know if those old crashes were due to glib2 as well.

Offline

#6 2023-03-14 20:44:30

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Offline

#7 2023-03-14 22:31:30

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

@seth I think it's just Openbox code...

gdb bt

#0  0x00007f58e09bd8ec in  () at /usr/lib/libc.so.6
#1  0x00007f58e096eea8 in raise () at /usr/lib/libc.so.6
#2  0x00007f58e095853d in abort () at /usr/lib/libc.so.6
#3  0x00007f58e0e0bb97 in  () at /usr/lib/libobt.so.2
#4  0x00007f58e096ef50 in <signal handler called> () at /usr/lib/libc.so.6
#5  0x00005576eb1662dc in client_calc_layer ()
#6  0x00005576eb1748c1 in  ()
#7  0x00007f58e0e0d800 in  () at /usr/lib/libobt.so.2
#8  0x00007f58e0b77afb in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#9  0x00007f58e0bd45d9 in  () at /usr/lib/libglib-2.0.so.0
#10 0x00007f58e0b770cf in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#11 0x00005576eb191956 in main ()

which would be somewhere around here in client_calc_layer.

Last edited by karabaja4 (2023-03-14 22:32:08)

Offline

#8 2023-03-14 23:46:18

sebalis
Member
Registered: 2016-12-22
Posts: 13

Re: [SOLVED] Openbox crashes when alt-tabing steam games

I reported my issue (where xfce4-session is affected after the glib2 update, I do not use Openbox) at the GNOME Gitlab and was asked to report to XFCE instead. With the same logic, it might be a good idea to get in touch with the Openbox developers even if glib2 is the component that was changed. More about the reasoning in my GNOME issue: https://gitlab.gnome.org/GNOME/glib/-/issues/2941

Offline

#9 2023-03-15 06:53:17

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

If those different breakages are down to a single commit in glib, the problem/change will be with the glib event loop.
And if such change there breaks two independent applications, there's a good change more's gonna pile up in the near future w/ a nice race condition.

Offline

#10 2023-03-15 07:02:20

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Do you get the same crash w/ "export G_SLICE=always-malloc" and the old glíb version?
https://bbs.archlinux.org/viewtopic.php?id=284258

Offline

#11 2023-03-15 10:04:20

Uhrenvergleich
Member
Registered: 2023-03-15
Posts: 2

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Similar issue here since March, 13th. I am also using Openbox. It crashes, when I open a link in a new window in Firefox.

Coredump:

Mär 15 06:45:41 xxx systemd-coredump[83063]: Process 2181 (openbox) of user 1000 dumped core.
                                             
                                             Stack trace of thread 2181:
                                             #0  0x00007f0083b848ec n/a (libc.so.6 + 0x878ec)
                                             #1  0x00007f0083b35ea8 raise (libc.so.6 + 0x38ea8)
                                             #2  0x00007f0083b1f53d abort (libc.so.6 + 0x2253d)
                                             #3  0x00007f0083fca9db n/a (libobt.so.2 + 0x69db)
                                             #4  0x00007f0083b35f50 n/a (libc.so.6 + 0x38f50)
                                             #5  0x000055fba9644191 client_calc_layer (openbox + 0x>
                                             #6  0x000055fba96570b1 n/a (openbox + 0x300b1)
                                             #7  0x00007f0083fd0379 n/a (libobt.so.2 + 0xc379)
                                             #8  0x00007f0083d3eafb g_main_context_dispatch (libgli>
                                             #9  0x00007f0083d9b5d9 n/a (libglib-2.0.so.0 + 0xb75d9)
                                             #10 0x00007f0083d3e0cf g_main_loop_run (libglib-2.0.so>
                                             #11 0x000055fba96384f0 main (openbox + 0x114f0)
                                             #12 0x00007f0083b20790 n/a (libc.so.6 + 0x23790)
                                             #13 0x00007f0083b2084a __libc_start_main (libc.so.6 + >
                                             #14 0x000055fba9638c15 _start (openbox + 0x11c15)
                                             ELF object binary architecture: AMD x86-64

Good idea in general to open an incident, but as far as I can see Openbox is not maintained anymore.

Any ideas?

Thanks!

Last edited by Uhrenvergleich (2023-03-15 10:16:30)

Offline

#12 2023-03-15 21:03:19

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

seth wrote:

Do you get the same crash w/ "export G_SLICE=always-malloc" and the old glíb version?
https://bbs.archlinux.org/viewtopic.php?id=284258

It crashes with "export G_SLICE=always-malloc" and glib 2.74.6. So it is related to removing the slice allocator...

I have been debugging code a bit and it crashes when it tries to access it->data in one of the iterations of the for loop here, but I have no idea why, I assume that pointer points to something that has been freed and we get a segmentation fault.

Stepping further into the code I see this and this functions doing various changes to that list in the for loop, but I can't figure out what exactly they do and how the next list element would randomly get freed. I am no C++/glib programmer so I'm just fishing here.

Last edited by karabaja4 (2023-03-15 21:49:13)

Offline

#13 2023-03-15 21:42:50

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

is "it" 0 or "it->data"? (or, worse: none and there's just a dangling pointer)?

It crashes with export "G_SLICE=always-malloc" and glib 2.74.6. So it is related to removing the slice allocator...

Not cool… I've no popcorn at hand!
That's gonna be a shit-fest.

The openbox code hasn't been touched in a decade and judging by the recent "updated glib2 and stuff broke" threads, it's by far not gonna be the only victim of this stunt.

Offline

#14 2023-03-15 21:45:01

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

seth wrote:

is "it" 0 or "it->data"? (or, worse: none and there's just a dangling pointer)?

When it reads it->data it crashes...

Offline

#15 2023-03-15 22:05:21

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

…
    for (; it; it = g_list_next(it)) {
        printf('it: %x\n', it);
        if (it)
            printf('it->data: %x\n', it->data);
        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(it->data);
    }
…

Offline

#16 2023-03-15 23:09:38

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: [SOLVED] Openbox crashes when alt-tabing steam games

@seth

Openbox-Debug: (FOCUS) Frame for 0x1400003 has focus: 1
Openbox-Debug: (FOCUS) focus_set_client 0x1400003
Openbox-Debug: it: 2045a410

Openbox-Debug: it->data: 206043d0

Openbox-Debug: it: 39d0f93f

How are you gentlemen? All your base are belong to us. (Openbox received signal 11)
Aborted
X connection to :1 broken (explicit kill or server shutdown).

so in the second loop iteration, client_calc_layer_internal makes it->data invalid somehow...

Last edited by karabaja4 (2023-03-16 00:31:28)

Offline

#17 2023-03-16 07:33:52

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Nah, there's just a dangling entry in stacking_list - in theory this can have happened at any point.
Did you test whether the bogus GList pointer (39d0f93f, but the number will change) shows up in the first loop at all?


Do you have a complete stack trace?
Does client_calc_layer get called out of some client_unmanage?

Offline

#18 2023-03-16 11:54:13

randprit
Member
Registered: 2022-06-20
Posts: 2

Re: [SOLVED] Openbox crashes when alt-tabing steam games

@karabaja4

Thank you, your trick helped me with my problem with OpenBox and multiple screens.

Offline

#19 2023-03-17 09:40:03

pldubouilh
Member
Registered: 2023-03-17
Posts: 1

Re: [SOLVED] Openbox crashes when alt-tabing steam games

same bug here, I also narrowed it down to the list usage in `client_calc_layer` (it's in the backtrace). I just proposed a fix over on the openbox repos https://bugzilla.icculus.org/show_bug.cgi?id=6669

for the record, I had a constant repro when someone started screensharing with me using the zoom desktop app - that at least is fixed, but I'll need a bit more testing to be sure the fix holds in other use-cases.

Offline

#20 2023-03-17 11:15:43

seth
Member
Registered: 2012-09-03
Posts: 49,963

Re: [SOLVED] Openbox crashes when alt-tabing steam games

The patch shows that the list is corrupted inside the function, what luckily constrains the origin of the bug.
But creating a copy of the list is inefficient and only glosses over the actual problem (and probably will cause X11 errors and/or behavioral differences - maybe maintain them b/c of the status quo ante)
It'll also

    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(it->data);
    }
client_calc_layer_internal(it->data)

will call

client_calc_layer_recursive

which will (likely) taint the list w/

stacking_remove(CLIENT_AS_WINDOW(self)); stacking_add_nonintrusive(CLIENT_AS_WINDOW(self));

This is a bit clunky, but I guess we're not getting lambda support in this code wink

    gboolean keep_running = TRUE;
    while (keep_running) {
        keep_running = FALSE;
        /* skip over stuff above fullscreen layer */
        for (it = stacking_list; it; it = g_list_next(it))
            if (window_layer(it->data) <= OB_STACKING_LAYER_FULLSCREEN) break;

        /* 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(it->data);
                keep_running = TRUE;
                break;
            }
        }
    }

It repeatedly traverses the entire list until it's sanitized.
The "visited" flag should™ prevent any kind of enternal loop.

Offline

#21 2023-03-20 08:52:08

scot
Member
Registered: 2017-04-22
Posts: 23

Re: [SOLVED] Openbox crashes when alt-tabing steam games

I don't know if there's any value in my uploading a stack trace which is essentially the same as Uhrenvergleich.  Openbox crashes and brings all of X down with it after some time in a large zoom conference; it seems to be triggered (after about an hour) by various window manipulations of the zoom: full-screening a window, or shifting the gallery to the next screen, or double-clicking to pop-out or pop-in the chat window.

I upgraded openbox from community-testing ( as per https://bugs.archlinux.org/task/77853 ).  lf ordinary users can help with the testing/signoff process in some way, please point me to instructions. I didn't find anything after a quick search.

So far so good.. But with me it took some time for openbox and X to die; I could not  reproduce it on demand.  But it's hit me several times each day since last week, so if I go the day without a problem that will be significant.

Thank you  thank you thank you

Last edited by scot (2023-03-20 09:13:00)

Offline

#22 2023-03-20 12:52:08

yan12125
Member
Registered: 2017-11-01
Posts: 36

Re: [SOLVED] Openbox crashes when alt-tabing steam games

> lf ordinary users can help with the testing/signoff process in some way, please point me to instructions. I didn't find anything after a quick search.

See https://wiki.archlinux.org/title/Arch_Testing_Team

Sign-offs are not mandatory. It's just a process to confirm that a package is working. As long as several people can confirm the new openbox works and the patch does not cause other issues, I will move the new openbox from [community-testing] to [community].

Offline

#23 2023-03-20 22:32:56

scot
Member
Registered: 2017-04-22
Posts: 23

Re: [SOLVED] Openbox crashes when alt-tabing steam games

I have not had a single crash all day. Nice work and much appreciated.  count me in as one of your several

Offline

#24 2023-03-21 15:43:07

Uhrenvergleich
Member
Registered: 2023-03-15
Posts: 2

Re: [SOLVED] Openbox crashes when alt-tabing steam games

The patched version from community-testing works for me since several hours.

Thanks to all contributors!

Offline

#25 2023-03-21 17:06:26

yan12125
Member
Registered: 2017-11-01
Posts: 36

Re: [SOLVED] Openbox crashes when alt-tabing steam games

Thank you all for confirming the fix! Generally two sign-offs are enough, so I moved openbox 3.6.1-10 to [community].

Offline

Board footer

Powered by FluxBB