* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
@ 2006-05-10 3:51 ` Mark M. Hoffman
2006-05-13 22:17 ` Jean Delvare
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Mark M. Hoffman @ 2006-05-10 3:51 UTC (permalink / raw)
To: lm-sensors
Hi:
* lloyd <millerlf at telus.net> [2006-05-08 07:48:54 -0600]:
>
> 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.
> 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?
>
> 10.1 beta 9
>
> >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
[sensors.conf snipped]
Regards,
--
Mark M. Hoffman
mhoffman at lightlink.com
^ permalink raw reply [flat|nested] 7+ messages in thread* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
2006-05-10 3:51 ` Mark M. Hoffman
@ 2006-05-13 22:17 ` Jean Delvare
2006-05-16 6:06 ` lloyd
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2006-05-13 22:17 UTC (permalink / raw)
To: lm-sensors
Hi 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,
This suggests a bug in libsysfs.
> (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
>
>
> attached 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.
> | Which beta is this?
>
> 10.1 beta 9
Now that 10.1 final is out, I'd suggest that you upgrade to that.
--
Jean Delvare
^ permalink raw reply [flat|nested] 7+ messages in thread* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
2006-05-10 3:51 ` Mark M. Hoffman
2006-05-13 22:17 ` Jean Delvare
@ 2006-05-16 6:06 ` lloyd
2006-05-16 6:31 ` lloyd
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: lloyd @ 2006-05-16 6:06 UTC (permalink / raw)
To: lm-sensors
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.
^ permalink raw reply [flat|nested] 7+ messages in thread* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
` (2 preceding siblings ...)
2006-05-16 6:06 ` lloyd
@ 2006-05-16 6:31 ` lloyd
2006-05-16 21:23 ` Jean Delvare
2006-05-17 3:24 ` Mark M. Hoffman
5 siblings, 0 replies; 7+ messages in thread
From: lloyd @ 2006-05-16 6:31 UTC (permalink / raw)
To: lm-sensors
"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.
^ permalink raw reply [flat|nested] 7+ messages in thread* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
` (3 preceding siblings ...)
2006-05-16 6:31 ` lloyd
@ 2006-05-16 21:23 ` Jean Delvare
2006-05-17 3:24 ` Mark M. Hoffman
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2006-05-16 21:23 UTC (permalink / raw)
To: lm-sensors
Hi lloyd,
> 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?
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.
--
Jean Delvare
^ permalink raw reply [flat|nested] 7+ messages in thread* [lm-sensors] user prog sensors seg faults
2006-05-08 13:48 [lm-sensors] user prog sensors seg faults lloyd
` (4 preceding siblings ...)
2006-05-16 21:23 ` Jean Delvare
@ 2006-05-17 3:24 ` Mark M. Hoffman
5 siblings, 0 replies; 7+ messages in thread
From: Mark M. Hoffman @ 2006-05-17 3:24 UTC (permalink / raw)
To: lm-sensors
Hi lloyd:
* lloyd <millerlf at telus.net> [2006-05-16 00:31:40 -0600]:
> "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
Thanks for helping to debug further...
> (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",
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.
> 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?
> 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.
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,
--
Mark M. Hoffman
mhoffman at lightlink.com
^ permalink raw reply [flat|nested] 7+ messages in thread