Bug 9980 - check for exceptions every time we release the GIL in a GLib callback
Summary: check for exceptions every time we release the GIL in a GLib callback
Status: RESOLVED MOVED
Alias: None
Product: dbus
Classification: Unclassified
Component: python (show other bugs)
Version: unspecified
Hardware: Other All
: low minor
Assignee: Simon McVittie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-15 04:00 UTC by Simon McVittie
Modified: 2018-08-22 22:05 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2007-02-15 04:00:31 UTC
When a signal callback raises an exception (for instance, bind a 0-argument function to NameOwnerChanged so it raises TypeError), not only is the exception ignored (probably unavoidable), but no feedback is given. The exception should be printed to stderr like it was in dbus-python < 0.80.
Comment 1 Simon McVittie 2007-02-20 10:36:35 UTC
Partially fixed in git by adding a try/except around user code. The proper fix would be to check for exceptions each time we manipulate the interpreter/stack/GIL state in C, too.
Comment 2 Adam Jackson 2008-02-24 18:22:27 UTC
Mass reopen.  The "LATER" resolution is lame, I'm deleting it.  Consider LATER to have arrived.
Comment 3 Alban Crequy 2013-12-12 18:44:58 UTC
(In reply to comment #1)
> Partially fixed in git by adding a try/except around user code.

Is it this code?

dbus-python/dbus/connection.py:
    def maybe_handle_message(self, message):
    ...
        except:
            # basicConfig is a no-op if logging is already configured
            logging.basicConfig()
            _logger.error('Exception in handler for D-Bus signal:', exc_info=1)
Comment 4 Simon McVittie 2013-12-16 11:39:17 UTC
Yes. There might be other places where a GLib mainloop callback calls into Python; they would need similar logging, or preferably, the equivalent in C code as described in Comment #1.
Comment 5 GitLab Migration User 2018-08-22 22:05:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus-python/issues/17.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.