After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 736260 - pbutils: assertion warnings after import of GstPbutils in Python (e.g. g_array_append_vals: assertion 'array' failed)
pbutils: assertion warnings after import of GstPbutils in Python (e.g. g_arra...
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-08 12:04 UTC by Felix Schwarz
Modified: 2018-01-10 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Felix Schwarz 2014-09-08 12:04:25 UTC
Whenever I import "GstPbutils" from Python I some warnings about failed assertions.

$ python
Python 2.7.5 (default, Jun 25 2014, 10:19:55) 
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GstPbutils
…/lib64/python2.7/site-packages/gi/module.py:178: Warning: g_array_append_vals: assertion 'array' failed
  g_type = info.get_g_type()
…/lib64/python2.7/site-packages/gi/module.py:178: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
…/lib64/python2.7/site-packages/gi/module.py:178: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
  g_type = info.get_g_type()
>>>
Comment 1 Tim-Philipp Müller 2014-09-08 12:11:56 UTC
could you run it in gdb with G_DEBUG=fatal_warnings and get a stack trace?
Comment 2 Felix Schwarz 2014-09-08 12:15:48 UTC
Actually the right component might be 'gst-editing-services' because this
happens when "info" is "ObjectInfo(EncodingVideoProfile)" but I don't feel
knowledgeable enough to figure that out.

I tried getting a core dump but it seems that my install (jhbuild/git) is missing debugging symbols. Any hint how I can tell jhbuild that it should retain all symbols?
Comment 3 Felix Schwarz 2014-09-08 12:31:07 UTC
Actually I managed to get a part of the trace which might be already enough for you to figure out what's going on:

  • #0 g_logv
    from /lib64/libglib-2.0.so.0
  • #1 g_log
    from /lib64/libglib-2.0.so.0
  • #2 g_array_append_vals
    from /lib64/libglib-2.0.so.0
  • #3 gst_value_register
    at gstvalue.c line 5026
  • #4 gst_encoding_profile_get_type
    at encoding-profile.c line 248
  • #5 gst_encoding_video_profile_get_type
    at encoding-profile.c line 608
  • #6 g_registered_type_info_get_g_type
    at girepository/giregisteredtypeinfo.c line 152
  • #7 _wrap_g_registered_type_info_get_g_type
    at pygi-info.c line 1265
  • #8 call_function
    at /usr/src/debug/Python-2.7.5/Python/ceval.c line 4082
  • #9 PyEval_EvalFrameEx
    at remote 0x1129110>, name='EncodingVideoProfile', info=<ObjectInfo at remote 0x111c530>), throwflag=throwflag@entry=0) at /usr/src/debug/Python-2.7.5/Python/ceval.c line 2740

Comment 4 Sebastian Dröge (slomo) 2014-09-08 15:42:17 UTC
You need to run Gst.init() before that import apparently, not great
Comment 5 Felix Schwarz 2014-09-08 23:29:34 UTC
(In reply to comment #4)
> You need to run Gst.init() before that import apparently, not great

Thank you very much for that. Is that considered as a "good enough" workaround or should I keep the bug open?
Comment 6 Sebastian Dröge (slomo) 2014-09-12 12:12:38 UTC
No, importing modules should always be possible without having to call any functions before that.

Not sure why it doesn't work out of the box though. The GI information for PbUtils says that gst_init(NULL, NULL) must be called.

> --add-init-section="gst_init(NULL,NULL);"

Probably a bug in pygi.
Comment 7 Christoph Reiter (lazka) 2014-09-12 13:09:51 UTC
The bug is that gst-python doesn't doesn't call gst_init() in the overrides while accessing types.

http://cgit.freedesktop.org/gstreamer/gst-python/commit/?id=9d1666ad0758617df6921d6ebd5dd802350e7148

If you don't depend on gst-python I'd recommend this before any import:

import sys
sys.modules["gi.overrides.Gst"] = None
sys.modules["gi.overrides.GstPbutils"] = None

also because the overrides break the pygobject provided API if installed.
Comment 8 GNOME Infrastructure Team 2018-01-10 20:46:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME'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.gnome.org/GNOME/pygobject/issues/83.