! 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 !
xfce4-stopwatch-plugin segfaults during startup due to non-existant rc-file
Status:
RESOLVED: WONTFIX
Severity:
critical
Product:
Xfce4-stopwatch-plugin
Component:
General

Comments

Description Franz Brauße 2010-10-01 07:27:53 CEST
The crash of the plugin also kills the xfce4-panel process
it's been loaded into. It occurs due to not checking the return value of
xfce_panel_plugin_lookup_rc_file() for NULL in the function
stopwatch_plugin_load() which is called during startup of the plugin.
This error occurs if no configuration file for the panel-plugin instance is present and xfce_panel_plugin_lookup_rc_file() therefore does return NULL.

The affected and tested version of the plugin is the stable 0.2.0.

This bug has also been reported in the Gentoo bugtracker (they don't apply any patches to this package) at
https://bugs.gentoo.org/show_bug.cgi?id=339302

The below patch eliminates the problem (and makes a small part of the source more readable):

diff -urw a/panel-plugin/stopwatch.c b/panel-plugin/stopwatch.c
--- a/panel-plugin/stopwatch.c  2009-07-28 00:47:25.000000000 +0200
+++ b/panel-plugin/stopwatch.c  2010-10-01 05:23:34.611694903 +0200
@@ -582,7 +582,11 @@
        g_return_if_fail (panel_plugin != NULL);
        _tmp0_ = NULL;
        _tmp1_ = NULL;
-       rc = (_tmp1_ = xfce_rc_simple_open (_tmp0_ =
xfce_panel_plugin_lookup_rc_file (panel_plugin), TRUE), _tmp0_ = (g_free
(_tmp0_), NULL), _tmp1_);
+       _tmp0_ = xfce_panel_plugin_lookup_rc_file (panel_plugin);
+       if (!_tmp0_)
+               return;
+       rc = xfce_rc_simple_open (_tmp0_, TRUE);
+       g_free (_tmp0_);
        elapsed = (my_time_val_init_zero (&_tmp2_), _tmp2_);
        sscanf (xfce_rc_read_entry (rc, "elapsed_sec", "0"), "%ld",
&elapsed.tv_sec);
        sscanf (xfce_rc_read_entry (rc, "elapsed_usec", "0"), "%ld",
&elapsed.tv_usec);
Comment 1 Samuli Suominen 2010-10-01 11:05:39 CEST
Created attachment 3122 
The same patch as in Comment #0, but as attachment.

Attaching it for convinience here, it's pain to copy and paste from bugzilla.

It would be nice to get some upstream eyes on this, before I go and apply it in our package at Portage. Thanks!
Comment 2 Diego Ongaro 2010-10-01 11:11:43 CEST
Hey, thanks for the bug report.

Unfortunately, you've patched an autogenerated file: stopwatch.c is generated by valac from stopwatch.vala. This also explains why the c code is so ugly, by the way.

You should probably patch stopwatch.vala instead and regenerate stopwatch.c from that.

-Diego
Comment 3 Franz Brauße 2010-10-01 15:31:10 CEST
Created attachment 3123 
patching .vala instead of .c

Thank you, that explains it. I've never heard of Vala before and didn't bother to look into the respective file. However I am not able to install xfce4-vala through portage due to a restriction placed by Gentoo because the packet seems outdated. So I cannot verify whether my patching the file works.
I'd appreciate it, if you gave it a try.
Comment 4 Diego Ongaro 2010-10-01 19:57:25 CEST
(In reply to comment #3)
> Created attachment 3123 
> patching .vala instead of .c
> 
> Thank you, that explains it. I've never heard of Vala before and didn't bother
> to look into the respective file. However I am not able to install xfce4-vala
> through portage due to a restriction placed by Gentoo because the packet seems
> outdated. So I cannot verify whether my patching the file works.
> I'd appreciate it, if you gave it a try.

Sure, the attachment looks reasonable, and I'll give it a try when I get a minute. Thanks again.
Comment 5 Skunnyk editbugs 2018-09-16 19:35:35 CEST
This project has been archived, so we are closing related bugs

Bug #6717

Reported by:
Franz Brauße
Reported on: 2010-10-01
Last modified on: 2018-09-16

People

Assignee:
Diego Ongaro
CC List:
1 user

Version

Version:
unspecified

Attachments

The same patch as in Comment #0, but as attachment. (924 bytes, patch)
2010-10-01 11:05 CEST , Samuli Suominen
no flags
patching .vala instead of .c (658 bytes, patch)
2010-10-01 15:31 CEST , Franz Brauße
no flags

Additional information