GNOME Bugzilla – Bug 751956
Crash in signal handler with GError parameter
Last modified: 2016-03-02 10:05:04 UTC
Created attachment 306833 [details] crashing example TingPing reported a crasher on IRC with code to reproduce. Example attached. The problem is that GUPnPIgd.SimpleIgd::error-mapping-port crashes. The cause is that the Python GError class gets instantiated as a GBoxed in the marshalling code and crashes when deallocated. I guess the fix is to add a special case for GError values in there. The following two patches improve the error handling so we get an error message instead of a crash in the future.
Created attachment 306834 [details] [review] GVariant: Don't use pyg_boxed_new as GVariant isn't a PyGBoxed but a PyGIStruct. This only worked because they share the same struct layout. This adds a new constructor for creating a new PyGIStruct instance from GType. ---- Note: this is needed first as the next patch exposed this error.
Created attachment 306835 [details] [review] Some error handling/reporting fixes. * Check in pyg_boxed_new() if the passed type is an actual subclass * Don't replace existing exceptions in pyg_value_as_pyobject() * Print an error in pyg_closure_marshal() in case marshalling an argument failed.
*** Bug 751941 has been marked as a duplicate of this bug. ***
Review of attachment 306834 [details] [review]: Seems fine to me. I've verified this new function is exercised multiple times by the test suite.
Review of attachment 306835 [details] [review]: Overall seems fine. Are there any signals in GLib, GObject, Regress, or GIMarshallingTests similar to GUPnPIgd.SimpleIgd::error-mapping-port which we may use to test these errors?
Review of attachment 306835 [details] [review]: I've verified that at least the change to pygi-value.c is exercised by: test_generictreemodel.TestReturnsAfterError
Thanks, pushed to master. I can't reproduce the crash/error case anymore :/
Is this ticket ok to close?
I guess so. At least we'll get an error in case this come sup again.