Description of problem: compiling a minimal test application statically using gcc, the call strspn() causes a SIGILL. Prints "Illegal instruction" on the command line. Changing "char var[]" to "char *var" for strtext and cset causes the problem to decrease from always occuring despite optimization level to occuring only during -O0. Does not occur for dynamically linked application. Version-Release number of selected component (if applicable): glibc-static-2.12-3 How reproducible: Every time. Steps to Reproduce: 1. Compile main.c below (strspn test) with "gcc main.c -g -static -O0 -o testapp.bin" 2. Run ./testapp.bin 3. Run gdb ./testapp.bin Actual results: When ran from the command line, output is "Illegal instruction" When ran from the debugger, output is Program received signal SIGILL, Illegal instruction. 0x08052f5d in __strspn_sse42 () Expected results: Prints-"The length of initial number is 3." Additional info: #######main.c############ #include <stdio.h> #include <string.h> int main (int argc, char *argv[]){ char strtext[] = "129th"; char cset[] = "1234567890"; int i; i = strspn( strtext, cset ); printf ( "The length of initial number is %d.\n", i ); return 0; } #########################
Eugene Zobachev 2010-08-17 17:58:14 CDT I have experienced exactly same problem with the similar code. The code was compiled and executed on the same computer (Linux server with Fedora 13). Surprisingly, this code executes correctly in Ubuntu QEMU and KVN from the flash drive with Fedora 13, whereas Windows QEMU indicates same error ("Illegal instruction" in __strspn_sse42). Additional information: If you change "strspn" to "strcspn" in the code fragment above, the static build works fine.
Looks like the VM is lying about the cpu capabilities. Please provide the contents of /proc/cpuinfo.
For the original post, it was on actual hardware. My /proc/cpuinfo is vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz stepping : 10 cpu MHz : 2992.402 ... flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm tpr_shadow vnmi flexpriority
glibc-2.12.1-2 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/glibc-2.12.1-2
Confirmed - glibc-2.12.1-2 fixes the issue.
glibc-2.12.90-8 has been submitted as an update for Fedora 14. http://admin.fedoraproject.org/updates/glibc-2.12.90-8
glibc-2.12.90-8 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.
glibc-2.12.1-2 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.