! 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 !
Crashes on exit
Status:
CLOSED: FIXED
Product:
Xfce4-sensors-plugin
Component:
General

Comments

Description Enrico Tröger editbugs 2008-07-10 08:24:28 CEST
Since some weeks/months I always get crashes when I quit Xfce. I tracked down the cause to the sensors plugin which seems to free() an invalid pointer in sensors_free().

Using latest SVN version.
Comment 1 Enrico Tröger editbugs 2008-07-10 08:25:29 CEST
Created attachment 1735 
Crash log of the sensors plugin at exit
Comment 2 Fabian Nowak editbugs 2008-07-15 21:33:55 CEST
OK, I don't see these errors when closing the panel; but I don't have ACPI running. In the ACPI implementation, I wasn't able to find anything specific; though I found one statically assigned variable in all three sensor interfaces that is now given a string duplicate in order to be free()able.

It still works for me, and also introduces some more string freeing, thus statically saving a minor amount of memory.

Please try and report, I am curious :)
Comment 3 Enrico Tröger editbugs 2008-07-15 23:35:12 CEST
No changes at all :(.

I also don't have any ACPI sensors. The plugin is compiled with ACPI support but the configure dialog tells me: 
"Beschreibung: ACPI v<Unbekannt>"
and doesn't list any sensors.

The crashes when plugin gets unloaded are still present.
Comment 4 Enrico Tröger editbugs 2008-09-30 20:13:47 CEST
Created attachment 1850 
Possible fix for the crashes

I spent some more time on this issue since it still exists and is very annoying.

This time I was more successful and this patch fixes these issues (actually it was not only one bug but a whole couple).

The reason for the crashes is that you use often things like:
chip->name = _("blah");
and then later in the code you use:
g_free(chip->name);
this must crash, obviously.

I fixed all relevant occurrences I could find, see attached patch.
Please don't mix static and dynamically allocated strings :).
Comment 5 Fabian Nowak editbugs 2008-09-30 20:25:37 CEST
(In reply to comment #4)
> 
> The reason for the crashes is that you use often things like:
> chip->name = _("blah");
> and then later in the code you use:
> g_free(chip->name);
> this must crash, obviously.

For sure.

> 
> I fixed all relevant occurrences I could find, see attached patch.
> Please don't mix static and dynamically allocated strings :).

Actually, I thought I already had had a look into all statically allocated strings;  thanks a lot for investigating further - at least I did not look into the backend implementations.
Comment 6 Fabian Nowak editbugs 2010-03-30 17:10:30 CEST
*** Bug 4833 has been marked as a duplicate of this bug. ***

Bug #4212

Reported by:
Enrico Tröger
Reported on: 2008-07-10
Last modified on: 2010-03-30
Duplicates (1):

People

Assignee:
Xfce-Goodies Maintainers
CC List:
2 users

Version

Version:
unspecified

Attachments

Crash log of the sensors plugin at exit (8.81 KB, application/octet-stream)
2008-07-10 08:25 CEST , Enrico Tröger
no flags
Possible fix for the crashes (2.42 KB, patch)
2008-09-30 20:13 CEST , Enrico Tröger
no flags

Additional information