Hi Jonathan, I don't know if this is the problem but it looks like there are calls being made directly to a Gtk model within a Python thread which I can't image is ok (specifically in _library_artwork_update which is where the deadlock seems to occur). You might try wrapping the code within that function or any call to Gtk within it with calls to Gdk.threads_enter/exit: http://developer.gnome.org/gdk/unstable/gdk-Threads.html
Aside from that, I think using Gio instead of attempting to use Python threads and IO mixed with Gtk might help considerably with what you are trying to do. -Simon On Thu, Feb 28, 2013 at 8:01 AM, Jonathan Ballet <[email protected]> wrote: > Hi, > > I'm developing^Whacking on a Gtk application [1] which uses PyGObject > since a few months now. It's a client for the Music Player Daemon (mpd). > > Suddenly yesterday, I couldn't run it anymore: when I start it, the > application initialization at the very beginning is alright, Gtk.Appliction > "activate" signal is triggered and answered as usual, and then, everything > hangs. *Something* get stuck *somewhere* and I can't run the application > anymore... > I tried to put aside all the things that would come up to my mind, which > were: I didn't updated any libraries on my system, I stashed my current > changes, I switched back the application to master, "git clean -fdx"'d it, > switched off the player daemon, even restarted my computer in case a socket > or another daemon was off somewhere, and I quickly patched > threading.Thread(), threading.Condition() and GLib.idle_add() so they are > just stubs so remove potentially blocking things. > > I was just trying a new piece of code (which I reverted since then) and > I'm pretty sure I restarted the application just a couple of hours before > without any troubles. I used to do it several times a day for weeks, and > now, I'm really confused. > > So I fired up gdb and had a look at the result (see the attached file), > and I would say the application is stuck waiting for gdk_threads_dispatch() > to return (which seems to be waiting to get a lock) in the main thread (#1) > (There's another thread, waiting for a Condition to be released, but I'm > pretty sure it's not the faulty code since 1. it's in another thread, and > 2. it still hangs even if I remove this code). > > There are probably tons of places where the application abuses Gtk, > threads and stuff, and we are trying to sort things out one at a time, but > it used to work OK until now, when I don't have anything anymore. > > How can I get a clue on what's happening? I don't know where to look know, > and I'm as stuck as my application :( > > Any tips appreciated, > > Jonathan > > [1]: https://github.com/multani/**sonata<https://github.com/multani/sonata> > > _______________________________________________ > python-hackers-list mailing list > [email protected] > https://mail.gnome.org/mailman/listinfo/python-hackers-list > >
_______________________________________________ python-hackers-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/python-hackers-list
