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 549945 - pygobject has memory problems
pygobject has memory problems
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-30 14:47 UTC by Gustavo Carneiro
Modified: 2008-08-30 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log (28.18 KB, text/plain)
2008-08-30 14:47 UTC, Gustavo Carneiro
Details

Description Gustavo Carneiro 2008-08-30 14:47:26 UTC
On my system (python 2.4.5 configure with --with-pydebug --without-pymalloc), running "python -c 'import gobject'" will cause libc to complain about double free corruption.  Running with valgrind also shows memory errors.
Comment 1 Gustavo Carneiro 2008-08-30 14:47:53 UTC
Created attachment 117642 [details]
valgrind log
Comment 2 Paul Pogonyshev 2008-08-30 17:44:22 UTC
Do you have 64-bit machine?
Comment 3 Gustavo Carneiro 2008-08-30 18:08:48 UTC
Of course ;-)
Comment 4 Paul Pogonyshev 2008-08-30 18:15:49 UTC
I guess it is architecture-dependent.  I didn't bother to recompile Python, but ran valgrind on importing in Python 2.5 and Python 2.3 and got none such errors.

Looking at the source code --- structure PyGPropsDescr_Type and similar is defined with PYGLIB_DEFINE_TYPE().  That macro initializes only a few first fields, leaving out the rest.  I don't remember if C compiler is obliged to initialize static structures with zeros or not (though here it seems like it does).  Can the errors be caused by uninitialized fields?
Comment 5 Gustavo Carneiro 2008-08-30 19:05:42 UTC
I think you should end the structure with ...,0,}; to force zero initialization.

Anyway, I added it and it makes no difference.  But I found the real problem: sizeof(0) == 4, not 0.  Fixed now.