Bug 26534 - libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4 system
Summary: libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4 system
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.32
: P2 normal
Target Milestone: 2.33
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-25 14:55 UTC by Ondřej Hošek
Modified: 2021-01-20 09:00 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2020-08-25 00:00:00
fweimer: security-


Attachments
patch fixing the regression (correcting typo/backspace-o) (229 bytes, patch)
2020-08-25 14:57 UTC, Ondřej Hošek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ondřej Hošek 2020-08-25 14:55:18 UTC
Programs calling libm's pow() exit with SIGILL because it executes the FMA4 instruction

    vfmaddsd %xmm4,0x8(%rdx),%xmm6,%xmm0

on a system that does not support FMA4.

This is apparently due to a regression in commit 107e6a3c2212ba7a3a4ec7cae8d82d73f7c95d0b file sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h where the ifunc checks for "FMA" instead of "FMA4".

Originally reported to Arch Linux: https://bugs.archlinux.org/task/67715
Comment 1 Ondřej Hošek 2020-08-25 14:57:35 UTC
Created attachment 12797 [details]
patch fixing the regression (correcting typo/backspace-o)
Comment 2 H.J. Lu 2020-08-25 16:25:58 UTC
(In reply to Ondřej Hošek from comment #1)
> Created attachment 12797 [details]
> patch fixing the regression (correcting typo/backspace-o)

Can you send it to the glibc mailing list?  Thanks.
Comment 3 Ondřej Hošek 2020-08-26 02:27:56 UTC
Patch sent to the mailing list:

https://sourceware.org/pipermail/libc-alpha/2020-August/117267.html
Comment 4 Sergei Trofimovich 2020-09-03 22:37:27 UTC
Gentoo also encountered it: https://bugs.gentoo.org/740110

Looks like patch was merged into master as: https://sourceware.org/git/?p=glibc.git;a=patch;h=23af890b3f04e80da783ba64e6b6d94822e01d54
Comment 5 Ondřej Hošek 2020-09-03 23:04:34 UTC
Yup, and backported to the 2.32 branch in https://sourceware.org/git/?p=glibc.git;a=commit;h=cebc01cbfd6c257f329e818b68bb1b2eef2afe09

I guess I can change the status to RESOLVED FIXED now...