Bug 1387402

Summary: libgcc: unwind-c.c never uses _Unwind_GetIPInfo
Product: Red Hat Enterprise Linux 7 Reporter: Florian Weimer <fweimer>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Michael Petlan <mpetlan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: ashankar, fweimer, law, mcermak, mnewsome, mpetlan, mpolacek, pfrankli
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-4.8.5-12.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1104812 Environment:
Last Closed: 2017-08-01 22:35:59 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:
Bug Depends On: 1387400    
Bug Blocks: 1390370    

Description Florian Weimer 2016-10-20 19:37:45 UTC
+++ This bug was initially created as a clone of Bug #1104812 +++

pthread_cond_wait on i686 has unwind data which the libgcc unwinder (from the gcc package) does not handle correctly.

Ongoing discussion is here:

  https://gcc.gnu.org/ml/gcc/2016-10/msg00165.html

This issue is not present in rawhide because the new condvar implementation does not have this problem.

Comment 1 Florian Weimer 2016-10-25 16:50:56 UTC
Upstream commit: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=241491

Comment 4 Michael Petlan 2017-06-07 15:26:59 UTC
Hi Florian, could you please advise me how this bug could be tested? Thanks!

Comment 5 Florian Weimer 2017-06-07 15:37:13 UTC
(In reply to Michael Petlan from comment #4)
> Hi Florian, could you please advise me how this bug could be tested? Thanks!

I think the only thing you can do is to look at the disassembly of libgcc (objdump -d --reloc) and see if there is a reference to _Unwind_GetIPInfo in the function __gcc_personality_v0.

Comment 6 Michael Petlan 2017-06-07 22:32:37 UTC
This is from ./obj-x86_64-redhat-linux/x86_64-redhat-linux/32/libgcc/32/libgcc_s.so

000158f0 <__gcc_personality_v0>:
   158f0:       55                      push   %ebp
   158f1:       b8 03 00 00 00          mov    $0x3,%eax
   158f6:       57                      push   %edi
   158f7:       56                      push   %esi
   158f8:       53                      push   %ebx
   ... [snip] ...
   15a10:       89 7c 24 48             mov    %edi,0x48(%esp)
   15a14:       89 04 24                mov    %eax,(%esp)
-->15a17:       e8 f4 c4 fe ff          call   1f10 <_Unwind_GetIPInfo@plt>
   15a1c:       83 7c 24 28 01          cmpl   $0x1,0x28(%esp)
   15a21:       89 c7                   mov    %eax,%edi
   15a23:       83 df 00                sbb    $0x0,%edi
   15a26:       39 74 24 48             cmp    %esi,0x48(%esp)


The 64bit libgcc (./obj-x86_64-redhat-linux/x86_64-redhat-linux/libgcc/libgcc_s.so) looks similar:

0000000000011e20 <__gcc_personality_v0>:
   11e20:       41 57                   push   %r15
   11e22:       b8 03 00 00 00          mov    $0x3,%eax
   11e27:       41 56                   push   %r14
   11e29:       41 55                   push   %r13
   11e2b:       41 54                   push   %r12
   ... [snip] ...
   11f45:       48 89 7c 24 50          mov    %rdi,0x50(%rsp)
   11f4a:       4c 89 f7                mov    %r14,%rdi
-->11f4d:       e8 1e 0a ff ff          callq  2970 <_Unwind_GetIPInfo@plt>
   11f52:       83 7c 24 14 01          cmpl   $0x1,0x14(%rsp)
   11f57:       48 89 c3                mov    %rax,%rbx
   11f5a:       48 83 db 00             sbb    $0x0,%rbx
   11f5e:       4c 39 7c 24 50          cmp    %r15,0x50(%rsp)

(both from gcc-4.8.5-16.el7)

When looking at the same thing in gcc-4.8.5-11.el7, I don't see the reference in the same function.

--> VERIFIED.

Comment 7 errata-xmlrpc 2017-08-01 22:35:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2094