! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
SEGV in acpi.c on invoking read_battery_zone()
Status:
RESOLVED: FIXED
Product:
Xfce4-sensors-plugin
Component:
General

Comments

Description Kozlov Evgeniy 2013-03-29 16:25:57 CET
Created attachment 4979 
fix the problem

xfce4-sensors-plugin-1.2.5

Segmentation fault when:

/sys/class/power_supply/BAT0/model_name does not exists, but /sys/class/power_supply/BAT0/alarm exists.
Comment 1 Kozlov Evgeniy 2013-03-30 01:11:54 CET
Created attachment 4980 
panel-infloop-fix

As the reason of such situation when first file not exists, some elements (chipfeature) are initialized not completely and the field named 'valid' is FALSE.

But... it cause an endless-loop on iterating elements in the sensors-plugin.c

So, I have fixed this problem too... patch is attached, but...

What the best way in this case, do you think? Keep an invalid element in the array or remove it (i. e. don't add)?
Comment 2 Fabian Nowak editbugs 2014-04-30 00:10:59 CEST
Comment on attachment 4979 
fix the problem

What does this fix? It is only an invariant of my implementation, and it even takes more lines to write down, while at the same time being less semantically correct.
Comment 3 Fabian Nowak editbugs 2014-04-30 00:16:17 CEST
Comment on attachment 4980 
panel-infloop-fix

This helps. Thanks.
Comment 4 Fabian Nowak editbugs 2014-04-30 00:20:12 CEST
fixed in commit 240bf2e..efb6e7c
Comment 5 Fabian Nowak editbugs 2014-04-30 00:22:02 CEST
Comment on attachment 4979 
fix the problem

Sorry, overlooked the large space between the two parts. You are right. Fixing...
Comment 6 Fabian Nowak editbugs 2014-04-30 00:29:26 CEST
and commit efb6e7c..c6d907d

Bug #9962

Reported by:
Kozlov Evgeniy
Reported on: 2013-03-29
Last modified on: 2014-04-30

People

Assignee:
Fabian Nowak
CC List:
0 users

Version

Version:
unspecified

Attachments

fix the problem (917 bytes, patch)
2013-03-29 16:25 CET , Kozlov Evgeniy
no flags
panel-infloop-fix (883 bytes, patch)
2013-03-30 01:11 CET , Kozlov Evgeniy
no flags

Additional information