user prog sensors seg faults
I did a debuging link of sensors and got the exact place where it crashes:
| Program received signal SIGSEGV, Segmentation fault. | 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | at lib/sysfs.c:57 | 57 if (attr->len >= 11 && !strcmp(attr->value + attr->len
- 11,
(gdb) backtrace
#0 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230)
at lib/sysfs.c:57
#1 0x000000000041eb82 in sensors_read_sysfs_chips () at lib/sysfs.c:154
#2 0x000000000041e609 in sensors_init (input=0x54e6a0) at lib/init.c:45
#3 0x000000000040210c in main (argc=2, argv=0x7ffffb0a2168)
at prog/sensors/main.c:237attached is the sensors.conf file generated by sensors-detect
| > We have a dual Opteron 285 system on a Tyan Tiger K8WE (S2877) | > motherboard. The make user ; make user_install went fine. The | > sensor-detect script seemed to run ok and the modprobes seemed to work | > but the "sensors -s" command segfaults. Is it a 64 bit problem? Using | > Suse 10.1 x86_64 beta atm. | | | Which version of lm_sensors is this?
2.10.0
| Which beta is this?
10.1 beta 9
Quoted 1 line
uname -a
Linux wsiopt64 2.6.16-8-smp #1 SMP Tue Mar 28 11:00:06 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
thanks
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sensors.conf
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060508/3da23e83/sensors-0001.pl
Hi:
Quoted 11 lines · lloyd
I did a debuging link of sensors and got the exact place where it crashes:
| Program received signal SIGSEGV, Segmentation fault. | 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | at lib/sysfs.c:57 | 57 if (attr->len >= 11 && !strcmp(attr->value + attr->len- 11,
Quoted 7 lines
(gdb) backtrace
#00x000000000041e910insensors_read_one_sysfs_chip(dev=0x550230)
atlib/sysfs.c:57#1 0x000000000041eb82 in sensors_read_sysfs_chips () at lib/sysfs.c:154 #2 0x000000000041e609 in sensors_init (input=0x54e6a0) at lib/init.c:45 #3 0x000000000040210c in main (argc=2, argv=0x7ffffb0a2168)at
prog/sensors/main.c:237
Can you set a breakpoint at that line (lib/sysfs.c:57) and tell me what are the contents of attr->len and attr->value? Thanks.
Quoted 17 lines
attached is the sensors.conf file generated by sensors-detect
| > We have a dual Opteron 285 system on a Tyan Tiger K8WE (S2877) | > motherboard. The make user ; make user_install went fine. The | > sensor-detect script seemed to run ok and the modprobes seemed to work | > but the "sensors -s" command segfaults. Is it a 64 bit problem? Using | > Suse 10.1 x86_64 beta atm. | | | Which version of lm_sensors is this?2.10.0
| Which beta is this?
Quoted 7 lines
10.1 beta 9
Quoted 1 line
uname -a
Linux wsiopt64 2.6.16-8-smp #1 SMP Tue Mar 28 11:00:06 UTC 2006
x86_64x86_64x86_64GNU/Linuxthanks
[sensors.conf snipped]
Regards,
Signature · 2 lines
Mark M. Hoffman mhoffman at lightlink.com
Hi lloyd,
Quoted 6 lines
I did a debuging link of sensors and got the exact place where it crashes:
| Program received signal SIGSEGV, Segmentation fault. | 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | at lib/sysfs.c:57 | 57 if (attr->len >= 11 && !strcmp(attr->value + attr->len - 11,
This suggests a bug in libsysfs.
Quoted 10 lines
(gdb) backtrace
#00x000000000041e910insensors_read_one_sysfs_chip(dev=0x550230)at lib/sysfs.c:57 #1 0x000000000041eb82 in sensors_read_sysfs_chips () at lib/sysfs.c:154 #2 0x000000000041e609 in sensors_init (input=0x54e6a0) at lib/init.c:45 #3 0x000000000040210c in main (argc=2, argv=0x7ffffb0a2168) at prog/sensors/main.c:237attached is the sensors.conf file generated by sensors-detect
Does "sensors -c /dev/null" crash too? If it does, it means that the configuration file is not reponsible.
Which hardware monitoring drivers are used?
Output of:/sbin/lsmod | grep hwmon
cat /sys/class/hwmon/hwmon*/device/name
If there are more than one driver, please try each driver individually to see if the crash is related a given driver.
Quoted 3 lines
| Which beta is this?
10.1 beta 9
Now that 10.1 final is out, I'd suggest that you upgrade to that.
Signature · 1 line
Jean Delvare
Jean Delvare <khali at linux-fr.org> wrote:
| Does "sensors -c /dev/null" crash too? If it does, it means that the | configuration file is not reponsible.
yes it does.
| | Which hardware monitoring drivers are used? | | Output of: | /sbin/lsmod | grep hwmon | cat /sys/class/hwmon/hwmon*/device/name
lloyd at wsiopt64:~> sensors -c /dev/null Segmentation fault
lloyd at wsiopt64:~> /sbin/lsmod | grep hwmon
hwmon 19848 1 smsc47b397
lloyd at wsiopt64:~> cat /sys/class/hwmon/hwmon*/device/name smsc47b397
lloyd at wsiopt64:~>
I havnt seen any docs mentioning this chip, Is it even supported at all?
| | If there are more than one driver, please try each driver individually | to see if the crash is related a given driver.
Just the one.
"Mark M. Hoffman" <mhoffman at lightlink.com> wrote:
| > I did a debuging link of sensors and got the exact place where it crashes: | > | > | > | Program received signal SIGSEGV, Segmentation fault. | > | 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | > | at lib/sysfs.c:57 | > | 57 if (attr->len >= 11 && !strcmp(attr->value + attr->len | > - 11, | > | > | > (gdb) backtrace | > #0 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | > at lib/sysfs.c:57 | > #1 0x000000000041eb82 in sensors_read_sysfs_chips () at lib/sysfs.c:154 | > #2 0x000000000041e609 in sensors_init (input=0x54e6a0) at lib/init.c:45 | > #3 0x000000000040210c in main (argc=2, argv=0x7ffffb0a2168) | > at prog/sensors/main.c:237
| Can you set a breakpoint at that line (lib/sysfs.c:57) and tell me what are the contents of attr->len and attr->value? Thanks
(gdb) run
Starting program: /home/lloyd/lm_sensors/lm_sensors-2.10.0/prog/sensors/sensors
Program received signal SIGSEGV, Segmentation fault. 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230)
at lib/sysfs.c:57
57 if (attr->len >= 11 && !strcmp(attr->value + attr->len - 11,
(gdb) p attr
$1 = (struct sysfs_attribute *) 0x5524b0
(gdb) p *attr
$2 = {name = "name", '\0' <repeats 46 times>, "/sys/devices/p",
path = "latform/i2c-9191/9191-0480/name", '\0' <repeats 218 times>, "&U\000\000\000\000", value = 0x1000b <Address 0x1000b out of bounds>, len = 33, method = 0}
(gdb)
... so I looks like the name and path are messed up as well as the value pointer. the len of 33 might be ok, who knows.
Hi lloyd,
Quoted 9 lines
lloyd at wsiopt64:~> sensors -c
/dev/nullSegmentation fault
lloyd at wsiopt64:~>/sbin/lsmod| grep hwmon
hwmon 19848 1 smsc47b397
lloyd at wsiopt64:~> cat/sys/class/hwmon/hwmon*/device/namesmsc47b397
lloyd at wsiopt64:~>I havnt seen any docs mentioning this chip, Is it even supported at all?
We try to support every drivers we have. However this one was written without the benefit of an official datasheet. It is probably incomplete, although we had success reports already.
Please go to /sys/class/hwmon/hwmon0/device, list what you see there and try to read the values of all files. If it works, I'd say that the driver works OK and libsysfs and/or libsensors is the problem.
Which version of the libsysfs package are you using?
I'm sorry to insist, but at this point the most reasonable thing to do is upgrade to Suse 10.1 final and try again. Having problems on an old beta version is not that surprising.
Signature · 1 line
Jean Delvare
Hi lloyd:
Quoted 20 lines · lloyd
"Mark M. Hoffman" <mhoffman at lightlink.com> wrote:
| > I did a debuging link of sensors and got the exact place where it crashes: | > | > | > | Program received signal SIGSEGV, Segmentation fault. | > | 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | > | at lib/sysfs.c:57 | > | 57 if (attr->len >= 11 && !strcmp(attr->value + attr->len | > - 11, | > | > | > (gdb) backtrace | > #0 0x000000000041e910 in sensors_read_one_sysfs_chip (dev=0x550230) | > at lib/sysfs.c:57 | > #1 0x000000000041eb82 in sensors_read_sysfs_chips () at lib/sysfs.c:154 | > #2 0x000000000041e609 in sensors_init (input=0x54e6a0) at lib/init.c:45 | > #3 0x000000000040210c in main (argc=2, argv=0x7ffffb0a2168) | > at prog/sensors/main.c:237
Quoted 2 lines
| Can you set a breakpoint at that line (
lib/sysfs.c:57) and tell me what are the contents ofattr->lenandattr->value? Thanks
Thanks for helping to debug further...
Quoted 11 lines
(gdb) run
Starting program:/home/lloyd/lm_sensors/lm_sensors-2.10.0/prog/sensors/sensorsProgram received signal SIGSEGV, Segmentation fault.
0x000000000041e910insensors_read_one_sysfs_chip(dev=0x550230)at lib/sysfs.c:5757 if (
attr->len>= 11 && !strcmp(attr->value +attr->len- 11,
(gdb) p attr
$1 = (structsysfs_attribute*)0x5524b0
(gdb) p *attr
$2 = {name = "name", '\0' <repeats 46 times>, "/sys/devices/p",
Aha: the 'name' element of struct sysfs_attribute is supposed to be a (string) array of 50 chars - according to libsysfs.h on my system. Meanwhile, GDB thinks yours is 64 chars. I think you probably have a mismatch between the version of the header file libsysfs.h and the version of the compiled library libsyfs.so.
I.e. libsensors is expecting attr.name to be 64 chars while your libsysfs treats it as 50 chars. Of course that will lead to segfaults.
Quoted 1 line
path = "latform/i2c-9191/9191-0480/name", '\0' <repeats 218 times>, "&U\000\000\000\000",
This further confirms that the two libraries disagree about the structure definition. See how the path got chopped up?
Quoted 6 lines
value =
0x1000b<Address0x1000bout of bounds>, len = 33, method = 0}
(gdb)... so I looks like the name and path are messed up as well as the value pointer. the len of 33 might be ok, who knows.
Nope, everything after 'name' in the struct is fubar.
What to do? Make sure that you have just one version of libsysfs installed, and just one set of header files from the same version. Then rebuild sensors (be sure to 'make clean' first) and I expect it will work.
Regards,
Signature · 2 lines
Mark M. Hoffman mhoffman at lightlink.com