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 447933 - make check failing in trunk
make check failing in trunk
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal blocker
: ---
Assigned To: Mathias Hasselmann (IRC: tbf)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-06-15 16:19 UTC by Cody Russell
Modified: 2007-06-16 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correctly use g_printf_string_upper_bound in g_string_append_vprintf (642 bytes, patch)
2007-06-16 09:34 UTC, Mathias Hasselmann (IRC: tbf)
committed Details | Review

Description Cody Russell 2007-06-15 16:19:07 UTC
/bin/bash: line 4: 13080 Segmentation fault      (core dumped) srcdir=. LIBCHARSET_ALIAS_DIR=../glib/libcharset MALLOC_CHECK_=2 MALLOC_PERTURB_=$((${RANDOM:-256} % 256)) ${dir}$tst
FAIL: keyfile-test


I was about to commit garnaco's GRegex patch, but make check was failing.  So to be sure I ran make check on a clean checkout of GLib and hit this.
Comment 1 Cody Russell 2007-06-15 22:06:21 UTC
Seems that I'm doing something wrong on my end.
Comment 2 Cody Russell 2007-06-15 22:22:38 UTC
cody@cody-desktop:~/svn/gnome/glib/tests/.libs$ gdb ./lt-keyfile-test 
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/cody/svn/gnome/glib/tests/.libs/lt-keyfile-test 

Program received signal SIGSEGV, Segmentation fault.
0x00002b7f31f1f620 in strlen () from /lib/libc.so.6
(gdb) bt
  • #0 strlen
    from /lib/libc.so.6
  • #1 vfprintf
    from /lib/libc.so.6
  • #2 vsnprintf
    from /lib/libc.so.6
  • #3 IA__g_string_append_vprintf
    at gstring.c line 1288
  • #4 IA__g_string_append_printf
    at gstring.c line 1386
  • #5 g_key_file_parse_value_as_comment
    at gkeyfile.c line 3684
  • #6 get_group_comment
    at gkeyfile.c line 2749
  • #7 main
    at keyfile-test.c line 497

Comment 3 Cody Russell 2007-06-15 22:23:59 UTC
If this is any help, it runs fine on my 32-bit laptop.  But on my 64-bit desktop it crashes with the above stacktrace.  Another irc user also reproduced the it on his 64-bit machine, but said string-test was failing for him as well and it's not failing for me.
Comment 4 Andreas Köhler 2007-06-15 22:31:02 UTC
Here are two similar stacktraces (SVN rev 5569)

keyfile-test:
  • #0 strlen
    from /usr/lib/debug/libc.so.6
  • #1 _IO_vfprintf_internal
    at vfprintf.c line 1566
  • #2 _IO_vsnprintf
    at vsnprintf.c line 120
  • #3 IA__g_vsnprintf
    at gprintf.c line 277
  • #4 IA__g_string_append_vprintf
    at gstring.c line 1288
  • #5 IA__g_string_append_printf
    at gstring.c line 1386
  • #6 g_key_file_parse_value_as_comment
    at gkeyfile.c line 3684
  • #7 get_group_comment
    at gkeyfile.c line 2749
  • #8 g_key_file_get_top_comment
    at gkeyfile.c line 2805
  • #9 IA__g_key_file_get_comment
    at gkeyfile.c line 2838
  • #10 test_comments
    at keyfile-test.c line 497
  • #11 main
    at keyfile-test.c line 1348
  • #0 strlen
    from /usr/lib/debug/libc.so.6
  • #1 _IO_vfprintf_internal
    at vfprintf.c line 1566
  • #2 _IO_vsnprintf
  • #3 IA__g_vsnprintf
  • #4 IA__g_string_append_vprintf
    at gstring.c line 1288
  • #5 IA__g_string_printf
    at gstring.c line 1350
  • #6 main
    at string-test.c line 111

Comment 5 Cody Russell 2007-06-15 22:33:52 UTC
Looks possibly related to #57693
Comment 6 Cody Russell 2007-06-15 22:34:27 UTC
http://bugzilla.gnome.org/show_bug.cgi?id=57693
Comment 7 Mathias Hasselmann (IRC: tbf) 2007-06-16 07:56:00 UTC
If it is related to Bug 57693, then it just had uncovered another bug - I guess. Investigating, but do not have a 64 bit machine. Well, maybe this CoreDuo is - but after all the pain 64 bit causes I really do not feel like figuring out... ;-)
Comment 8 Mathias Hasselmann (IRC: tbf) 2007-06-16 09:12:42 UTC
Testing on annarchy.freedesktop.org. It produces Cody's, but not Andi's segfaults. Stepping thru the code now.
Comment 9 Mathias Hasselmann (IRC: tbf) 2007-06-16 09:34:46 UTC
Created attachment 90051 [details] [review]
Correctly use g_printf_string_upper_bound in g_string_append_vprintf

The attached patch fixes the crash on annarchy.

Andi: Can you test it on your box?

Ryan: As you introduced g_printf_string_upper_bound with you patch I suggest to review your usages of g_printf_string_upper_bound. It has to operate on a private copy of the va_list.
Comment 10 Andreas Köhler 2007-06-16 11:59:00 UTC
===================
All 53 tests passed
===================

Thanks, that did the trick.  Sorry for being a blind man :-)

Go, commit.  (gprintfc.c:g_vasprintf does the same).

(politics again: should i rather use accepted-commit_now---i assumed that is reserved for maintainers)
Comment 11 Allison Karlitskaya (desrt) 2007-06-16 16:07:03 UTC
+  G_VA_COPY (sneak, args);

huh.  you learn something every day.  i had no idea about this one.

thanks for the catch :)