Bug 21428 - [aarch64] tst-backtrace5 testsuite failure
Summary: [aarch64] tst-backtrace5 testsuite failure
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.26
Assignee: Adhemerval Zanella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 04:35 UTC by Siddhesh Poyarekar
Modified: 2017-05-11 20:36 UTC (History)
3 users (show)

See Also:
Host:
Target: aarch64
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Siddhesh Poyarekar 2017-04-26 04:35:12 UTC
The testsuite fails due to failures in tst-backtrace5 and tst-backtrace6 with the following error:

$ cat debug/tst-backtrace5.out 
Obtained backtrace with 7 functions
Function 0: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/debug/tst-backtrace5(handle_signal+0x1c) [0x401bb4]
Function 1: linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x4000382af510]
Function 2: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/libc.so.6(+0xbc578) [0x40003836e578]
Function 3: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/debug/tst-backtrace5(fn+0xe0) [0x401e08]
Function 4: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/debug/tst-backtrace5(fn+0x1c) [0x401d44]
Function 5: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/debug/tst-backtrace5(fn+0x1c) [0x401d44]
Function 6: /var/lib/buildbot/slaves/reservedbit-xgene-ubuntu-aarch64/glibc-aarch64-linux/build/build/debug/tst-backtrace5(do_test+0x14) [0x401e4c]
Failure on line 79
Comment 1 Szabolcs Nagy 2017-04-27 08:25:49 UTC
backtrace is missing the name of cancellation point syscalls because of the asm code layout (function symbol does not cover the part where the syscall is made), this is planned to be fixed during the cancellation cleanup patch set

https://sourceware.org/ml/libc-alpha/2015-06/msg00950.html
Comment 2 Adhemerval Zanella 2017-05-01 13:54:49 UTC
On way to 'fix' the testcases, at least until the cancellation fix lands, is to use a non auto-generation cancellable syscall or a non cancellable syscall for the interruptable one (pause() for instance).
Comment 3 cvs-commit@gcc.gnu.org 2017-05-11 20:30:37 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  31073a53d8ff1e8bac53e34cb626dae5aa6ce69c (commit)
       via  488e08b600416ef96d8148fe5239a6387555b1eb (commit)
       via  679e979bf337ae0c493ee0f77ff43ee06fdc301b (commit)
       via  dfaaee33ba68372e374c14ec05fc8a76bdccdceb (commit)
       via  f6a191a6ee0313d61dffa70d86b033c5a598f907 (commit)
       via  cab6e5af9d51d4398522af782e20c743daf37461 (commit)
       via  b41152d716ee9c5ba34495a54e64ea2b732139b5 (commit)
       via  0f01acb340a0544cb0bc5953e81455c68859946e (commit)
      from  e4252e5c5325490742c7ee504345e50a8cd07f35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=31073a53d8ff1e8bac53e34cb626dae5aa6ce69c

commit 31073a53d8ff1e8bac53e34cb626dae5aa6ce69c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon May 8 11:22:20 2017 -0300

    powerpc: Fix signal handling in backtrace
    
    Now with read consolidation which uses SYSCALL_CANCEL macro, a frame
    pointer is created in the syscall code and this makes the powerpc
    backtrace obtain a bogus entry for the signal handling patch.
    
    It is because it does not setup the correct frame pointer register
    (r1) based on the saved value from the kernel sigreturn.  It was not
    failing because the syscall frame pointer register was the same one
    for the next frame (the function that actually called the syscall).
    
    This patch fixes it by setup the next stack frame using the saved
    one by the kernel sigreturn.  It fixes tst-backtrace{5,6} from
    the read consolidation patch.
    
    Checked on powerpc-linux-gnu and powerpc64le-linux-gnu.
    
    	* sysdeps/powerpc/powerpc32/backtrace.c (is_sigtramp_address): Use
    	void* for argument type and use VDSO_SYMBOL macro.
    	(is_sigtramp_address_rt): Likewise.
    	(__backtrace): Setup expected frame pointer address for signal
    	handling.
    	* sysdeps/powerpc/powerpc64/backtrace.c (is_sigtramp_address): Use
    	void* for argumetn type and use VSDO_SYMBOL macro.
    	(__backtrace): Setup expected frame pointer address for signal
    	handling.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=488e08b600416ef96d8148fe5239a6387555b1eb

commit 488e08b600416ef96d8148fe5239a6387555b1eb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 3 10:33:52 2015 -0200

    Consolidate Linux writev implementation
    
    This patch consolidates the writev Linux syscall implementation on
    sysdeps/unix/sysv/linux/writev.c.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* sysdeps/unix/sysv/linux/writev.c: New file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=679e979bf337ae0c493ee0f77ff43ee06fdc301b

commit 679e979bf337ae0c493ee0f77ff43ee06fdc301b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 3 10:26:18 2015 -0200

    Consolidate Linux readv implementation
    
    This patch consolidates the readv Linux syscall implementation on
    sysdeps/unix/sysv/linux/readv.c.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* sysdeps/unix/sysv/linux/readv.c: New file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dfaaee33ba68372e374c14ec05fc8a76bdccdceb

commit dfaaee33ba68372e374c14ec05fc8a76bdccdceb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 3 10:04:25 2015 -0200

    Consolidate Linux write syscall
    
    This patch consolidates the write Linux syscall implementation on
    sysdeps/unix/sysv/linux/write.c.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* include/unistd.h (write): Add hidden proto.
    	* io/Makefile (CFLAGS-write.c): New rule.
    	* nptl/Makefile (CFLAGS-write.c): Likewise.
    	* sysdeps/unix/sysv/linux/write.c: New file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f6a191a6ee0313d61dffa70d86b033c5a598f907

commit f6a191a6ee0313d61dffa70d86b033c5a598f907
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 3 10:13:18 2015 -0200

    Consolidate Linux read syscall
    
    This patch consolidates the read Linux syscall implementation on
    sysdeps/unix/sysv/linux/read.c.  This leads to a different frame
    pointer creation on some architectures:
    
      * It fixes BZ#21428 on aarch64, since now the returned address
        for the read syscall can be correctly found out by
        backtrace_symbols.
    
      * It makes tst-backtrace{5,6} fails on powerpc due an issue on
        its custom backtrace implementation.  It is fixed on subsequent
        patch from this set.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	[BZ #21428]
    	* include/unistd.h (read): Add hidden proto.
    	* io/Makefile (CFLAGS-read.c): New rule.
    	* nptl/Makefile (CFLAGS-read.c): New rule.
    	* sysdeps/unix/sysv/linux/read.c: New file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cab6e5af9d51d4398522af782e20c743daf37461

commit cab6e5af9d51d4398522af782e20c743daf37461
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Nov 11 14:50:03 2016 -0200

    Consolidate Linux creat implementation
    
    This patch consolidates the creat Linux syscall implementation on
    sysdeps/unix/sysv/linux/creat{64}.c.  The changes are:
    
      1. Remove creat{64} from auto-generation syscalls.list.
      2. Add a new creat{64}.c implementation.  For architectures that
         define __OFF_T_MATCHES_OFF64_T the default creat64 will create
         alias to required creat symbols.
      3. Use __NR_creat where possible, otherwise use internal open{64}
         call with expected flags.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* io/Makefile (CFLAGS-creat.c): New rule.
    	(CFLAGS-creat64.c): Likewise.
    	* sysdeps/unix/sysv/linux/alpha/creat.c: Remove file.
    	* sysdeps/unix/sysv/linux/generic/creat.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/creat64.c: Likewise.
    	* sysdeps/unix/sysv/linux/creat.c: New file.
    	* sysdeps/unix/sysv/linux/creat64.c: Likewise.
    	* sysdeps/unix/sysv/linux/syscalls.list: Remove create from
    	auto-generated list.
    	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b41152d716ee9c5ba34495a54e64ea2b732139b5

commit b41152d716ee9c5ba34495a54e64ea2b732139b5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Nov 11 15:00:03 2016 -0200

    Consolidate Linux open implementation
    
    This patch consolidates the open Linux syscall implementation on
    sysdeps/unix/sysv/linux/open{64}.c.  The changes are:
    
      1. Remove open{64} from auto-generation syscalls.list.
      2. Add a new open{64}.c implementation.  For architectures that
         define __OFF_T_MATCHES_OFF64_T the default open64 will create
         alias to required open symbols.
      3. Use __NR_openat as default syscall for open{64}.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* sysdeps/unix/sysv/linux/generic/open.c: Remove file.
    	* sysdeps/unix/sysv/linux/generic/open64.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/open64.c: Likewise.
    	* sysdeps/unix/sysv/linux/open.c: New file.
    	* sysdeps/unix/sysv/linux/open64.c (__libc_open64): Use O_LARGEFILE
    	only for __OFF_T_MATCHES_OFF64_T and add alias to open if the case.
    	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Remove open
    	from auto-generated list.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0f01acb340a0544cb0bc5953e81455c68859946e

commit 0f01acb340a0544cb0bc5953e81455c68859946e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Oct 29 19:26:05 2015 -0200

    Consolidate Linux close syscall generation
    
    This patch consolidates the close Linux syscall generation on
    sysdeps/unix/sysv/linux/close.c.
    
    Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
    arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.
    
    	* nptl/Makefile (CFLAGS-close.c): New flag.
    	* sysdeps/unix/sysv/linux/close.c: New file.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                         |   50 +++++++++++++++++
 include/unistd.h                                  |    2 +
 io/Makefile                                       |    4 +
 nptl/Makefile                                     |    3 +
 sysdeps/powerpc/powerpc32/backtrace.c             |   17 +++--
 sysdeps/powerpc/powerpc64/backtrace.c             |   17 +++--
 sysdeps/unix/sysv/linux/alpha/creat.c             |    8 ---
 sysdeps/unix/sysv/linux/close.c                   |   30 ++++++++++
 sysdeps/unix/sysv/linux/creat.c                   |   40 +++++++++++++
 sysdeps/unix/sysv/linux/creat64.c                 |   41 ++++++++++++++
 sysdeps/unix/sysv/linux/generic/creat.c           |   37 ------------
 sysdeps/unix/sysv/linux/generic/open.c            |   62 ---------------------
 sysdeps/unix/sysv/linux/generic/open64.c          |   44 ---------------
 sysdeps/unix/sysv/linux/open.c                    |   51 +++++++++++++++++
 sysdeps/unix/sysv/linux/open64.c                  |   24 +++++++-
 sysdeps/unix/sysv/linux/read.c                    |   33 +++++++++++
 sysdeps/unix/sysv/linux/readv.c                   |   27 +++++++++
 sysdeps/unix/sysv/linux/syscalls.list             |    1 -
 sysdeps/unix/sysv/linux/wordsize-64/creat64.c     |    1 -
 sysdeps/unix/sysv/linux/wordsize-64/open64.c      |    1 -
 sysdeps/unix/sysv/linux/wordsize-64/syscalls.list |    2 -
 sysdeps/unix/sysv/linux/write.c                   |   33 +++++++++++
 sysdeps/unix/sysv/linux/writev.c                  |   27 +++++++++
 23 files changed, 381 insertions(+), 174 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/alpha/creat.c
 create mode 100644 sysdeps/unix/sysv/linux/close.c
 create mode 100644 sysdeps/unix/sysv/linux/creat.c
 create mode 100644 sysdeps/unix/sysv/linux/creat64.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/creat.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/open.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/open64.c
 create mode 100644 sysdeps/unix/sysv/linux/open.c
 create mode 100644 sysdeps/unix/sysv/linux/read.c
 create mode 100644 sysdeps/unix/sysv/linux/readv.c
 delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/creat64.c
 delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/open64.c
 create mode 100644 sysdeps/unix/sysv/linux/write.c
 create mode 100644 sysdeps/unix/sysv/linux/writev.c
Comment 4 Adhemerval Zanella 2017-05-11 20:36:06 UTC
Fixed by f6a191a6ee0313d61dffa70d86b033c5a598f907.