Bug 2262 - Anjuta 2.0.0 makes openbox crash when maximizing/resizing
Status: CLOSED FIXED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.2
Hardware: PC Linux
: P2 major
Assignee: Mikachu
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2005-05-18 20:31 EDT by Mathieu Pillard
Modified: 2007-03-18 12:21:49 EDT
0 users

See Also:



Description Mathieu Pillard 2005-05-18 20:31:29 EDT
System: Ubuntu Hoary, openbox 3.2 from the ubuntu packages

Steps to reproduce:
* Compile anjuta 2.0.0 from anjuta.sf.net.
* Run it
* Maximize the window, and witness openbox crash (signal 8).

Although anjuta 2.0.0 is considered by its developpers to be alpha quality and
not ready for production use, I believe ob shouldnt crash here. If anjuta is
doing something really really wrong, it should probably just ignore it, and emit
some warning, not crash.

I can reproduce the crash everytime I maximize the main anjuta window, and this
does not happen with metacity. I have never seen this before with any other
application, and couldn't find any open nor closed bug about this kind of problem.

I'll try to reproduce this bug on different setups, and attach a coredump later.
Comment 1 Mathieu Pillard 2005-05-19 08:00:34 EDT
I succesfully reproduced the crash on a gentoo box with openbox 3.3rc a few
minutes ago. This is worse than I thought, because a simple window resize
triggered it.

I'm going to recompile openbox with debugging symbols on this box so I can
provide a meaningful stacktrace.
Comment 2 Mathieu Pillard 2005-05-19 09:05:03 EDT
Here is the backtrace and some additional info from gdb:

(gdb) run

Starting program: /home/mat/perso/openbox-3.2/openbox/.libs/openbox 

[Thread debugging using libthread_db enabled]

[New Thread 16384 (LWP 16656)]



Program received signal SIGFPE, Arithmetic exception.

[Switching to Thread 16384 (LWP 16656)]

client_configure_full (self=0x81b1728, anchor=OB_CORNER_TOPLEFT, x=12, y=31, 

    w=0, h=391, user=1, final=0, force_reply=0) at client.c:2043

2043	        w /= self->size_inc.width;

(gdb) bt

#0  client_configure_full (self=0x81b1728, anchor=OB_CORNER_TOPLEFT, x=12, 

    y=31, w=0, h=391, user=1, final=0, force_reply=0) at client.c:2043

#1  0x08068ba2 in do_resize (resist=0) at moveresize.c:228

#2  0x08068d5a in moveresize_event (e=0x278) at moveresize.c:305

#3  0x0805eef9 in event_process (ec=0x0, data=0x0) at event.c:526

#4  0x080652bf in ob_main_loop_run (loop=0x8083230) at mainloop.c:313

#5  0x08069ade in main (argc=1, argv=0xafffeb44) at openbox.c:274

(gdb) p self->size_inc

$1 = {width = 0, height = 0}

(gdb) p w

$2 = 0

(gdb)
Comment 3 Mikachu 2006-08-02 10:27:28 EDT
does this patch fix the problem? (against cvs, but you should be able to write it in manually)

Index: openbox/client.c
===================================================================
RCS file: /cvs/cvsroot/openbox/openbox/client.c,v
retrieving revision 1.358
diff -p -u -d -r1.358 client.c
--- openbox/client.c	2 Aug 2006 06:07:12 -0000	1.358
+++ openbox/client.c	2 Aug 2006 14:24:50 -0000
@@ -1234,7 +1234,7 @@ void client_update_normal_hints(ObClient
         if (size.flags & PBaseSize)
             SIZE_SET(self->base_size, size.base_width, size.base_height);
     
-        if (size.flags & PResizeInc)
+        if (size.flags & PResizeInc && size.width_inc && size_height_inc)
             SIZE_SET(self->size_inc, size.width_inc, size.height_inc);
     }
 }
Comment 4 Mikachu 2006-08-02 17:10:26 EDT
well, i committed this and i am pretty sure it will work.
Comment 5 Mathieu Pillard 2006-08-02 17:13:25 EDT
I'll test this as soon as I can.