Package: btop
Version: 1.3.0-1
I am using Debian sid. When I invoke btop from shell prompt it shows
`Segmentation fault (core dumped)`
I downloaded the source code using `apt source btop' and debugged it with gdb,
and found
the struct rsmi_frequencies defined in
btop-1.3.0/src/linux/btop_collect.cpp:177 is
struct rsmi_frequencies_t {uint32_t num_supported, current,
frequency[RSMI_MAX_NUM_FREQUENCIES];};
But the same name struct provided by librocm-smi-dev 6.1.2-1 is:
typedef struct {
/**
* Deep Sleep frequency is only supported by some GPUs
*/
bool has_deep_sleep;
/**
* The number of supported frequencies
*/
uint32_t num_supported;
/**
* The current frequency index
*/
uint32_t current;
/**
* List of frequencies.
* Only the first num_supported frequencies are valid.
*/
uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES];
} rsmi_frequencies_t;
It led to the stack smashing after
rsmi_dev_gpu_clk_freq_get(btop-1.3.0/src/linux/btop_collect.cpp:1371) returned.
After updating this struct, the crash disappeared, and btop can work normally.
I also found the upstream btop on github has solved this issue by selecting the
right struct based on the ROCM version:
https://github.com/aristocratos/btop/blob/53df78db887150ad961c021bcbc0b0a25f62c4a7/src/linux/btop_collect.cpp#L191
Can btop be upgraded to resolve this issue?