Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 618376 - mail-client/claws-mail-3.15.0 segmentation fault in folder_item_get_msg_list()
Summary: mail-client/claws-mail-3.15.0 segmentation fault in folder_item_get_msg_list()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 625826
  Show dependency tree
 
Reported: 2017-05-13 15:33 UTC by Brian Dolbec
Modified: 2017-08-11 20:47 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Dolbec (RETIRED) gentoo-dev 2017-05-13 15:33:43 UTC
brian@professor-x ~ $ claws-mail

(claws-mail:18156): Claws-Mail-CRITICAL **: imap_item_get_path: assertion 'folder_path != NULL' failed
folder.c:3967 Condition path != NULL failed
traceback:
0:	claws-mail(+0x16d8d6) [0x56066d6ce8d6]
1:	claws-mail(+0x170a1f) [0x56066d6d1a1f]
2:	claws-mail(folder_item_get_msg_list+0x78) [0x56066d6d2348]
3:	claws-mail(+0x17a8d8) [0x56066d6db8d8]
4:	claws-mail(+0x17afd7) [0x56066d6dbfd7]
5:	claws-mail(gtk_sctree_insert_gnode+0x10a) [0x56066d88243a]
6:	claws-mail(gtk_sctree_insert_gnode+0x1a9) [0x56066d8824d9]
7:	claws-mail(folderview_set+0x22a) [0x56066d6de27a]
8:	claws-mail(+0x17d4f8) [0x56066d6de4f8]
9:	claws-mail(+0x2c47a0) [0x56066d8257a0]
10:	/usr/lib64/libglib-2.0.so.0(g_hook_list_marshal+0x54) [0x7fef960d3d24]
11:	claws-mail(hooks_invoke+0x59) [0x56066d825e59]
12:	claws-mail(folder_add+0xb8) [0x56066d6cbb28]
13:	claws-mail(folder_read_list+0x68) [0x56066d6cfdd8]
14:	claws-mail(main+0xbb1) [0x56066d686631]
15:	/lib64/libc.so.6(__libc_start_main+0xf1) [0x7fef94ed12b1]
16:	claws-mail(_start+0x2a) [0x56066d68854a]


(claws-mail:18156): Claws-Mail-CRITICAL **: imap_item_get_path: assertion 'folder_path != NULL' failed
folder.c:3991 Condition path != NULL failed
traceback:
0:	claws-mail(+0x16dba6) [0x56066d6ceba6]
1:	claws-mail(+0x170a2f) [0x56066d6d1a2f]
2:	claws-mail(folder_item_get_msg_list+0x78) [0x56066d6d2348]
3:	claws-mail(+0x17a8d8) [0x56066d6db8d8]
4:	claws-mail(+0x17afd7) [0x56066d6dbfd7]
5:	claws-mail(gtk_sctree_insert_gnode+0x10a) [0x56066d88243a]
6:	claws-mail(gtk_sctree_insert_gnode+0x1a9) [0x56066d8824d9]
7:	claws-mail(folderview_set+0x22a) [0x56066d6de27a]
8:	claws-mail(+0x17d4f8) [0x56066d6de4f8]
9:	claws-mail(+0x2c47a0) [0x56066d8257a0]
10:	/usr/lib64/libglib-2.0.so.0(g_hook_list_marshal+0x54) [0x7fef960d3d24]
11:	claws-mail(hooks_invoke+0x59) [0x56066d825e59]
12:	claws-mail(folder_add+0xb8) [0x56066d6cbb28]
13:	claws-mail(folder_read_list+0x68) [0x56066d6cfdd8]
14:	claws-mail(main+0xbb1) [0x56066d686631]
15:	/lib64/libc.so.6(__libc_start_main+0xf1) [0x7fef94ed12b1]
16:	claws-mail(_start+0x2a) [0x56066d68854a]

msgcache.c:586 Condition cache_file != NULL failed
traceback:
0:	claws-mail(msgcache_read_cache+0xef2) [0x56066d72ab72]
1:	claws-mail(+0x170a4b) [0x56066d6d1a4b]
2:	claws-mail(folder_item_get_msg_list+0x78) [0x56066d6d2348]
3:	claws-mail(+0x17a8d8) [0x56066d6db8d8]
4:	claws-mail(+0x17afd7) [0x56066d6dbfd7]
5:	claws-mail(gtk_sctree_insert_gnode+0x10a) [0x56066d88243a]
6:	claws-mail(gtk_sctree_insert_gnode+0x1a9) [0x56066d8824d9]
7:	claws-mail(folderview_set+0x22a) [0x56066d6de27a]
8:	claws-mail(+0x17d4f8) [0x56066d6de4f8]
9:	claws-mail(+0x2c47a0) [0x56066d8257a0]
10:	/usr/lib64/libglib-2.0.so.0(g_hook_list_marshal+0x54) [0x7fef960d3d24]
11:	claws-mail(hooks_invoke+0x59) [0x56066d825e59]
12:	claws-mail(folder_add+0xb8) [0x56066d6cbb28]
13:	claws-mail(folder_read_list+0x68) [0x56066d6cfdd8]
14:	claws-mail(main+0xbb1) [0x56066d686631]
15:	/lib64/libc.so.6(__libc_start_main+0xf1) [0x7fef94ed12b1]
16:	claws-mail(_start+0x2a) [0x56066d68854a]


(claws-mail:18156): Claws-Mail-CRITICAL **: imap_item_get_path: assertion 'folder_path != NULL' failed
Segmentation fault
brian@professor-x ~ $
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2017-05-13 15:34:19 UTC
brian@professor-x ~ $ emerge --info
Portage 2.3.5 (python 2.7.13-final-0, default/linux/amd64/13.0/desktop, gcc-6.3.0, glibc-2.24-r1, 4.8.15-gentoo-vanilla-workstation-2 x86_64)
=================================================================
System uname: Linux-4.8.15-gentoo-vanilla-workstation-2-x86_64-Intel-R-_Xeon-R-_CPU_X5550_@_2.67GHz-with-gentoo-2.3
KiB Mem:    74231820 total,  48225368 free
KiB Swap:   12582908 total,  12582908 free
sh bash 4.4_p12
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1-r1::gentoo
dev-lang/python:          2.7.13::gentoo, 3.4.6::gentoo, 3.5.3::gentoo, 3.6.1-r1::gentoo
dev-util/cmake:           3.8.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r3::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo, 2.27::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0-r3::gentoo, 6.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.24-r1::gentoo
Repositories:

gentoo
    location: /home/brian/Dev/git/gentoo
    sync-type: git
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

buildbot-dev
    location: /home/brian/Dev/git/buildbot-dev
    masters: gentoo

gentoo-guis
    location: /home/brian/Dev/git/gentoo-guis
    masters: gentoo

desktop-effects
    location: /var/lib/layman/desktop-effects
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/desktop-effects.git
    masters: gentoo
    priority: 50

qemu-init
    location: /var/lib/layman/qemu-init
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kvm-tools.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 AdobeFlash-11.x MakeMKV-EULA Oracle-BCLA-JavaS google-chrome Google-TOS Oracle-BCLA-JavaSE NVIDIA-CUDA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -mtune=core2 -mmmx  -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core2 -mtune=core2 -mmmx  -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3"
DISTDIR="/var/db/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going --complete-graph=y --jobs=14 --load-average=16 --verbose-conflicts --verbose-slot-rebuilds --with-bdeps=y"
FCFLAGS="-O2 -pipe -march=core2 -mtune=core2 -mmmx  -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3"
FEATURES="assume-digests binpkg-logs buildpkg clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe -march=core2 -mtune=core2 -mmmx  -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3"
GENTOO_MIRRORS="http://gentoo.gossamerhost.com"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16 -l16"
PKGDIR="/var/db/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
USE="X a52 aac aalib acl acpi adns alsa amd64 avahi berkdb bidi bluetooth bonobo branding bzip2 cairo cdda cddb cdr cleartype cli consolekit cracklib crypt css cups curl cxx dbus dlloader dri dts dv dvd dvdr dvdread emboss encode exif fam fame fbcon ffmpeg flac fortran ftp gconf gdbm gecko gif gimpprint glamor gnutls gpm gs gtk gtk2 gtk3 gtkhtml gtkstyle h323 howl iconv icu imagemagic imap imlib2 innodb introspection ipv6 javascript jikes joystick jpeg lcms ldap libav libcanberra libnotify lm_sensors mad md5sum messages mime mmx mng modules moxnomail mozdevelop mp3 mp4 mpeg mpi mplayer multilib mysql ncurses nfs nls nntp no-old-linux nptl nptonly numeric nvidia ogg opengl openmp pam pango pcre pda pdf pie plugin png policykit posix ppds pulseaudio python qt4 readline rtc samba sdl seccomp session shm sndfile snmp sox speex spell sqlite sqlite3 sse sse2 sse3 ssh ssl startup-notification svg swat syslog tcpd threads threadsonly thumbnail thunar-vfs tiff tk transcode truetype udev udisks unicode upower usb utf8 v4l v4l2 vcd vdpau vorbis webkit x264 xattr xcb xml xosd xpm xulrunner xv xvid zlib zvbi" ABI_X86="64 32" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="nouveau" XFCE_PLUGINS="brightness clock trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

brian@professor-x ~ $
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2017-05-13 16:36:25 UTC
Downgrading to 3.14.1-r1, claws-mail works.

Oh, 3.15.0 segfaulted with gcc-5.4 as well as after switching to 6.3.0 and a -e world rebuild.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-07-21 07:54:34 UTC
Does 3.15.0 also segfault in a fresh profile? 
I cannot reproduce this issue and looking at the segfault's output

  'folder_path != NULL' failed

seems like a broken path on your system.
Comment 4 Arkadiusz Bokowy 2017-08-01 10:26:32 UTC
After removing filderlist.xml (backup file as well) file, claws-mail starts. However, old configuration is lost - DO NOT proceed without backup!

rm ~/.claws-mail/folderlist.*
Comment 5 Steve Evans 2017-08-01 12:23:17 UTC
I just had this same problem because 3.15.0 has just gone stable on amd64.

I have done some investigation and the cause appears to be a configuration file change in 3.14 that is upgraded when 3.14 is first started. But 3.14 has never been stabilised in gentoo, so I have just jumped from 3.13.2 to 3.15.0, so the config update is /not/ performed.

If I add 3.14.1-r1 to packages.keywords so it is stable, build it and run it then the config is updated and 3.15.0 then works.

The configuration is the protocol line in the file accountrc, which before the update is set to 3, meaning imap, like this:

protocol=3

which comes from this code:

typedef enum {
	A_POP3,
	A_APOP,	/* deprecated */
	A_RPOP,	/* deprecated */
	A_IMAP4,
	A_NNTP,
	A_LOCAL,
	A_NONE,	/* SMTP only */
	NUM_RECV_PROTOCOLS
} RecvProtocol;

in claws-mail-3.13.2/src/prefs_account.h,

so the number 3 corresponds to the enum A_IMPAP4.

However the same code in 3.15.1 is:

typedef enum {
	A_POP3,
	A_IMAP4,
	A_NNTP,
	A_LOCAL,
	A_NONE,	/* SMTP only */
	NUM_RECV_PROTOCOLS
} RecvProtocol;

The two deprecated entries have been removed, so A_IMAP4 is now 1 and the config line should be:

protocol=1

3.14 has code to update this setting in prefs_migration.c:

			/* Removing A_APOP and A_RPOP from RecvProtocol enum,
			 * protocol numbers above A_POP3 need to be adjusted.
			 *
			 * In config_version=0:
			 * A_POP3 is 0,
			 * A_APOP is 1,
			 * A_RPOP is 2,
			 * A_IMAP and the rest are from 3 up.
			 * We can't use the macros, since they may change in the
			 * future. Numbers do not change. :) */
			for (cur = account_get_list(); cur != NULL; cur = cur->next) {
				ac_prefs = (PrefsAccount *)cur->data;
				if (ac_prefs->protocol == 1) {
					ac_prefs->protocol = 0;
				} else if (ac_prefs->protocol > 2) {
					/* A_IMAP and above gets bumped down by 2. */
					ac_prefs->protocol -= 2;
				}
			}

This code exists in 3.15, but is not triggered.
Comment 6 tomtom69 2017-08-03 18:44:08 UTC
Same problem here
I can confirm that Steves changes of the config file work at least for one machine here after update from 3.13 to 3.15
(@Steve: Thank you for the investigation!)
Comment 7 Fab 2017-08-04 16:02:11 UTC
(In reply to Steve Evans from comment #5)
> This code exists in 3.15, but is not triggered.

The code seems triggered here, see below.

(In reply to tomtom69 from comment #6)
> I can confirm that Steves changes of the config file work at least for one
> machine here after update from 3.13 to 3.15

This does not work for me.

If I do :
> %s/protocol=3/protocol=1/gc
and run claws-mail, it does not crash, but all my IMAP accounts are configured as POP. And after that, in the accountrc file, all «protocol» lines are set to 0.

Seriously, how can a such bugged package can be stabilized « 3 MONTHS » after the bug was reported ?
Comment 8 Fab 2017-08-04 16:14:20 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #3)
> Does 3.15.0 also segfault in a fresh profile? 
> I cannot reproduce this issue and looking at the segfault's output
> 
>   'folder_path != NULL' failed
> 
> seems like a broken path on your system.

Can you please define « broken path » ?
Do you suggest that I have to reconfigure about ~15 mailbox in claws-mail just for this stupid bug ?
Comment 9 Fab 2017-08-04 16:45:21 UTC
Reported upstream two days ago :

http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3855

> Like with my personnal profile, if I edit accountrc (protocol=3 => 1)
> and clawsrc (add config_version=2) the crash disappears.


> I propose:
> - a quick, short-term solution, reverting the mentioned commit and
> bringing back the original imap_folder_get_path() function,
> - a long-term solution, separating accounts config_version update (with
> per-account config_version, or a global one on top of accountrc file), and
> running it just after loading the accounts from accountrc, before
> loading folders
Comment 10 Fab 2017-08-04 16:56:22 UTC
> > Like with my personnal profile, if I edit accountrc (protocol=3 => 1)
> > and clawsrc (add config_version=2) the crash disappears.

This work.

Question is : why this bug wasn't reported 3 months ago to upstream ?
Comment 11 Henning Schild 2017-08-05 08:56:09 UTC
Second question is how could that become amd64 stable, please revert that KEYWORD until upstream comes with 3.15.1 because they seem to see it critical and 3.15 as broken.
Comment 12 Henning Schild 2017-08-05 09:05:04 UTC
https://github.com/gentoo/gentoo/pull/5301

Upstream is talking about reverting the commit to solve it quickly, and the criticality level of the bug seems pretty high. Lets wait until they come up with a solution
Comment 13 Tobias Klausmann (RETIRED) gentoo-dev 2017-08-05 16:13:18 UTC
Removed amd64 stable keyword.
Comment 14 Michele Testa 2017-08-06 19:40:21 UTC
For anyone who wants to use claws-mail-3.15.0 on amd64 (even compiled with gcc 6.4) with imap accounts, just use the workaround suggested in upstream:

http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3855

1. enter in your configuration dir (usually .claws-mail)
2. backup your 'accountrc' and 'clawsrc' elsewhere
3. edit 'accountrc' and change protocol=3 => protocol=1
   (sed -i -e 's/^\(protocol=\)3/\11/g' accountrc)
4. edit 'clawsrc' and add 'config_version=2' just below [Common] at the start of the file

The crash disappears, and all accounts continue to be smoothly IMAP4.

Changing the semantic value of a literal (3=IMAP4 becomes 3=LOCALDIR) by modifying enums seems to be a bad habit of claws-mail dev team:

http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3733
Comment 15 Henning Schild 2017-08-07 07:25:53 UTC
That advise only covers the IMAP accounts, you actually have to substract 2 from all protocols >=3 i.e. SMTP-only accounts.(In reply to Michele Testa from comment #14)
> For anyone who wants to use claws-mail-3.15.0 on amd64 (even compiled with
> gcc 6.4) with imap accounts, just use the workaround suggested in upstream:
> 
> http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3855
> 
> 1. enter in your configuration dir (usually .claws-mail)
> 2. backup your 'accountrc' and 'clawsrc' elsewhere
> 3. edit 'accountrc' and change protocol=3 => protocol=1
>    (sed -i -e 's/^\(protocol=\)3/\11/g' accountrc)
> 4. edit 'clawsrc' and add 'config_version=2' just below [Common] at the
> start of the file
> 
> The crash disappears, and all accounts continue to be smoothly IMAP4.
> 
> Changing the semantic value of a literal (3=IMAP4 becomes 3=LOCALDIR) by
> modifying enums seems to be a bad habit of claws-mail dev team:
> 
> http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=3733

That advise only covers part of the whole problem, you actually have to substract 2 from all protocols >=3, i.e. SMTP-only accounts.
Comment 17 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-08-11 20:47:30 UTC
commit dbd1e3e95fcff251b6232544a313873a24a3de9b (HEAD -> master, origin/master, origin/HEAD)
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Fri Aug 11 21:57:22 2017

    mail-client/claws-mail: Revbump to fix segfault (bug #618376).

    Package-Manager: Portage-2.3.6, Repoman-2.3.3