diff options
author | Etienne Cordonnier <ecordonnier@snap.com> | 2023-12-05 14:37:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-06 22:55:50 +0000 |
commit | 959b1f7de437db9156da11fb799a3c2f4e9082dc (patch) | |
tree | 78b4fe3cada52f6393c24c593d131d817b72e6ed /meta/lib/oeqa/runtime | |
parent | 72342e8eea493777dd278558f9b603a826248937 (diff) | |
download | poky-959b1f7de437db9156da11fb799a3c2f4e9082dc.tar.gz |
gdb/systemd: enable minidebuginfo support conditionally
Enabling minidebuginfo is not useful if gdb and systemd-coredump
are unable to parse it.
In order to parse it, gdb needs xz support. Systemd needs coredump enabled, as
well as elfutil enabled as well (systemd-coredump loads libdw which is part of elfutils using dlopen).
(From OE-Core rev: 0d2df803bebfd7e832ab7da54c4dacaaeeb424a9)
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/systemd.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/cases/systemd.py b/meta/lib/oeqa/runtime/cases/systemd.py index 37f295492d..4c581ba396 100644 --- a/meta/lib/oeqa/runtime/cases/systemd.py +++ b/meta/lib/oeqa/runtime/cases/systemd.py | |||
@@ -5,6 +5,7 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | import re | 7 | import re |
8 | import threading | ||
8 | import time | 9 | import time |
9 | 10 | ||
10 | from oeqa.runtime.case import OERuntimeTestCase | 11 | from oeqa.runtime.case import OERuntimeTestCase |
@@ -136,6 +137,26 @@ class SystemdServiceTests(SystemdTest): | |||
136 | status = self.target.run('mount -oro,remount /')[0] | 137 | status = self.target.run('mount -oro,remount /')[0] |
137 | self.assertTrue(status == 0, msg='Remounting / as r/o failed') | 138 | self.assertTrue(status == 0, msg='Remounting / as r/o failed') |
138 | 139 | ||
140 | @skipIfNotFeature('minidebuginfo', 'Test requires minidebuginfo to be in DISTRO_FEATURES') | ||
141 | @OEHasPackage(['busybox']) | ||
142 | def test_systemd_coredump_minidebuginfo(self): | ||
143 | """ | ||
144 | Verify that call-stacks generated by systemd-coredump contain symbolicated call-stacks, | ||
145 | extracted from the minidebuginfo metadata (.gnu_debugdata elf section). | ||
146 | """ | ||
147 | t_thread = threading.Thread(target=self.target.run, args=("ulimit -c unlimited && sleep 1000",)) | ||
148 | t_thread.start() | ||
149 | time.sleep(1) | ||
150 | |||
151 | status, output = self.target.run('pidof sleep') | ||
152 | # cause segfault on purpose | ||
153 | self.target.run('kill -SEGV %s' % output) | ||
154 | self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output) | ||
155 | |||
156 | (status, output) = self.target.run('coredumpctl info') | ||
157 | self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output) | ||
158 | self.assertEqual('sleep_for_duration (busybox.nosuid' in output, True, msg='Call stack is missing minidebuginfo symbols (functions shown as "n/a"): %s' % output) | ||
159 | |||
139 | class SystemdJournalTests(SystemdTest): | 160 | class SystemdJournalTests(SystemdTest): |
140 | 161 | ||
141 | @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic']) | 162 | @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic']) |