strcmp crashes
Bug #518314 reported by
Basile Starynkevitch
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: libc6
system is Ubuntu/Lucid/10.04 alpha2 on amd64, updated febr 06 2010.
Probably same bug as bug 518307.
The following program crashes (but should not, and works ok on Debian/Sid), when compiled with gcc -Wall teststrcmp.c -o teststrcmp (even with -O, or with gcc-4.3, so seems libc6 related).
libc6-dev is 2.11.1-0ubuntu2
// file teststrcmp.c
#include <string.h>
#include <stdio.h>
int main(int argc, char**argv)
{
int c=0;
char *s = (argc>1)
printf(
c=strcmp(s, "aa");
printf("c=%d\n", c);
return 0;
}
/// eof teststrcmp.c
The crash as reported by gdb is inside strcmp.
description: | updated |
description: | updated |
Changed in eglibc (Ubuntu): | |
status: | Incomplete → Fix Released |
To post a comment you must log in.
Since I scrapped Ubuntu from (and installed Mandriva on) my laptop I am no more able to provide more info & reproduce the bug.
However, I was told that the exact processor matters. Here is the ouptut of cat /proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU P9500 @ 2.53GHz
stepping : 6
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
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 pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5053.50
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU P9500 @ 2.53GHz
stepping : 6
cpu MHz : 800.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
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 pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5053.73
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management: