Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1154248

Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user

From Michael Tokarev <mjt@tls.msk.ru>
Newsgroups linux.debian.bugs.dist
Subject Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user
Date 2023-07-14 21:40 +0200
Message-ID <GRwNX-eWi-5@gated-at.bofh.it> (permalink)
References (3 earlier) <GRr1U-bwl-13@gated-at.bofh.it> <GRdih-2QS-3@gated-at.bofh.it> <GRw1z-er1-1@gated-at.bofh.it> <GRdih-2QS-3@gated-at.bofh.it> <GRw1z-er1-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


14.07.2023 21:34, Thorsten Glaser wrote:
..

> And, indeed, the combination of klibc-sKNr1Fw-Rh9G1FYpGCXRnrwmP2A.so
> and fstype from 2.0.4-2 (jessie) also fails, so you have something
> that can reliably be used in bisect tests I think.

Ok, this works.  The bisection points to this commit between qemu v4.2.0
and v5.0.0:

https://gitlab.com/qemu-project/qemu/-/commit/6fd5944980f4ccee728ce34bdaffc117db50b34d

commit 6fd5944980f4ccee728ce34bdaffc117db50b34d
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Fri Jan 17 13:02:45 2020 -1000

     linux-user: Reserve space for brk

     With bad luck, we can wind up with no space at all for brk,
     which will generally cause the guest malloc to fail.

     This bad luck is easier to come by with ET_DYN (PIE) binaries,
     where either the stack or the interpreter (ld.so) gets placed
     immediately after the main executable.

     But there's nothing preventing this same thing from happening
     with ET_EXEC (normal) binaries, during probe_guest_base().

     In both cases, reserve some extra space via mmap and release
     it back to the system after loading the interpreter and
     allocating the stack.

     The choice of 16MB is somewhat arbitrary.  It's enough for libc
     to get going, but without being so large that 32-bit guests or
     32-bit hosts are in danger of running out of virtual address space.
     It is expected that libc will be able to fall back to mmap arenas
     after the limited brk space is exhausted.

     Launchpad: https://bugs.launchpad.net/qemu/+bug/1749393
     Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
     Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
     Tested-by: Alex Bennée <alex.bennee@linaro.org>
     Message-Id: <20200117230245.5040-1-richard.henderson@linaro.org>
     Signed-off-by: Laurent Vivier <laurent@vivier.eu>


Does this ring any bells?  Verified on armhf.
I'll bug upstream.

Thanks,

/mjt

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#1040981: klibc-utils: Segmentation fault while executin klibc binaries in armhf architecture under qemu-user Thorsten Glaser <tg@debian.org> - 2023-07-14 00:50 +0200
  Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Thorsten Glaser <tg@debian.org> - 2023-07-14 02:20 +0200
    Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Helge Deller <deller@gmx.de> - 2023-07-14 06:20 +0200
  Bug#1040981: klibc-utils: Segmentation fault while executin klibc binaries in armhf architecture under qemu-user Ben Hutchings <ben@decadent.org.uk> - 2023-07-14 15:30 +0200
    Bug#1040981: klibc-utils: Segmentation fault while executin klibc binaries in armhf architecture under qemu-user Michael Tokarev <mjt@tls.msk.ru> - 2023-07-14 15:40 +0200
    Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Thorsten Glaser <tg@debian.org> - 2023-07-14 20:50 +0200
      Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Michael Tokarev <mjt@tls.msk.ru> - 2023-07-14 21:40 +0200
        Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Thorsten Glaser <tg@debian.org> - 2023-07-14 22:20 +0200
          Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Michael Tokarev <mjt@tls.msk.ru> - 2023-07-14 22:30 +0200
            Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Thorsten Glaser <tg@debian.org> - 2023-07-15 00:20 +0200
              Bug#1040981: klibc-utils: segfault executing armhf binaries under qemu-user Ben Hutchings <ben@decadent.org.uk> - 2023-07-15 23:50 +0200

csiph-web