Bug 1883501

Summary: Relink `/lib64/libxc.so.9' with `/lib64/libm.so.6' for IFUNC symbol `sin' when running cp2k
Product: [Fedora] Fedora Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: libxcAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: dominik, fweimer, susi.lehtola
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libxc-5.0.0-6.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-03 00:56:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dominik 'Rathann' Mierzejewski 2020-09-29 12:16:37 UTC
Description of problem:
All cp2k tests are failing with:
Relink `/lib64/libxc.so.9' with `/lib64/libm.so.6' for IFUNC symbol `sin'

Version-Release number of selected component (if applicable):
libxc-5.0.0-4.fc33.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Patch cp2k HEAD with https://github.com/cp2k/cp2k/pull/914
2. Build and run test suite

Actual results:
All tests fail with:
Relink `/lib64/libxc.so.9' with `/lib64/libm.so.6' for IFUNC symbol `sin'

Expected results:
Tests pass.

Additional info:
It looks like libxc wasn't build in rawhide (f34), so I'll try rebuilding in rawhide to see if that fixes the issue.

Comment 1 Dominik 'Rathann' Mierzejewski 2020-09-29 16:40:54 UTC
libxc-5.0.0-5.fc34 built in rawhide, retrying cp2k build...

Comment 2 Dominik 'Rathann' Mierzejewski 2020-09-29 17:15:26 UTC
The rebuild seems to have fixed it. Closing.

Comment 3 Dominik 'Rathann' Mierzejewski 2020-10-01 13:10:48 UTC
Unfortunately, I was wrong. Simple rebuild did not fix it. Additionally, F33 is also affected:

$ cp2k.sopt 
cp2k.sopt: Relink `/lib64/libxc.so.9' with `/lib64/libm.so.6' for IFUNC symbol `sin'
Segmentation fault (core dumped)
$ rpm -q cp2k libxc
cp2k-7.1-1.20200925gitdbf7a77.fc34.x86_64
libxc-5.0.0-4.fc33.x86_64

Perhaps this is related to bug 1452813 and bug 1312462?

Comment 4 Dominik 'Rathann' Mierzejewski 2020-10-01 13:25:23 UTC
Hmm, actually libxc doesn't seem to be linked with libm:
$ ldd -r /usr/lib64/libxc.so.9
	linux-vdso.so.1 (0x00007fffc59c3000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f6369590000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f636b976000)
undefined symbol: sincos	(/usr/lib64/libxc.so.9)
undefined symbol: atan2	(/usr/lib64/libxc.so.9)
undefined symbol: tanh	(/usr/lib64/libxc.so.9)
undefined symbol: cosh	(/usr/lib64/libxc.so.9)
undefined symbol: sin	(/usr/lib64/libxc.so.9)
undefined symbol: atan	(/usr/lib64/libxc.so.9)
undefined symbol: exp	(/usr/lib64/libxc.so.9)
undefined symbol: cbrt	(/usr/lib64/libxc.so.9)
undefined symbol: cos	(/usr/lib64/libxc.so.9)
undefined symbol: log	(/usr/lib64/libxc.so.9)
undefined symbol: pow	(/usr/lib64/libxc.so.9)
undefined symbol: round	(/usr/lib64/libxc.so.9)
undefined symbol: sqrt	(/usr/lib64/libxc.so.9)
undefined symbol: erf	(/usr/lib64/libxc.so.9)
$ objdump -p /usr/lib64/libxc.so.9 |grep NEEDED
  NEEDED               libc.so.6

Comment 5 Dominik 'Rathann' Mierzejewski 2020-10-01 14:11:09 UTC
Trying to force linking libxc with libm to see if that helps.

Comment 6 Dominik 'Rathann' Mierzejewski 2020-10-01 16:52:38 UTC
And... yes it does. cp2k is no longer crashing. I'll push the fix to F33+ tonight.

Comment 7 Susi Lehtola 2020-10-01 20:52:17 UTC
Thanks for the debug, I've fixed the issue in libxc upstream.

Comment 8 Fedora Update System 2020-10-02 12:28:54 UTC
FEDORA-2020-66e4aa529b has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-66e4aa529b

Comment 9 Fedora Update System 2020-10-02 12:29:03 UTC
FEDORA-2020-66e4aa529b has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-66e4aa529b

Comment 10 Fedora Update System 2020-10-03 00:56:46 UTC
FEDORA-2020-66e4aa529b has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.