hwloc-distrib segfaults/asserts when being passed 0
Closed this issue · 1 comments
StephanDollberg commented
What version of hwloc are you using?
5ec2613 / 2nd August
Which operating system and hardware are you running on?
Linux rp 6.10.3-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Aug 5 14:46:47 UTC 2024 x86_64 GNU/Linux
lstopo output here: https://gist.github.com/StephanDollberg/d8c9b4985fe5ed7eb86f9600cd9504c3
CPU is Intel 13900K
Details of the problem
Running hwloc-distrib
and passing a 0 argument results in a segfault/assert, for example:
./utils/hwloc/hwloc-distrib 0 --single --restrict 0x0000ffff
hwloc-distrib: /build/hwloc/include/hwloc/helper.h:1006: hwloc_distrib: Assertion `given' failed.
Aborted (core dumped)
Full (debug) output at https://gist.github.com/StephanDollberg/c69117bcd9894737317a47974c3acd9f
I guess 0 isn't a valid input but I think hwloc should gracefully reject that.
Additional information
Don't think this is a topology issue. Reproduciable on many different systems and kernel.s
bgoglin commented
Thanks, easy fix for something never tested, I am backporting it to stable branches.