FS#75534 - [0ad] Crash with stack trace on launch

Attached to Project: Community Packages
Opened by J. Andrew Lanz-O'Brien (jlanzobr) - Sunday, 07 August 2022, 13:54 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 13 September 2022, 08:18 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
0 A.D. crashes with a stack trace on launch.

$ 0ad
TIMER| InitVfs: 116.88 us
Writing the mainlog at /home/user/.config/0ad/logs/mainlog.html
TIMER| CONFIG_Init: 1.77938 ms
Sound: AlcInit success, using OpenAL Soft
Assertion failed: "ret == 0"
Location: lcpu.cpp:174 (os_cpu_SetThreadAffinityMask)

Call stack:

(0x55e5bbd9ee7c) /usr/bin/pyrogenesis(+0x503e7c) [0x55e5bbd9ee7c]
(0x55e5bbd793bb) /usr/bin/pyrogenesis(+0x4de3bb) [0x55e5bbd793bb]
(0x55e5bbd78eaf) /usr/bin/pyrogenesis(+0x4ddeaf) [0x55e5bbd78eaf]
(0x55e5bbd796f3) /usr/bin/pyrogenesis(+0x4de6f3) [0x55e5bbd796f3]
(0x55e5bbd9e9e9) /usr/bin/pyrogenesis(+0x5039e9) [0x55e5bbd9e9e9]
(0x55e5bbd9ed8b) /usr/bin/pyrogenesis(+0x503d8b) [0x55e5bbd9ed8b]
(0x55e5bbdc8b0c) /usr/bin/pyrogenesis(+0x52db0c) [0x55e5bbdc8b0c]
(0x55e5bbdc884c) /usr/bin/pyrogenesis(+0x52d84c) [0x55e5bbdc884c]
(0x55e5bbdc8a9d) /usr/bin/pyrogenesis(+0x52da9d) [0x55e5bbdc8a9d]
(0x55e5bbd98e9e) /usr/bin/pyrogenesis(+0x4fde9e) [0x55e5bbd98e9e]
(0x55e5bbdc884c) /usr/bin/pyrogenesis(+0x52d84c) [0x55e5bbdc884c]
(0x55e5bbd98c0d) /usr/bin/pyrogenesis(+0x4fdc0d) [0x55e5bbd98c0d]
(0x55e5bbad986c) /usr/bin/pyrogenesis(+0x23e86c) [0x55e5bbad986c]
(0x55e5bbaca0e7) /usr/bin/pyrogenesis(+0x22f0e7) [0x55e5bbaca0e7]
(0x55e5bb8e7a37) /usr/bin/pyrogenesis(+0x4ca37) [0x55e5bb8e7a37]
(0x55e5bb8e613b) /usr/bin/pyrogenesis(+0x4b13b) [0x55e5bb8e613b]

errno = 22 (Invalid alignment)
OS error = ?

Additional info:
* package version: a25.b-6

Steps to reproduce:
1. Launch 0 A.D.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Tuesday, 13 September 2022, 08:18 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 08 August 2022, 17:38 GMT
Can reproduce. This is weird. I'll try building with different options.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 08 August 2022, 18:05 GMT
Can't make it work at all even after trying a different compiler and many different flags. Can you please report this upstream?
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 11 August 2022, 02:54 GMT
Any chance you can compile the package with debug symbols and then provide the upstream developers with a good stacktrace so that they can track the problem down?
Comment by David Roth (V1del) - Thursday, 08 September 2022, 18:52 GMT
I've ran into this a few days ago and did some investigation.

This is actually a kernel change/regression (EDIT: I thought this was weird, checking again this is actually a change/bugfix in glibc 2.36: https://sourceware.org/bugzilla/show_bug.cgi?id=28991 ) which makes it report offline/hotpluggable CPUs when asked for the number of CPUs via sysconf(_SC_NPROCESSORS_CONF) and if you use that to set task affinity the call blows up, easiest I've found to check is whether you might be affected by doing a dmesg | grep smpboot , if that lists a high number of theorethical hotpluggable CPUs that is higher than your actual CPU count you'll likely run into this. As such you can actually work around this by passing possible_cpus=/nr_cpus= on your kernel cmdline and limiting that to your actual logical core count (so if hyper threading is enabled you'll want to include those as well, on my threadripper with 24 physical cores that would be 48 to account for those as well, for reference smpboot did list a theorethical hotplug max of 128)

That for the no code change workaround. With the correct search terms it appears this could also be provoked by explicitly disabling SMT and as such I stumbled on a 0ad patch that will likely remedy this on that side as well, so might be useful to carry that patch.

https://code.wildfiregames.com/D4669
https://code.wildfiregames.com/file/data/l7gwasx4wzjqignni2xd/PHID-FILE-f6jphwngiw5seeabg576/D4669.diff
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 10 September 2022, 04:56 GMT
That's some good in-depth research! I pushed a patched package to [community-testing]. Please give it a spin.
Comment by David Roth (V1del) - Tuesday, 13 September 2022, 07:36 GMT
FWIW as suspected, installing it with that patch applied and dropping the CPU nr limit works correctly here.

Loading...