GNOME Bugzilla – Bug 672763
Floating point exception in Gtk.Grid() if grid emptied
Last modified: 2012-03-24 21:24:59 UTC
I have a GTK3 python program I am developing. I need to change the look of the window based on the type of activity the user is doing. I'm using a Gtk.Grid() object that I was planning on just calling widget.hide() on the things I need to appear and widget2.show() on the ones I need to show for the change. I need to remove everything from a Gtk.Grid() and repopulate the grid with new widgets so at one point, the grid would be emptied. An example of the GUI interface is this ______________________ | Label1 | Button | | Label2 | | | Label3 | | ______________________ When I click on button, calls an iterable object I have created that calls Label1.hide(), etc. The interface is an horizontal Gtk.Box() with a grid for the labels on the left and then the button object on the right. When I get to the last Label3 and then Click the "Button" button, the program unexpectedly exits with this as output: " Floating point exception " I did a gdb on it and received this info: " Program received signal SIGFPE, Arithmetic exception. 0x00007ffff33a6b86 in gtk_grid_request_allocate (request=0x7fffffffc0c0, orientation=<optimized out>, total_size=0) at /tmp/buildd/gtk+3.0-3.2.3/./gtk/gtkgrid.c:992 992 /tmp/buildd/gtk+3.0-3.2.3/./gtk/gtkgrid.c: No such file or directory. " This seems to be a bug. Is it in fact? What else can I do to help (I'm not a C programmer so I can't help in that vain)?
Could you get a complete stacktrace with debug information ?
Sure, can you walk me through how to do that? To get the above error, I ran: $ gdb python Then from gdb did (gdb) run then from python, imported my program and ran it to get the above error. My version of gdb wasn't compiled with --with-python, so I can't run the python program via #! /usr/bin/gdb -P. Also, python-gdb is not in my package repo. I am using Debian testing. My apologies for being very much a noob at debugging like this.
The following fixes have been pushed: 32c7cdd testgrid: add a testcase ed17c74 grid: avoid a floating point exception
Created attachment 210532 [details] [review] testgrid: add a testcase Add a testcase for an empty, homogeneous grid.
Created attachment 210533 [details] [review] grid: avoid a floating point exception When a homogeneous grid has no visible children, we were accidentally doing a division by zero. Instead, just bail out early in this case, there is nothing to allocate anyway.
(In reply to comment #3) > The following fixes have been pushed: > 32c7cdd testgrid: add a testcase > ed17c74 grid: avoid a floating point exception Rats! I did a search for this error, too. Glad it is fixed. I'll do a work-around for now, but will be glad for the libgtk upgrade when me distro pushes it.