You are not logged in.

#1 2012-10-31 06:52:03

pingpong
Member
From: Los Angeles
Registered: 2010-12-30
Posts: 104

[Solved] Openbox fails to exit back to prompt after upgrade

I don't use any login manager so I simply boot to a console and start openbox manually via xinit.

However, after upgrade OpenBox fails to exit back to the login console. Anyone experiencing the same? Any idea on how to fix it?

Several programs got updated recently, xinit, openbox,... so I don't know what exactly is causing the problem...

I also have xmonad but that still works fine. So if I have to guess it's openbox's (3.5.0) issue.

Last edited by pingpong (2012-11-01 03:33:29)

Offline

#2 2012-10-31 07:15:54

pingpong
Member
From: Los Angeles
Registered: 2010-12-30
Posts: 104

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Let me add. I can quit to console only by manually killing the process

/usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX

Offline

#3 2012-10-31 15:18:04

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 419

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Got the same issue now


Certified Android Junkie
Arch 64

Offline

#4 2012-10-31 15:44:23

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,681

Re: [Solved] Openbox fails to exit back to prompt after upgrade

More on the openbox fails to exit issue can be found here:

https://bbs.archlinux.org/viewtopic.php?id=151304


oz

Offline

#5 2012-10-31 17:22:24

fritz
Member
Registered: 2011-06-17
Posts: 38

Re: [Solved] Openbox fails to exit back to prompt after upgrade

smakked wrote:

Got the same issue now

Same here. (Starting with startx)
BTW: LXDE using the same openbox-installation does not have this issue.

Last edited by fritz (2012-11-01 06:20:22)


Celeron 1610, Intel B75, 4GB Ram, Intel HD-Graphics

Offline

#6 2012-10-31 20:43:49

ATmega328
Member
Registered: 2012-10-31
Posts: 11

Re: [Solved] Openbox fails to exit back to prompt after upgrade

I managed to kluge something that works. However, I am not all that sure where the problem originally comes from. I have a suspicion (without any real foundation) it is related to this problem:

https://mail.gnome.org/archives/gtk-app … 00073.html

Anyway, here is how I got it working (developers will want to fix it some other way)

Go to the source code in openbox-3.5.0/openbox/openbox.c 

If you don't have the source you can get it here:
http://openbox.org/wiki/Openbox:Download

In the file openbox.c you will find that the functions ob_exit  is using
g_main_loop_quit in order to quit. I think that the threading problem referred to above might occur here.
If not, whatever, an exit(0) after it will work.
Instead, I went a bit further and replaced this with:
g_main_loop_unref
which used to be the main_loop_destroy function and then put an exit(0); after that for good measure :]

Now get rid of the openbox you already have (pacman -R openbox) and then

./configure, make, and make install the one you just modified.

Your openbox should now exit.

Here is what my ob_exit function looks like now:

void ob_exit(gint code)
{
     exitcode = code;
     g_main_loop_unref(ob_main_loop);
     exit(0);
}

This is not a real solution, but better than kill -9 at least until the real openbox guys do a real fix.

Last edited by ATmega328 (2012-11-01 00:41:52)

Offline

#7 2012-11-01 00:21:21

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Thanks for your efforts. It would be better to create a patch and apply it using makepkg and a modified version of the official openbox PKGBUILD - this would create an openbox package that includes your fix, which could be managed by pacman in the usual way.

Offline

#8 2012-11-01 00:52:33

ATmega328
Member
Registered: 2012-10-31
Posts: 11

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Thanks! But although my solution works and openbox will now exit every time you press the logout button in the menu, it may not be exiting very cleanly. Sticking an exit(0) in there is not very elegant. I am going to read through all of the code and see if I can find something better but I am not very experienced at glib stuff. My hope is that the developers will properly fix it soon but until then people will at least have something that works. Probably people would get mad if I made a patch out of a klugey solution?

Last edited by ATmega328 (2012-11-01 00:56:12)

Offline

#9 2012-11-01 02:13:57

mervinb
Member
Registered: 2011-11-19
Posts: 20

Re: [Solved] Openbox fails to exit back to prompt after upgrade

I posted a similar reply on the other thread, but noticed that was for [testing].

My kludge is to alter my logout script. It used to have 'kill $OPENBOX_PID'. Now it has 'kill $OPENBOX_PID; kill -9 $OPENBOXPID'.

I'd definitely prefer Openbox be patched in a proper way which allows original scripts to work. On my this also affects oblogout, and menus for various panel systems, so a more holistic fix is definitely worth waiting for.

Offline

#10 2012-11-01 03:34:31

pingpong
Member
From: Los Angeles
Registered: 2010-12-30
Posts: 104

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Since solutions are given, I mark it solved.

Offline

#11 2012-11-01 03:38:28

gerryxiao
Member
Registered: 2012-11-01
Posts: 1

Re: [Solved] Openbox fails to exit back to prompt after upgrade

get same problem here

Offline

#12 2012-11-01 07:34:15

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 62
Website

Re: [Solved] Openbox fails to exit back to prompt after upgrade

@ATmega328

Have you reported the problem and perhaps your solution upstream? I guess Dana Jansens(developer of Openbox) can help with that issue... Thanks for your fix.

Offline

#13 2012-11-01 14:56:45

ATmega328
Member
Registered: 2012-10-31
Posts: 11

Re: [Solved] Openbox fails to exit back to prompt after upgrade

@demaio

I am new here and so I don't know how to do that. Should I email him?
Also, I am interested to know if anyone else here has actually used my fix?

Offline

#14 2012-11-01 15:22:49

freud_zoid
Member
Registered: 2011-08-12
Posts: 33

Re: [Solved] Openbox fails to exit back to prompt after upgrade

ATmega328 wrote:

@demaio

I am new here and so I don't know how to do that. Should I email him?
Also, I am interested to know if anyone else here has actually used my fix?

I did using the ABS and it works fine, thank you for figuring it out.

Last edited by freud_zoid (2012-11-01 15:33:19)

Offline

#15 2012-11-01 16:11:42

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Solved] Openbox fails to exit back to prompt after upgrade

ATmega328, see the Bug Reports section here.

Offline

#16 2012-11-01 17:34:34

ma
Member
Registered: 2012-01-29
Posts: 47

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Someone has reported it. See bug 5793.

Offline

#17 2012-11-01 17:47:32

ATmega328
Member
Registered: 2012-10-31
Posts: 11

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Ya that was me. I just followed tomk's link.

Offline

#18 2012-11-02 00:52:15

martadinata
Member
Registered: 2012-01-26
Posts: 25

Re: [Solved] Openbox fails to exit back to prompt after upgrade

well, okay for your effort,,, it fixed now...

Offline

#19 2012-11-02 11:22:06

Barthalion
Developer
From: Poland
Registered: 2010-02-26
Posts: 109

Re: [Solved] Openbox fails to exit back to prompt after upgrade

While ATmega328's patch fixes the logout issue, it makes problems related to restarting Openbox. E.g. try to change the number of virtual desktops under Obconf and modify something using Obkey -- you will get DM screen.


Arch Linux - rolling release distro, which users want to downgrade to the previous version

Offline

#20 2012-11-02 11:55:43

Antunes
Member
Registered: 2012-07-15
Posts: 20

Re: [Solved] Openbox fails to exit back to prompt after upgrade

I think this should not be marked as solved yet. It is a serious bug in openbox that is still waiting to be fixed. Let us see what the devs say on the bug tracker. Thanks for reporting it.

Offline

#21 2012-11-02 12:08:08

n125
Member
Registered: 2011-12-30
Posts: 38

Re: [Solved] Openbox fails to exit back to prompt after upgrade

In another thread it was suggested that you could exit Openbox with "pkill -KILL openbox". It seems to work for me, but are there any disadvantages or consequences to this method?

Offline

#22 2012-11-02 12:24:25

Barthalion
Developer
From: Poland
Registered: 2010-02-26
Posts: 109

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Because it's not the solution. You can also halt your computer using power switch, but nobody said that's preferred (and correct!) method.

Last edited by Barthalion (2012-11-02 15:02:05)


Arch Linux - rolling release distro, which users want to downgrade to the previous version

Offline

#23 2012-11-02 13:26:43

ATmega328
Member
Registered: 2012-10-31
Posts: 11

Re: [Solved] Openbox fails to exit back to prompt after upgrade

It is because exit(0) is not the proper way to exit (as I mentioned above) as it doesn't clean things up properly. I was hoping that putting the unref in there first would do it, but apparently that doesn't do it. Or maybe doesn't have the time before exit(0) kills it. I dunno. However, it works until they fix the actual problem. I am still searching for the source of the problem, but I am having to learn glibc to do it. I will be very interested to look at the "fixed" code once the smarter guys figure it out and patch it. I still think it has to do with the threading problem I linked to above...

Another way to see this is that if you remove just the exit(0) you will see that it will exit some of the time -- still improperly though since it throws a signal "all your base are belong to us" core dump signal from /obt/signal.c. Sometimes you have to click logout a couple of times first. (The reason for the exit(0) is that the other half of the time it doesn't). I guess i should have used exit(1) wink

Last edited by ATmega328 (2012-11-02 17:03:31)

Offline

#24 2012-11-02 15:01:09

ma
Member
Registered: 2012-01-29
Posts: 47

Re: [Solved] Openbox fails to exit back to prompt after upgrade

Hm, here's a backtrace after running openbox --exit:

#0  0xb76e0424 in __kernel_vsyscall ()
#1  0xb70ba422 in __lll_lock_wait () from /usr/lib/libpthread.so.0
#2  0xb70b5e82 in _L_lock_675 () from /usr/lib/libpthread.so.0
#3  0xb70b5e17 in pthread_mutex_lock () from /usr/lib/libpthread.so.0
#4  0xb7231cf4 in pthread_mutex_lock () from /usr/lib/libc.so.6
#5  0xb7634c10 in g_mutex_lock () from /usr/lib/libglib-2.0.so.0
#6  0xb6fe8348 in ?? () from /usr/lib/libpangoxft-1.0.so.0
#7  0xb6fe87a7 in pango_xft_shutdown_display () from /usr/lib/libpangoxft-1.0.so.0
#8  0xb6fe8887 in ?? () from /usr/lib/libpangoxft-1.0.so.0
#9  0xb748d0f3 in XCloseDisplay () from /usr/lib/libX11.so.6
#10 0xb72e5d86 in obt_display_close () from /usr/lib/libobt.so.0
#11 0x0805487e in main ()

So openbox is calling XCloseDisplay() but it never returns because Pango is stuck trying to clean up?!

Edit: Others noticed it too: https://bugzilla.redhat.com/show_bug.cgi?id=802086#c6

Edit 2: Are there any programmers here? Does this look OK to you? close_display_cb() gets called when the X connection is closed, and it calls pango_xft_shutdown_display() while holding a lock on fontmaps. Then pango_xft_shutdown_display() immediately calls pango_xft_find_font_map(), which also tries to acquire a lock on the already locked fontmaps. Bang!

Last edited by ma (2012-11-02 16:12:05)

Offline

#25 2012-11-02 16:04:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [Solved] Openbox fails to exit back to prompt after upgrade

ma, the programmers you need are not here - they're the openbox guys. Add your comments, links, etc to the report that ATmega328 already opened in openbox's tracker.

Offline

Board footer

Powered by FluxBB