This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/20596] sprintf segmentation fault due to misaligned movaps on x86_64


https://sourceware.org/bugzilla/show_bug.cgi?id=20596

--- Comment #2 from Andrew Thomas <andrew.thomas at cogent dot ca> ---
Created attachment 9510
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9510&action=edit
Test case for sprintf crash

I have narrowed this down to a trivial test case, which I have attached.  It
consists of two C files compiled with no special compiler flags.

The problem only arises when I use a weak reference to the function that calls
the function that calls sprintf.  Change SPRINTF_CRASH from 1 to 0 in
stacktest.c to eliminate the crash.

You are right - this looks like a compiler bug rather than a glibc bug.

My test system is Ubuntu 16.04 LTS.

uname -a:  Linux mylinux 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46
UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

gcc -v: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 

glibc:  2.23

cat /proc/cpuinfo:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
stepping        : 9
microcode       : 0x12
cpu MHz         : 3500.273
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
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 rdtscp lm
constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc
aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16
xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx f16c
rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
xsaveopt dtherm arat pln pts
bugs            :
bogomips        : 7020.07
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]