Crashes in x86_64 math functions

Carlos O'Donell carlos@systemhalted.org
Thu Jan 5 23:25:00 GMT 2012


On 1/5/2012 5:57 PM, Allan McRae wrote:
> No-one else seeing that at all?
> 
> I looked further into the crashes for sin/tan crashes and found that
> if I changed this line:
> 
> libm_ifunc (tan, HAS_FMA4 ? __tan_fma4 : HAS_AVX ? __tan_avx : __tan_sse2);
> 
> to just:
> 
> libm_ifunc (tan, __tan_sse2);
> 
> then everything works again.  The processors the segfaults are observed
> on do not have AVX or FMA4, so is the detection of this support perhaps
> not working properly?

Is __init_cpu_features being executed?

If so, what is it computing for the features of your CPU?

I suggest running the code in sysdeps/x86_64/multiarch/init-arch.c manually
to see what it is returning for your CPU?

HAS_AVX checks bit 28 of ECX after the CPUID instruction, which given
a quick review, looks like the right bit for AVX detection.

You still haven't debugged the problem down to a single instructions.

Which instruction causes the SEGFAULT and why?

Cheers,
Carlos.



More information about the Libc-help mailing list