[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strstr in gnulib
From: |
Eric Blake |
Subject: |
Re: strstr in gnulib |
Date: |
Mon, 08 Nov 2010 10:21:38 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Mnenhy/0.8.3 Thunderbird/3.1.6 |
On 11/08/2010 07:31 AM, Дилян Палаузов wrote:
> Hello,
>
> When I use the latest strstr implemenation from gnulib in git, the
> following program crashes (causes Segmentation fault):
>
> #include <string.h>
> #include <stdio.h>
>
> void main() {
> char *find = strstr ("**AB** **CD** **AB** **CD** **CD**", "**CD**");
> printf("%s\n", find);
> }
Can you provide a backtrace of the crash? I can't reproduce it. In
order to use the implementation from gnulib, you should probably be
including <config.h>.
>
> It does not crash when I use strstr from libc-2.9 .
glibc 2.9 through 2.12 have the same bug as gnulib's strstr used to
have. You have to use something newer than 2.12 (these days, most
distros have backported the glibc.git patch back to their shipped glibc
version), to avoid that bug. But that bug was unrelated to a segfault,
so I still can't figure out why your example would be crashing.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature