This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14602] New: strstr broken on older i686 targets
- From: "law at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Thu, 20 Sep 2012 20:54:21 +0000
- Subject: [Bug libc/14602] New: strstr broken on older i686 targets
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14602
Bug #: 14602
Summary: strstr broken on older i686 targets
Product: glibc
Version: 2.17
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: unassigned@sourceware.org
ReportedBy: law@redhat.com
CC: drepper.fsp@gmail.com
Classification: Unclassified
Compile and run the following for older i686 machine. It claims to find the
needle ", enable_shared, " in the haystack ", enable_static, ".
#include <stdio.h>
#include <string.h>
int main(void)
{
const char *haystack = ", enable_static, ";
const char *needle = ", enable_shared, ";
char *result;
int retval;
result = strstr(haystack, needle);
printf("'%s'\n", result);
retval = result ? result - haystack : -1;
printf("%d\n", retval);
return 0;
}
This bug was introduced by this commit:
commit 400726deef57d8da8d6c7cd5c8e7891eaabab041
Author: Maxim Kuvyrkov <maxim@codesourcery.com>
Date: Mon May 28 22:50:15 2012 -0700
Detect EOL on-the-fly in strstr, strcasestr and memmem.
For reference, the cpuflags for a machine which can trigger this failure:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm
constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor
ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm dts tpr_shadow
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.