! 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 !
Mousepad segfaults with an empty mousepadrc.
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description Stavros Giannouris 2007-01-21 21:36:20 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; el-GR; rv:1.8.1.1) Gecko/20061221 Firefox/2.0.0.1
Build Identifier: 

Mousepad segfaults consistently when starting with an empty (zero bytes) configuration file.

Reproducible: Always

Steps to Reproduce:
1. Backup and remove ~/.config/mousepad/mousepadrc
2. touch ~/.config/mousepad/mousepadrc
3. start mousepad

Actual Results:  
Mousepad exits with a segfault before displaying a window.

Expected Results:  
It should start.

Tested on Fedora 6 / GTK+ 2.10.4.
Comment 1 Alexander Toresson 2007-01-21 21:40:03 CET
Reproduced on Debian Etch, gtk 2.8.20, glib 2.12.4 and svn revision 24535.
Comment 2 Alexander Toresson 2007-01-21 21:59:32 CET
Created attachment 950 
patch to fix crashes due to invalid mousepadrc
Comment 3 Alexander Toresson 2007-01-21 22:08:04 CET
The patch in comment #2 at least seems to fix it. It simply invalidates the mousepadrc if an eof is found. It also doesn't seem to crash on invalid data, but it might load some invalid settings depending on the contents of the mousepadrc.
Comment 4 Alexander Toresson 2007-01-21 22:12:22 CET
Created attachment 951 
another version of the patch with some extra error checking
Comment 5 Stavros Giannouris 2007-01-21 22:22:22 CET
The patch fixes it here, too.
Comment 6 Erik Harrison 2007-01-22 03:44:51 CET
We really need to fix the problem that we assume that if the file exists, it's data is valid. Fix forthcoming
Comment 7 Erik Harrison 2007-01-22 04:01:15 CET
Alex, I've applied you patch for now, so this is fixed in trunk.

I'm leaving this bug open to remind me to backport the fix for 4.4.1
Comment 8 Alexander Toresson 2007-01-22 08:15:00 CET
Thank you :)
I was thinking of converting the mousepadrc to XfceRc, but then realized that that would probably create backwards compatibility problems with the old format. So I just added some error detection.
And it'll get an overhaul anyway as mousepad is rewritten, right?
Comment 9 Cody A.W. Somerville 2007-11-23 23:17:41 CET
Will this be released in 4.4.2 since it doesn't appear it made 4.4.1?
Comment 10 Erik Harrison 2007-11-24 02:48:04 CET
I'm not sure off hand if this patch made it back to the 4.4 branch. This bug fell off the radar when Nick's branch hit.

I'll double check if it's in 4.4.2 and if not, put it in for 4.4.3
Comment 11 Yves-Alexis Perez editbugs 2008-03-31 15:14:11 CEST
The patch didn't make it to 4.4.2. Is there a way to backport it?

Cheers,
Comment 12 Nick Schermer editbugs 2008-08-27 13:30:18 CEST
MM i though backport this to trunk... Backing it a blocking 4.6 bug so I won't forget...
Comment 13 Nick Schermer editbugs 2008-09-13 09:18:18 CEST
Committed to the xfce_4_4 branch too in rev. revision 27853.

Bug #2784

Reported by:
Stavros Giannouris
Reported on: 2007-01-21
Last modified on: 2008-09-13

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Version:
0.2.10
Target Milestone:
Mousepad 0.2.x

Attachments

patch to fix crashes due to invalid mousepadrc (1.17 KB, text/x-patch)
2007-01-21 21:59 CET , Alexander Toresson
no flags
another version of the patch with some extra error checking (1.65 KB, text/x-patch)
2007-01-21 22:12 CET , Alexander Toresson
no flags

Additional information