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 745694 - tests/custom-serialize,proxy-continuous segfault due to uninitialized GError pointers
tests/custom-serialize,proxy-continuous segfault due to uninitialized GError ...
Status: RESOLVED FIXED
Product: librest
Classification: Platform
Component: other
git master
Other Linux
: Normal normal
: ---
Assigned To: librest-maint
librest-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-05 18:04 UTC by Alexandre Rostovtsev
Modified: 2015-03-17 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple patch to fix this (1.06 KB, patch)
2015-03-05 18:09 UTC, Alexandre Rostovtsev
committed Details | Review

Description Alexandre Rostovtsev 2015-03-05 18:04:33 UTC
If you don't initialize GError pointers to NULL, a call fails for whatever reason, and the error gets set, the following happens:

(process:1416): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
The overwriting error message was: Connection terminated unexpectedly
Call failed: MANPATH=/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.2/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.25/man:/etc/java-config-2/current-system-vm/man/:/usr/lib64/php5.6/man/:/usr/share/postgresql/man/:/usr/share/postgresql-9.4/man/:/usr/share/postgresql-9.3/man/:/usr/share/rust-1.0.0_alpha2/man

Program received signal SIGSEGV, Segmentation fault.
0xf785e3d0 in __GI___libc_free (mem=0xffffc894) at malloc.c:2944
2944	  ar_ptr = arena_for_chunk (p);
(gdb) bt
  • #0 __GI___libc_free
    at malloc.c line 2944
  • #1 g_free
    at /usr/src/debug/dev-libs/glib-2.42.2/glib-2.42.2/glib/gmem.c line 190
  • #2 g_error_free
    at /usr/src/debug/dev-libs/glib-2.42.2/glib-2.42.2/glib/gerror.c line 467
  • #3 main
    at /var/tmp/portage/net-libs/rest-0.7.92-r2/work/rest-0.7.92/tests/custom-serialize.c line 137

Comment 1 Alexandre Rostovtsev 2015-03-05 18:09:46 UTC
Created attachment 298655 [details] [review]
simple patch to fix this
Comment 2 Christophe Fergeau 2015-03-13 16:59:36 UTC
Review of attachment 298655 [details] [review]:

Good catch, thanks