v1.1.0 crashes upon exit

Thanks Ben!

I just updated my Macports and it brought in v1.1.0 so I will check it out for easier animation.

In the meantime I notice that with MPL v1.1.0 the program crashes at the end a most of my old MPL example programs (I use the GTKAgg backend for all of them). A typical way to end the program is:

gtk.main_quit()

raise SystemExit

and it crashes on the call the ''raise SystemExit". A typical output is

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)’ failed

self.toolbar.destroy()

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552: GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)’ failed

self.toolbar.destroy()

Any thoughts are appreciated!

thanks again,

john

Hi,

In the meantime I notice that with MPL v1.1.0 the program crashes at the end
a most of my old MPL example programs (I use the GTKAgg backend for all of
them). A typical way to end the program is:

        gtk\.main\_quit\(\)

        raise SystemExit

and it crashes on the call the ''raise SystemExit". A typical output is

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed

self.toolbar.destroy()

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)'
failed

self.toolbar.destroy()

it happens also on Debian:

$ python
Python 2.7.2+ (default, Oct 5 2011, 10:41:47)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
plt.plot((1,2), (2,4))

[<matplotlib.lines.Line2D object at 0x2f7e6d0>]

plt.show()

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET
(widget)' failed
  self.toolbar.destroy()
/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET
(widget)' failed
  self.toolbar.destroy()
Segmentation fault

Cheers,

···

On Wed, Nov 2, 2011 at 18:12, John Jameson <jwing45@...287...> wrote:
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

I'm not able to reproduce this, but I've seen similar issues in the past. Can you tell me if this patch fixes it for you?

diff --git a/lib/matplotlib/backends/backend_gtk.py b/lib/matplotlib/backends/backend
index 1012bbe..2efb72a 100644
--- a/lib/matplotlib/backends/backend_gtk.py
+++ b/lib/matplotlib/backends/backend_gtk.py
@@ -556,6 +556,10 @@ class FigureManagerGTK(FigureManagerBase):
              self.window.destroy()
          if hasattr(self, 'canvas'):
              self.canvas.destroy()
+ del self.toolbar
+ del self.vbox
+ del self.window
+ del self.canvas
          self.__dict__.clear() #Is this needed? Other backends don't have it.

          if Gcf.get_num_fig_managers()==0 and \

···

On 11/02/2011 01:23 PM, Sandro Tosi wrote:

Hi,

On Wed, Nov 2, 2011 at 18:12, John Jameson<jwing45@...287...> wrote:

In the meantime I notice that with MPL v1.1.0 the program crashes at the end
a most of my old MPL example programs (I use the GTKAgg backend for all of
them). A typical way to end the program is:

             gtk.main_quit()

             raise SystemExit

and it crashes on the call the ''raise SystemExit". A typical output is

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed

   self.toolbar.destroy()

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)'
failed

   self.toolbar.destroy()

it happens also on Debian:

$ python
Python 2.7.2+ (default, Oct 5 2011, 10:41:47)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
plt.plot((1,2), (2,4))

[<matplotlib.lines.Line2D object at 0x2f7e6d0>]

plt.show()

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET
(widget)' failed
   self.toolbar.destroy()
/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET
(widget)' failed
   self.toolbar.destroy()
Segmentation fault

Cheers,

I'm not able to reproduce this, but I've seen similar issues in the
past. Can you tell me if this patch fixes it for you?

Nope, it doesn't.

···

On Wed, Nov 2, 2011 at 20:39, Michael Droettboom <mdroe@...86...> wrote:

diff --git a/lib/matplotlib/backends/backend_gtk.py
b/lib/matplotlib/backends/backend
index 1012bbe..2efb72a 100644
--- a/lib/matplotlib/backends/backend_gtk.py
+++ b/lib/matplotlib/backends/backend_gtk.py
@@ -556,6 +556,10 @@ class FigureManagerGTK(FigureManagerBase):
self.window.destroy()
if hasattr(self, 'canvas'):
self.canvas.destroy()
+ del self.toolbar
+ del self.vbox
+ del self.window
+ del self.canvas
self.__dict__.clear() #Is this needed? Other backends don't
have it.

     if Gcf\.get\_num\_fig\_managers\(\)==0 and \\

On 11/02/2011 01:23 PM, Sandro Tosi wrote:

Hi,

On Wed, Nov 2, 2011 at 18:12, John Jameson<jwing45@...287...> wrote:

In the meantime I notice that with MPL v1.1.0 the program crashes at the end
a most of my old MPL example programs (I use the GTKAgg backend for all of
them). A typical way to end the program is:

         gtk\.main\_quit\(\)

         raise SystemExit

and it crashes on the call the ''raise SystemExit". A typical output is

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_unrealize: assertion `GTK_IS_WIDGET (widget)' failed

self.toolbar.destroy()

/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:552:
GtkWarning: gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET (widget)'
failed

self.toolbar.destroy()

it happens also on Debian:

$ python
Python 2.7.2+ (default, Oct 5 2011, 10:41:47)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
plt.plot((1,2), (2,4))

[<matplotlib.lines.Line2D object at 0x2f7e6d0>]

plt.show()

/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_unrealize: assertion `GTK_IS_WIDGET
(widget)' failed
self.toolbar.destroy()
/usr/lib/pymodules/python2.7/matplotlib/backends/backend_gtk.py:552:
GtkWarning: IA__gtk_widget_is_toplevel: assertion `GTK_IS_WIDGET
(widget)' failed
self.toolbar.destroy()
Segmentation fault

Cheers,

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

Just yesterday, I started getting a crash-on-exit error for GTK. The only thing I changed was to update my system-wide packages, which I think included some updates for gtk-related things. Maybe something there broke something?

Ben Root

···

On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi <morph@…10…> wrote:

On Wed, Nov 2, 2011 at 20:39, Michael Droettboom <mdroe@…86…> wrote:

I’m not able to reproduce this, but I’ve seen similar issues in the

past. Can you tell me if this patch fixes it for you?

Nope, it doesn’t.

Oh sure, it could be - I just wanted to state that also on Debian we
have a similar problem than the one on Mac OS X, the tricky part is
identify what that is :slight_smile:

Cheers,

···

On Wed, Nov 2, 2011 at 21:00, Benjamin Root <ben.root@...1304...> wrote:

On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi <morph@...10...> wrote:

On Wed, Nov 2, 2011 at 20:39, Michael Droettboom <mdroe@...86...> wrote:
> I'm not able to reproduce this, but I've seen similar issues in the
> past. Can you tell me if this patch fixes it for you?

Nope, it doesn't.

Just yesterday, I started getting a crash-on-exit error for GTK. The only
thing I changed was to update my system-wide packages, which I think
included some updates for gtk-related things. Maybe something there broke
something?

--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

Here is what got updated yesterday from my logs:

Nov 01 09:37:29 Updated: gtk2-2.24.7-1.fc15.x86_64
Nov 01 09:37:32 Updated: initscripts-9.30.1-1.fc15.x86_64
Nov 01 09:37:33 Updated: sssd-client-1.5.14-3.fc15.x86_64

Nov 01 09:37:33 Updated: libipa_hbac-1.5.14-3.fc15.x86_64
Nov 01 09:37:54 Updated: selinux-policy-3.9.16-44.fc15.noarch
Nov 01 09:38:22 Updated: selinux-policy-targeted-3.9.16-44.fc15.noarch
Nov 01 09:38:24 Updated: sssd-1.5.14-3.fc15.x86_64

Nov 01 09:38:25 Updated: 1:microcode_ctl-1.17-19.fc15.x86_64
Nov 01 09:38:25 Updated: gtk2-immodule-xim-2.24.7-1.fc15.x86_64
Nov 01 09:38:27 Updated: gtk2-devel-2.24.7-1.fc15.x86_64
Nov 01 09:38:30 Updated: firefox-7.0.1-3.fc15.x86_64

Nov 01 09:38:32 Updated: gtk2-devel-docs-2.24.7-1.fc15.x86_64
Nov 01 09:38:33 Updated: gdb-7.3.1-45.fc15.x86_64
Nov 01 09:38:43 Updated: system-config-date-1.9.67-1.fc15.noarch
Nov 01 09:38:44 Updated: gnome-shell-3.0.2-6.fc15.x86_64

Nov 01 09:38:45 Updated: latexmk-4.27a-1.fc15.noarch
Nov 01 09:38:45 Updated: 1:obex-data-server-0.4.6-1.fc15.x86_64

So, I see gtk2-2.24.7-1, which looks like a bug-fix release. Maybe this is helpful?

Ben Root

···

On Wed, Nov 2, 2011 at 3:33 PM, Sandro Tosi <morph@…10…> wrote:

On Wed, Nov 2, 2011 at 21:00, Benjamin Root <ben.root@…1304…> wrote:

On Wed, Nov 2, 2011 at 2:50 PM, Sandro Tosi <morph@…10…> wrote:

On Wed, Nov 2, 2011 at 20:39, Michael Droettboom <mdroe@…86…> wrote:

I’m not able to reproduce this, but I’ve seen similar issues in the

past. Can you tell me if this patch fixes it for you?

Nope, it doesn’t.

Just yesterday, I started getting a crash-on-exit error for GTK. The only

thing I changed was to update my system-wide packages, which I think

included some updates for gtk-related things. Maybe something there broke

something?

Oh sure, it could be - I just wanted to state that also on Debian we

have a similar problem than the one on Mac OS X, the tricky part is

identify what that is :slight_smile:

Cheers,