Bug#521737: [alpha] Segfault in memchr when called via strstr

2010-04-06 Thread Santiago Vila
Hmm, but last message in this report was from October 2009.

Should I just modify m4 so that the test is ignored on alpha?

Or maybe don't worry at all as alpha is not a release architecture for
squeeze?



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#521737: [alpha] Segfault in memchr when called via strstr

2010-04-06 Thread Santiago Vila
Hi.

This seems to be the same bug that makes m4 1.4.14 test suite to fail on alpha.
The failed test is test-strstr. Here is a backtrace:

#0  memchr () at ../ports/sysdeps/alpha/memchr.S:73
#1  0x020db9f8 in two_way_short_needle (haystack_start=0x2027ffc 
aax, needle_start=value optimized out)
at str-two-way.h:269
#2  *__GI_strstr (haystack_start=0x2027ffc aax, needle_start=value 
optimized out) at strstr.c:79
#3  0x00012e48 in main (argc=1, argv=0x11ff245e8) at test-strstr.c:70
(gdb)   

Thanks.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#521737: [alpha] Segfault in memchr when called via strstr

2009-03-29 Thread Michael Tautschnig
Package: libc6.1
Version: 2.9-6
Severity: important

This is another one from the clamav test suite, but this time the bug is easily
reproducible in isolation (therefore important, severity might be upgraded as
well as it breaks unrelated software).

The following simple snippet causes a segfault when run with electric-fence
preloaded:

#include string.h

int main() {
char * bla;
bla = strdup(aBaaax);
return 0!=strstr(bla, B1x);
}

The string is somewhat special, it seems the following aspects must hold to
crash strstr (or actually memchr when called from within strstr):

- The char* must be allocated on the heap.
- The number of characters between the B and the final x must not be smaller
  than shown here.
- There must be a chance of a match (that is, the string must contain a the
  initial character of the string to be found).

Reproducing that is simple:

(sid)m...@albeniz:~/clamav-0.95+dfsg/unit_tests$ cat test.c 
#include string.h

int main() {
  char * bla;
  bla = strdup(aBaaax);
  return 0!=strstr(bla, B1x);
}
(sid)m...@albeniz:~/clamav-0.95+dfsg/unit_tests$ gcc test.c ; 
LD_PRELOAD=/usr/lib/libefence.so ./a.out 

  Electric Fence 2.1 Copyright (C) 1987-1998 Bruce Perens.
Segmentation fault

And gdb says:

(gdb) where
#0  0x020d9470 in memchr () from /lib/libc.so.6.1
#1  0x020d90c4 in *__GI_strstr (haystack_start=value optimized out, 
needle_start=value optimized out) at str-two-way.h:269
#2  0x000125fc in main ()

There is one problem left: I'm not sure whether this is really libc's memchr or
a gcc builtin (in which case this might be a gcc bug).

Best,
Michael




pgpNjyNtyhXm6.pgp
Description: PGP signature