chwd icon indicating copy to clipboard operation
chwd copied to clipboard

chwd 1.18.1 crashes with SIGSEGV on Intel Panther Lake platform

Open xiaohuangbo opened this issue 4 months ago • 3 comments

Description

"chwd" crashes immediately with a segmentation fault on my system, regardless of whether it is executed as a normal user or as root.

The following commands all crash:

chwd chwd -a sudo chwd sudo chwd -a

The crash is reproducible 100% of the time.

Environment

  • Distribution: CatOS (Arch-based)
  • chwd: 1.18.1-1
  • pciutils: 3.15.0-1
  • hwdata: 0.409-1
  • Kernel: Linux 7.1.4-arch1-1
  • CPU: Intel Core Ultra Series 3 (Panther Lake)
  • GPU: Intel Arc B390 (PCI ID: 8086:b082)

Expected behavior

"chwd" should detect the hardware normally and exit successfully.

Actual behavior

"chwd" immediately crashes with:

SIGSEGV (Segmentation fault)

GDB backtrace

Program terminated with signal SIGSEGV, Segmentation fault.

#0 pci_lookup_name( a=0x0, buf=0x561c49b5b620, size=1024, flags=4) at pciutils/lib/names.c:135

135 flags |= a->id_lookup_mode;

The pointer passed as the first argument is NULL:

a = 0x0

The complete stack trace is:

#0 pci_lookup_name (libpci.so.3) #1 chwd +0xd008e #2 chwd +0xc4fe3 #3 chwd +0xde41e #4 libc.so.6 #5 __libc_start_main #6 chwd +0xc0385

Unfortunately, the released "chwd" binary does not contain debug symbols, so GDB cannot resolve the internal function names.


Additional information

"lspci" works correctly, indicating that "libpci" itself is functioning normally.

Example:

0000:00:02.0 VGA compatible controller: Intel Corporation Panther Lake [Arc B390] [8086:b082]

0000:2b:00.0 Network controller: Realtek RTL8852BE [10ec:b852]

There are no issues with:

  • pciutils
  • hwdata
  • shared libraries ("ldd /usr/bin/chwd" shows no missing dependencies)

Reinstalling the following packages does not resolve the problem:

  • chwd
  • pciutils
  • hwdata

Possible cause

From the backtrace, it appears that "chwd" is calling "pci_lookup_name()" with a NULL "struct pci_access *".

It looks like the return value of "pci_alloc()" (or equivalent initialization) is either not checked or the pointer is not initialized before being passed to "pci_lookup_name()".

This may also be related to newer Intel Panther Lake hardware or a code path that has not been tested on recent PCI devices.

If you need any additional logs or if you would like me to test a patched build, I'd be happy to help.

Crash log.txt

xiaohuangbo avatar Jul 27 '26 03:07 xiaohuangbo

Possibly it just needs rebuild

vnepogodin avatar Jul 27 '26 08:07 vnepogodin

video controller class id also seems incorrect

vnepogodin avatar Jul 27 '26 08:07 vnepogodin

Possibly it just needs rebuild

Thank you! After I manually compiled chwd, it was indeed able to run successfully!

xiaohuangbo avatar Jul 28 '26 07:07 xiaohuangbo