Bug#520168: minimal C test case

Ryan Niebur ryanryan52 at gmail.com
Fri Mar 20 07:23:27 UTC 2009


Hi,

thanks to Carlo letting me use his machine, I got this figured out. It
is indeed a problem in the C library (despite my failed attempt at a
minimal test case at first, which mislead me into thinking it was
not).

here is my minimal test case:

root at powerpc:/tmp/libglib-perl-1.214# cat glog.c
#include <glib.h>

int main() {
    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, "%s", "o hai ther");
    g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, "%s", "whee log warning");
}

root at powerpc:/tmp/libglib-perl-1.214# gcc `pkg-config --cflags --libs glib-2.0` glog.c
root at powerpc:/tmp/libglib-perl-1.214# ./a.out

on my i386 machine:
$ ./a.out
** (process:6821): DEBUG: o hai ther
** INFO: o hai ther
** (process:6821): DEBUG: whee log warning
** INFO: whee log warning

everything works as is expected.

on the powerpc machine:
root at powerpc:/tmp/libglib-perl-1.214# ./a.out
** (process:1659): DEBUG: o hai ther
** INFO:
** (process:1659): DEBUG: whee log warning
Segmentation fault
root at powerpc:/tmp/libglib-perl-1.214# ./a.out
** (process:1660): DEBUG: o hai ther
** INFO:
** (process:1660): DEBUG: whee log warning
** INFO: L\xa3
root at powerpc:/tmp/libglib-perl-1.214# ./a.out
** (process:1661): DEBUG: o hai ther
** INFO:
** (process:1661): DEBUG: whee log warning
Segmentation fault
root at powerpc:/tmp/libglib-perl-1.214#

info is messed up. on longer messages, it causes segfaults sometimes.
also, this apparently only happens when using %s in the format
string. If I put a really long message for the message arguement, it
is displayed for info fine.
the tests in libglib-perl that detected this bug only fail on powerpc
and s930.
I have reproduced it with this test case on powerpc, but am assuming
that the same happens on s930.

Thanks,
Ryan

-- 
_________________________
Ryan Niebur
ryanryan52 at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20090320/3ccf902a/attachment.pgp 


More information about the pkg-perl-maintainers mailing list