Bug 38616 - /usr/sbin/hddtemp -nq -u C /dev/sda Ошибка сегментирования
Summary: /usr/sbin/hddtemp -nq -u C /dev/sda Ошибка сегментирования
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: hddtemp (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Michael Shigorin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-16 06:58 MSK by Vitaly Chikunov
Modified: 2020-06-16 14:03 MSK (History)
1 user (show)

See Also:


Attachments
патч vt@ из сборочного задания 253512 (1.10 KB, patch)
2020-06-16 13:37 MSK, Michael Shigorin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Chikunov 2020-06-16 06:58:50 MSK
5.4.41-std-def-alt1:~# /usr/sbin/hddtemp -nq -u C /dev/sda
Ошибка сегментирования

5.4.41-std-def-alt1:~# gdb --args /usr/sbin/hddtemp -nq -u C /dev/sda
GNU gdb (GDB) 8.3-alt2 (ALT Sisyphus)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-alt-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/hddtemp...
Reading symbols from /usr/lib/debug/usr/sbin/hddtemp.debug...
(gdb) r
Starting program: /usr/sbin/hddtemp -nq -u C /dev/sda

Program received signal SIGSEGV, Segmentation fault.
0x00000000004053bc in value_to_unit (dsk=0xae1740) at hddtemp.c:97
97          if(dsk->db_entry->unit == 'F')
   0x00000000004053b8 <value_to_unit+40>:       48 8b 57 28     mov    0x28(%rdi),%rdx
=> 0x00000000004053bc <value_to_unit+44>:       80 7a 18 46     cmpb   $0x46,0x18(%rdx)
   0x00000000004053c0 <value_to_unit+48>:       75 eb   jne    0x4053ad <value_to_unit+29>
(gdb) bt
#0  0x00000000004053bc in value_to_unit (dsk=0xae1740) at hddtemp.c:97
#1  0x0000000000405650 in display_temperature (dsk=0xae1740) at hddtemp.c:213
#2  do_direct_mode (ldisks=<optimized out>) at hddtemp.c:257
#3  0x0000000000403b12 in main (argc=<optimized out>, argv=0x7fffaa5b37b8) at hddtemp.c:530
(gdb) p dsk
$1 = (struct disk *) 0xae1740
(gdb) p dsk->db_entry
$2 = (struct harddrive_entry *) 0x0
(gdb)
Comment 1 Michael Shigorin 2020-06-16 12:31:26 MSK
Боюсь, апстрим этим заниматься не будет -- текущая версия фигурирует как "very old stuff": http://www.guzu.net/linux/hddtemp.php; может, попробуешь починить?

PS: на localhost не воспроизводится (sda -- SSD):

# /usr/sbin/hddtemp -nq -u C /dev/sda
0
Comment 2 Michael Shigorin 2020-06-16 13:37:29 MSK
Created attachment 8839 [details]
патч vt@ из сборочного задания 253512

Спасибо тебе; патч предложен в апстрим:
http://savannah.nongnu.org/bugs/index.php?58582
Comment 3 Vitaly Chikunov 2020-06-16 13:43:41 MSK
Да, только ссылка на патч не рабочая, так как я, не предполагая, что бы будешь ставить ссылку, удалил у себя hddtemp.git.

Думаю, надо ставить ссылку на gears, после DONE.
Comment 4 Repository Robot 2020-06-16 14:03:08 MSK
hddtemp-20110629:0.3-alt15.beta15 -> sisyphus:

 Tue Jun 16 2020 Vitaly Chikunov <vt@altlinux> 20110629:0.3-alt15.beta15
 - fix crash on numeric output if disk is not in db (closes: #38616)