Repository navigation
tests/ui-smoke: match the versioned python in coredumpctl - #4703
Conversation
A bare name given to coredumpctl matches the command name, and the GUIs run from a "#!/usr/bin/python3.13" line, so systemd-coredump records them as "gmoccapy", "qtvcp" and so on, with /usr/bin/python3.13 as the executable. The "python3" match found nothing and crashdump.sh never got the core. Match the resolved path of python3 instead, which coredumpctl compares with the executable, and give the same path to gdb. Hannes Diethelm found it in LinuxCNC#4648.
|
Thanks for fixing this. Tested, it works. Now looking at the code: coredumpctl could race in parallel tests. You take the newest coredump since test start, right? So if multiple tests crash, you could get twice the same coredump or otherwise mixed up results. There is pretty much no doc about this, so i tested it. Inside bwrap, you see coredumps created in an other bwrap the way it is set up right now with coredumpctl due to the host handles coredumps but read access inside the bwrap to coredumps works fine. However, the PID is not the one inside but the one from the host. File coredumps work well due to there are handled respecting the mount namespace. With Do you have a good idea to fix this?
|
systemd-coredump lists the cores of every sandbox of a parallel run, and the PID it records is the host one, so taking the newest python core since arming can give one test the core of another. Hannes Diethelm pointed this out on LinuxCNC#4703. Tag the launcher's environment with a UUID, which systemd-coredump keeps with the core, and dump the core whose environment carries the tag.
|
@hdiethelm, thanks for testing, and yes: it took the newest python core since arming, so in a parallel run one test can get the core of another. Counting the cores would not catch the worst case: a test that fails without crashing, while another test crashes, sees exactly one core and prints a backtrace that is not its own. I pushed a fix. Tested with systemd-coredump on Debian 13, with the gmoccapy and axis ui-smoke tests run at the same time in two bwrap sandboxes and each GUI killed with SIGSEGV: before, both reports showed the axis core; now each shows its own. With a small crashing script in three sandboxes, two crashing and one not, the one that did not crash now reports no core instead of another's. For parallel runs the file |
|
This is a neat trick, using the environment to tag a process family. I tested it, works nicely. For the sandbox mode, I would not say using There is one thing that I found while running the parallel tests: If a process segfaults in a test but does not alter the result, like rtapi_app on unload, some tests just pass. Using a similar tag + journalctl to scan for segfaults after each test should make it possible to detect this. However not every OS uses systemd. I will just create an issue for now to tackle this in the future, it should be a new PR after #4648 was merged. |
|
@hdiethelm, thanks for testing. Fair point on the file |
@hdiethelm, this is the coredumpctl bug you found in #4648.
A bare name given to coredumpctl matches the command name, and the GUIs start from a
#!/usr/bin/python3.13line, so systemd-coredump records a crashed gmoccapy asgmoccapy, with/usr/bin/python3.13as the executable. Thepython3match incrashdump.shfound nothing and the report always fell back to "no readable core dump". It now matchesreadlink -f "$(command -v python3)", which coredumpctl compares with the executable and which finds the right interpreter whatever its version, and gdb gets that path too.Tested with systemd-coredump on Debian 13: a script with a
#!/usr/bin/python3.13line that segfaults aftercrashdump_arm. On master the report says there is no core; with this change it prints the native backtrace. The plain-filecore_patternpath is unchanged.