PyGObject segfaults/aborts when reading/writing [respectively] a GObject pointer property that's been annotated to a GCallback
Submitted by C Anthony
Link to original bug (#670863)
Description
SUMMARY: PyGObject segfaults/aborts when reading/writing [respectively] a GObject pointer property that's been annotated to a GCallback (or any other function/signature)
SIGSEGV on read [G_DEBUG=fatal-warnings]
(Pdb) [...] (Pdb) print self.listener.props.hicallback
** CRITICAL **: g_registered_type_info_get_g_type: assertion `GI_IS_REGISTERED_TYPE_INFO (info)' failed
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff57da0d3 in g_logv () from /usr/lib/libglib-2.0.so.0
(gdb) bt full
#0 0x00007ffff57da0d3 in g_logv () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#1 0x00007ffff57da462 in g_log () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#2 0x00007ffff6704e89 in g_registered_type_info_get_g_type (info=0xc57000) at girepository/giregisteredtypeinfo.c:132
type_init = 0x7ffff7e2e230 "\200"
get_type_func = 0x7ffff7e2e230
rinfo = 0xc57000
__PRETTY_FUNCTION__ = "g_registered_type_info_get_g_type"
#3 0x00007ffff6949811 in pygi_get_property_value_real (instance=0xce0af0, attr_name=0xd19744 "hicallback") at pygi-property.c:155
info = 0xc57000
info_type = GI_INFO_TYPE_INVALID
type = 140737286499889
g_type = 13179888
property_info = 0xc4fb20
property_name = 0xd5b150 "hicallback"
pspec = 0xc4fa80
value = {
g_type = 68,
data = {{
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}, {
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}}
}
arg = {
v_boolean = 0,
v_int8 = 0 '\000',
v_uint8 = 0 '\000',
v_int16 = 0,
v_uint16 = 0,
v_int32 = 0,
v_uint32 = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_short = 0,
v_ushort = 0,
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_ssize = 0,
v_size = 0,
v_string = 0x0,
v_pointer = 0x0
}
py_value = 0x0
type_info = 0xc572d0
transfer = GI_TRANSFER_NOTHING
type_tag = GI_TYPE_TAG_INTERFACE
#4 0x00007ffff3f74ad8 in pygi_get_property_value (instance=0xce0af0, attr_name=0xd19744 "hicallback") at ../../gi/pygi.h:122
No locals.
#5 0x00007ffff3f7507b in PyGProps_getattro (self=0xd172d0, attr=0xd19720) at pygobject.c:240
attr_name = 0xd19744 "hicallback"
class = 0xd5a730
pspec = 0xd22750
value = {
g_type = 0,
data = {{
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}, {
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}}
}
ret = 0xd0b645
#6 0x00007ffff7af9f71 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
No symbol table info available.
#7 0x00007ffff7afe86f in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
No symbol table info available.
[...]
-------------------------------------------------------------------------------
SIGABRT on write
(Pdb) [...] (Pdb) self.listener.props.hicallback = lambda *x: x ** ERROR:pygi-argument.c:1022:_pygi_argument_from_object: code should not be reached
Program received signal SIGABRT, Aborted.
0x00007ffff7496975 in raise () from /lib/libc.so.6
(gdb) bt full
#0 0x00007ffff7496975 in raise () from /lib/libc.so.6
No symbol table info available.
#1 0x00007ffff7497deb in abort () from /lib/libc.so.6
No symbol table info available.
#2 0x00007ffff57f526d in g_assertion_message () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#3 0x00007ffff6944136 in _pygi_argument_from_object (object=0xd08320, type_info=0xc576d0, transfer=GI_TRANSFER_NOTHING) at pygi-argument.c:1022
info = 0xc57400
info_type = GI_INFO_TYPE_CALLBACK
arg = {
v_boolean = 0,
v_int8 = 0 '\000',
v_uint8 = 0 '\000',
v_int16 = 0,
v_uint16 = 0,
v_int32 = 0,
v_uint32 = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_short = 0,
v_ushort = 0,
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_ssize = 0,
v_size = 0,
v_string = 0x0,
v_pointer = 0x0
}
type_tag = GI_TYPE_TAG_INTERFACE
__PRETTY_FUNCTION__ = "_pygi_argument_from_object"
#4 0x00007ffff6949b58 in pygi_set_property_value_real (instance=0xce0af0, attr_name=0xd19744 "hicallback", py_value=0xd08320) at pygi-property.c:249
g_type = 13179856
property_info = 0xc4ff20
property_name = 0xd46ab0 "hicallback"
type_info = 0xc576d0
type_tag = 4154881201
transfer = GI_TRANSFER_NOTHING
value = {
g_type = 0,
data = {{
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}, {
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_pointer = 0x0
}}
}
arg = {
v_boolean = 0,
v_int8 = 0 '\000',
v_uint8 = 0 '\000',
v_int16 = 0,
v_uint16 = 0,
v_int32 = 0,
v_uint32 = 0,
v_int64 = 0,
v_uint64 = 0,
v_float = 0,
v_double = 0,
v_short = 0,
v_ushort = 0,
v_int = 0,
v_uint = 0,
v_long = 0,
v_ulong = 0,
v_ssize = 0,
v_size = 0,
v_string = 0x0,
v_pointer = 0x0
}
pspec = 0xc4fe80
ret_value = -1
#5 0x00007ffff3f74b1e in pygi_set_property_value (instance=0xce0af0, attr_name=0xd19744 "hicallback", value=0xd08320) at ../../gi/pygi.h:133
No locals.
#6 0x00007ffff3f7540a in PyGProps_setattro (self=0xd17310, attr=0xd19720, pvalue=0xd08320) at pygobject.c:338
pspec = 0x7ffff7f57f60
attr_name = 0xd19744 "hicallback"
obj = 0x7ffff7aa1eea
ret = -1
#7 0x00007ffff7aa1bc7 in PyObject_SetAttr () from /usr/lib/libpython2.7.so.1.0
No symbol table info available.
#8 0x00007ffff7af9fa5 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
No symbol table info available.
[...]
-------------------------------------------------------------------------------
source header
typedef void (WebKitDOMEventListenerCallback) (WebKitDOMEvent event);
[...]
/**
- WebKitDOMEventListener:hicallback:
- Type: WebKitDOMEventListenerCallback */