tw_cli 在 3.10 kernel 出现的崩溃原因

编写于

http://serverfault.com/questions/525923/lsi-3ware-tw-cli-and-tdm2-segfault-with-debian-linux-kernels-after-3-8?answertab=votes#tab-top

The problem isn’t the date, it’s that tw_cli is looking for X.Y.Z(-R-arch) in the release and it’s only getting X.Y(-R-arch) - 3.2.0-4-amd64 vs 3.10-2-amd64. When the release is set to 3.10.0-2-amd64 it runs fine. They may be doing a sscanf() with limited formats, and little or no error checking.

jam:~# uname -r
3.10-2-amd64
jam:~# tw_cli /c0 show firmware
Segmentation fault
jam:~# echo 3.10.0-2-amd64 > /sys/module/utsname/parameters/release
jam:~# uname -r
3.10.0-2-amd64
jam:~# tw_cli /c0 show firmware
/c0 Firmware Version = FE9X 4.10.00.027
If the binary was dynamic you could see about a uname() replacement with LD_PRELOAD but it’s static. There’s no source code so our options are limited:

LSI/3ware fixes tw_cli, hopefully removing all the uname() nonsense
Get Debian to use X.Y.Z-R-arch in release
Someone good with assembly comes up with a binary patch or something similar
Run a custom kernel
Run an older kernel
Ditch 3ware
I like my 9650 but this is crap.

竟然是因为版本号的问题!