Bug 1499012
Summary: | glibc: Restore compatibility with compilers which use vector registers for argument passing against x86-64 ABI | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Deepu K S <dkochuka> | ||||||
Component: | glibc | Assignee: | glibc team <glibc-bugzilla> | ||||||
Status: | CLOSED DUPLICATE | QA Contact: | qe-baseos-tools-bugs | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 7.4 | CC: | ashankar, codonell, dkochuka, fweimer, hongjiu.lu, knweiss, mnewsome, pfrankli | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | glibc-2.17-217.el7 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2017-11-03 08:24:34 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: | |||||||||
Bug Depends On: | 1504969 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Deepu K S
2017-10-05 19:30:13 UTC
Created attachment 1334984 [details] 'tinyfail.tgz', a small piece of code (attached) that illustrates the problem. The shell script makeSymmetryFinder , which can be found inside the archive I just attached, (and may need some editing to setup location of the intel compiler in the first line) creates two executables out of the two C++ files : ./DynamicSF where the object files are linked dynamically, and ./StaticSF where the same object files are linked statically. The compilation options in the file replicate the options used in our production build. In our tests we have done the following: 1) Compiled the code with Intel compiler version : >/opt/intel/compilers_and_libraries/linux/bin/intel64/icpc -v icpc version 16.0.1 (gcc version 4.4.7 compatibility) on the RHEL 6.5 Machine: >uname -a Linux ms-rh6-cam2 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux >cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago) >cat /proc/cpuinfo .. model name : Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz 2) Run on the RHEL 7.4 machine >cat /proc/cpuinfo .. model name : Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz >cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo) ./StaticSF runs as expected and produces ## 6.516050 <<< While ./DynamicSF fails on RH7.4 with (however, it works correctly on any other Linux OS, including earlier RHEL versions) ## -nan <<< 3)The failure can be eliminated if any of the following compilation options is chosen: a) optimization –O1 instead of –O2 b) fp-model is set to e.g. double instead of fast (default) < -fp-model double c) intended architecture: if among the options to -ax there is at least one of CORE-AVX-I,SSE4.2 or AVX Could you please compile tinyfail.tgz sources and provide the compiled binaries? Could the customer please try running with LD_BIND_NOW=1? Created attachment 1336261 [details]
compiled binaries
When you unpack the files on an old machine, in the directory with the files you can do the following to demonstrate that the dynamically loaded executable from Intel 16 produces NAN, and crashes when LD_BIND_NOW is set.
Yours
arts-rhel74> ll
total 18088
-rwxr--r-- 1 vmn1 users 83 Sep 28 14:48 a.cpp*
-rwxr--r-- 1 vmn1 users 10952 Sep 29 13:02 a.o*
-rwxr--r-- 1 vmn1 users 31800 Sep 29 13:02 DynamicSF*
-rwxr--r-- 1 vmn1 users 3390120 Oct 5 11:22 libimf.so*
-rwxr--r-- 1 vmn1 users 468217 Oct 5 11:22 libintlc.so.5*
-rwxr--r-- 1 vmn1 users 36375 Oct 5 11:22 libirng.so*
-rwxr--r-- 1 vmn1 users 14331673 Oct 5 11:22 libsvml.so*
-rwxr--r-- 1 vmn1 users 36232 Sep 29 13:02 libSymmetryFinder.so*
-rwxr--r-- 1 vmn1 users 480 Sep 29 13:02 makeSymmetryFinder*
-rwxr--r-- 1 vmn1 users 58808 Sep 29 13:02 StaticSF*
-rwxr--r-- 1 vmn1 users 319 Sep 28 15:41 symm_cell.cpp*
-rwxr--r-- 1 vmn1 users 32216 Sep 29 13:02 symm_cell.o*
arts-rhel74> setenv LD_LIBRARY_PATH .
arts-rhel74> DynamicSF
## -nan <<<
arts-rhel74> StaticSF
## 6.516050 <<<
arts-rhel74> setenv LD_BIND_NOW 1
arts-rhel74> DynamicSF
Segmentation fault (core dumped)
The problem here is that libintlc.so.5 is linked incorrectly because it references libc.so.6 symbols, but is not linked against it: $ eu-readelf -d libintlc.so.5 Dynamic segment contains 21 entries: Addr: 0x0000000000269588 Offset: 0x069588 Link to section: [ 3] '.dynstr' Type Value SONAME Library soname: [libintlc.so.5] INIT 0x0000000000007058 FINI 0x000000000005f498 HASH 0x0000000000000158 STRTAB 0x0000000000003450 SYMTAB 0x0000000000000c30 STRSZ 6604 (bytes) SYMENT 24 (bytes) PLTGOT 0x0000000000269798 PLTRELSZ 5160 (bytes) PLTREL RELA JMPREL 0x0000000000005c30 RELA 0x0000000000004e20 RELASZ 3600 (bytes) RELAENT 24 (bytes) RELACOUNT 137 NULL … $ eu-readelf --symbols=.dynsym libintlc.so.5 | grep UNDEF | head 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UNDEF 12: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF _Unwind_GetIP 15: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF __strcpy_chk 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF __xpg_basename 31: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF memmove 33: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF snprintf 45: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF _Unwind_GetRegionStart 48: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF getenv 59: 0000000000000000 0 FUNC WEAK DEFAULT UNDEF _Unwind_Backtrace 66: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UNDEF getpid See bug 1377895. This is a different Intel toolchain bug. I believe Intel has released a compiler update which resolves this issue. Switching to the fixed libintlc.so.5 library will resolve the crash without having to recompile any applications. We plan to deliver a fix for this issue as part of the fix for bug 1504969, which went into glibc-2.17-217.el7. We are backporting these upstream commits: commit b52b0d793dcb226ecb0ecca1e672ca265973233c Author: H.J. Lu <hjl.tools> Date: Fri Oct 20 11:00:08 2017 -0700 x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265] commit 0ac8ee53e8efbfd6e1c37094b4653f5c2dad65b5 Author: H.J. Lu <hjl.tools> Date: Fri Aug 26 08:57:42 2016 -0700 X86-64: Correct CFA in _dl_runtime_resolve *** This bug has been marked as a duplicate of bug 1504969 *** An unsupported, untest public preview build with this fix is available here: https://copr.fedorainfracloud.org/coprs/fweimer/glibc-rhel-7.5/ Updated glibc packages for this issue have been released for Red Hat Enterprise Linux 7.4: https://access.redhat.com/errata/RHBA-2017:3296 If the solution does not work for you, please open a new bug report. |