Bug 201741 - [4.19 Regression] i386 vDSO has incorrect unwind info
Summary: [4.19 Regression] i386 vDSO has incorrect unwind info
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: i386 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_i386
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-20 21:53 UTC by H.J. Lu
Modified: 2018-12-14 20:47 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.19
Subsystem:
Regression: No
Bisected commit-id:


Attachments
A testcase (3.32 KB, text/plain)
2018-11-20 21:53 UTC, H.J. Lu
Details

Description H.J. Lu 2018-11-20 21:53:54 UTC
Created attachment 279555 [details]
A testcase

commit 379d98ddf41344273d9718556f761420f4dc80b3
Author: Alistair Strachan <astrachan@google.com>
Date:   Fri Aug 3 10:39:31 2018 -0700

    x86: vdso: Use $LD instead of $CC to link
    
    The vdso{32,64}.so can fail to link with CC=clang when clang tries to find
    a suitable GCC toolchain to link these libraries with.
    
    /usr/bin/ld: arch/x86/entry/vdso/vclock_gettime.o:
      access beyond end of merged section (782)

breaks i386 vDSO with incorrect unwind info.  The testcase here should
report:

[hjl@gnu-hsw-1 tmp]$ gcc -g -O2 -funwind-tables -m32 foo.c
[hjl@gnu-hsw-1 tmp]$ ./a.out 
Obtained backtrace with 7 functions
Function 0: ./a.out() [0x8049272]
Function 1: linux-gate.so.1(__kernel_sigreturn+0) [0xf7f990b0]
Function 2: linux-gate.so.1(__kernel_vsyscall+0x9) [0xf7f99099]
Function 3: /lib/libc.so.6(__read+0x2b) [0xf7ea72ab]
Function 4: ./a.out() [0x80493a9]
Function 5: ./a.out() [0x80493f3]
Function 6: ./a.out() [0x80493f3]
[hjl@gnu-hsw-1 tmp]$ 

But kernel 4.19 got

[hjl@gnu-cfl-1 tmp]$ ./a.out 
Obtained backtrace with 4 functions
Failure on line 67
[hjl@gnu-cfl-1 tmp]$ 

Revert the commit fixes i386 vDSO.
Comment 1 Florian Weimer 2018-12-14 20:47:41 UTC
The GNU_EH_FRAME segment is actually empty in our builds.  This breaks unwinding across signal handlers on i386 because the libgcc unwinder does not recognize i386 __kernel_sigreturn as a signal handler frame anymore.

Note You need to log in before you can comment on or make changes to this bug.