Bug 3678 - Segfault when trying to add new account
Summary: Segfault when trying to add new account
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.14.1
Hardware: PC Linux
: P3 major
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2016-08-23 20:09 UTC by flo.xfce
Modified: 2016-08-24 12:04 UTC (History)
0 users

See Also:


Attachments
gdb backtrace (2.28 KB, text/plain)
2016-08-23 20:09 UTC, flo.xfce
no flags Details
gtk2 configure line (461 bytes, text/plain)
2016-08-23 20:11 UTC, flo.xfce
no flags Details
patch to avoid the observed criticals (1.74 KB, patch)
2016-08-24 11:16 UTC, flo.xfce
no flags Details | Diff

Description flo.xfce 2016-08-23 20:09:46 UTC
Created attachment 1676 [details]
gdb backtrace

Trying to open the submenus under Configuration "Edit Account Settings", "Create New Account", "Edit Preferences For Current Acount" results in a segmentation fault. Inital account configuration when running claws for the first time works.
Attaches a gdb backtrace.
This segfault seems to be a result of the gtk library I am using. I am on Arch Linux. The original gtk2 from the official repositories works, but with my self-compiled version I I have the described segfault.
For the configure line please see the next comment because I can't figure out how to add multiple attachments.
Comment 1 flo.xfce 2016-08-23 20:11:27 UTC
Created attachment 1677 [details]
gtk2 configure line
Comment 2 Paul 2016-08-24 04:49:00 UTC
The backtrace is not useful because you're using stripped binaries. And, (you pretty much said it yourself), it looks like GTK is the problem. If you have more information, then re-open this. In the meantime I'm closing it as INVALID.
Comment 3 flo.xfce 2016-08-24 10:56:27 UTC
I am reopening this.
Gtk is NOT the problem, claws is. I tried again with debug build of glib,gtk2 and claws and now I am getting criticals, but no segfault, and I can use the account preferences. I guess my inital assumption that is has something to do with the way I configured gtk is wrong, instead the stock gtk package checks some assertions instead of segaulting directly.
Again - this is a claws bug: You are dereferencing null pointers. You are lucky that gtk will, in most cases, throw a critical but keep running. But you cannot assume that this will always be the case.
I found two occurences in the claws code where null pointers are derefed, I will attach a patch soon.
Comment 4 flo.xfce 2016-08-24 11:16:47 UTC
Created attachment 1679 [details]
patch to avoid the observed criticals

Here is a patch which avoids dereferencing null pointers where I could observe them.
Comment 5 users 2016-08-24 12:00:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2016-08-24 14:00:02.872365080 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=8e82531719f7d1beb793cce4b73a201c33befe3b
Merge: 3a162b3 6298f43
Author: Colin Leroy <colin@colino.net>
Date:   Wed Aug 24 14:00:02 2016 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=6298f434d40a5becd305eb3dba447b4888ef8327
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed Aug 24 13:52:23 2016 +0200

    Handle password loading more safely in prefs_account.c
    
    Inspired by patch in bug #3678.

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=61b7a029bb2089eeb80e3bafbf944266c6a6c046
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed Aug 24 13:39:33 2016 +0200

    Do a basic check for widget validity in CLAWS_SET_TIP().
    
    Inspired by patch in bug #3678.
Comment 6 users 2016-08-24 12:00:03 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2016-08-24 14:00:02.872365080 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=8e82531719f7d1beb793cce4b73a201c33befe3b
Merge: 3a162b3 6298f43
Author: Colin Leroy <colin@colino.net>
Date:   Wed Aug 24 14:00:02 2016 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=6298f434d40a5becd305eb3dba447b4888ef8327
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed Aug 24 13:52:23 2016 +0200

    Handle password loading more safely in prefs_account.c
    
    Inspired by patch in bug #3678.

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=61b7a029bb2089eeb80e3bafbf944266c6a6c046
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed Aug 24 13:39:33 2016 +0200

    Do a basic check for widget validity in CLAWS_SET_TIP().
    
    Inspired by patch in bug #3678.
Comment 7 Andrej Kacian 2016-08-24 12:04:35 UTC
Thanks for tracking these down. I have fixed both issues in git now, albeit a bit differently than what your patch does.

Note You need to log in before you can comment on or make changes to this bug.