GNOME Bugzilla – Bug 678914
[PATCH] Segfault with typelib and library out-of-sync (interface vs class)
Last modified: 2012-07-11 06:25:51 UTC
Created attachment 217318 [details] [review] Add error-checking for the case where _arg_cache_new fails I spent an hour or so with a colleague (dwalsh) debugging a segfault with pygobject, which turned out to be due to a typelib and its underlying library being out-of-sync. I'm attaching a patch which converts the segfault into a traceback; in our case here's the traceback we received: Traceback (most recent call last):
+ Trace 230440
args.func(args)
container.start()
console = context.get_log_console()
return info.invoke(*args, **kwargs)
return getattr(self._introspection_module, name)
wrapper = metaclass(name, bases, dict_)
register_interface_info(cls.__info__.get_g_type())
which immediately told us what the problem was, whereas previously it segfaulted trying to write though a NULL return_cache at: return_cache->is_skipped = g_callable_info_skip_return (callable_info); within _args_cache_generate.
Review of attachment 217318 [details] [review]: We should do that for all the other places where _arg_cache_new is used then Or should we assert that arg_cache_new may never return NULL? A quick look a _arg_cache_new seems indeed to indicate that the code may return NULL legally, but I am not very familiar with this code
While this might not be complete, it looks correct to me and already helpful, so I pushed the patch. Thanks!