summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-25 23:31:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-26 14:25:31 +0000
commitf456f7b8969b250150f2e2b9f47e0ece5aeabc45 (patch)
treea24b8f15018d8b4f129039b58a235d54999fbce1 /meta/recipes-devtools/qemu
parentbb630c3e29a816fdb6467952b1162adb2f60b593 (diff)
downloadpoky-f456f7b8969b250150f2e2b9f47e0ece5aeabc45.tar.gz
qemu: Fix segfaults in webkitgtk:do_compile on debian11
Add a work around for segfaults we're seeing with qemu 8.2.0 when compiling webkitgtk on debian 11 autobuilder workers. The issue has been reported upstream to work out an official fix. [YOCTO #15367] (From OE-Core rev: 28ab691587e689872b2e2ddd210507cc2ae86f9b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc1
-rw-r--r--meta/recipes-devtools/qemu/qemu/fix_segv.patch47
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index ccb2880402..bc1440249d 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -34,6 +34,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
34 file://fixedmeson.patch \ 34 file://fixedmeson.patch \
35 file://0001-vfio-Include-libgen.h-for-basename-API.patch \ 35 file://0001-vfio-Include-libgen.h-for-basename-API.patch \
36 file://no-pip.patch \ 36 file://no-pip.patch \
37 file://fix_segv.patch \
37 file://qemu-guest-agent.init \ 38 file://qemu-guest-agent.init \
38 file://qemu-guest-agent.udev \ 39 file://qemu-guest-agent.udev \
39 " 40 "
diff --git a/meta/recipes-devtools/qemu/qemu/fix_segv.patch b/meta/recipes-devtools/qemu/qemu/fix_segv.patch
new file mode 100644
index 0000000000..da5ae87e0c
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/fix_segv.patch
@@ -0,0 +1,47 @@
1With qemu 8.2.0 we started seeing SEGV errors when compiling webkitgtk from
2usermode qemu:
3
4qemu-x86_64: QEMU internal SIGSEGV {code=MAPERR, addr=0x20}
5Segmentation fault
6
7By bisection, this was tracked down to:
8
9commit 7b7a3366e142d3baeb3fd1d3660a50e7956c19eb
10Author: Richard Henderson <richard.henderson@linaro.org>
11Date: Tue Aug 8 20:02:19 2023 -0700
12
13 linux-user: Use walk_memory_regions for open_self_maps
14
15 Replace the by-hand method of region identification with
16 the official user-exec interface. Cross-check the region
17 provided to the callback with the interval tree from
18 read_self_maps().
19
20 Tested-by: Helge Deller <deller@gmx.de>
21 Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
22 Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
23
24and specifically to 'n' being NULL. For now, just skip in that case
25until a proper fix can be identified.
26
27Reported upstream: https://www.mail-archive.com/qemu-devel@nongnu.org/msg1018813.html
28
29YOCTO #15367
30
31Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
32Upstream-Status: Pending
33
34diff --git a/linux-user/syscall.c b/linux-user/syscall.c
35index e384e14248..2577fb770d 100644
36--- a/linux-user/syscall.c
37+++ b/linux-user/syscall.c
38@@ -8085,6 +8085,9 @@ static int open_self_maps_2(void *opaque, target_ulong guest_start,
39 while (1) {
40 IntervalTreeNode *n =
41 interval_tree_iter_first(d->host_maps, host_start, host_start);
42+ if (!n) {
43+ return 0;
44+ }
45 MapInfo *mi = container_of(n, MapInfo, itree);
46 uintptr_t this_hlast = MIN(host_last, n->last);
47 target_ulong this_gend = h2g(this_hlast) + 1;