Bug 2096

Summary: MEMORY-ERROR w/ Claws-Mail/IMAP and Lotus Domino
Product: Claws Mail (GTK 2) Reporter: Sven Mueller <thelightmaker>
Component: UIAssignee: users
Status: RESOLVED FIXED    
Severity: normal CC: hoa
Priority: P3    
Version: 3.7.4   
Hardware: PC   
OS: Linux   

Description Sven Mueller 2010-01-14 16:20:36 UTC
I use an Ubuntu 9.10 and a Claws-Mail Version "3.7.3-1karmicubuntu3" from PPA. My IMAP-Server is a Lotus Domino-Server (Vers. 8.5.1). When I'm sometimes lauch Claws-Mail, then eat it all RAM and crash with the error message "Cannot allocate memory".

The following plugins are active:
- bogofilter
- pgpmime
- pgpcore
- notification-plugin

Here is my bug-report:

--- snip ---
imap-thread.c:3113:imap copy run - end 0
imap-thread.c:403:generic_cb
imap-thread.c:3141:imap copy - end
imap.c:527:unlocking session 0x8647578

***MEMORY-ERROR***: claws-mail[8631]: GSlice: failed to allocate 120 bytes (alignment: 128): Cannot allocate memory


Program received signal SIGABRT, Aborted.
0xb7fe2422 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 2 (Thread 0xb669fb70 (LWP 8640)):
#0  0xb7fe2422 in __kernel_vsyscall ()
#1  0xb7940e15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb7737fdd in mailsem_internal_wait () from /usr/lib/libetpan.so.13
#3  0xb773803f in mailsem_down () from /usr/lib/libetpan.so.13
#4  0x08252543 in thread_run (data=0x84365f0) at etpan-thread-manager.c:324
#5  0xb793c80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb75f08de in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb6cfd980 (LWP 8631)):
#0  0xb7fe2422 in __kernel_vsyscall ()
#1  0xb754e4d1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7551932 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7896ecf in ?? () from /lib/libglib-2.0.so.0
#4  0xb7897745 in ?? () from /lib/libglib-2.0.so.0
#5  0xb78985ad in g_slice_alloc () from /lib/libglib-2.0.so.0
#6  0xb78997b2 in g_slist_prepend () from /lib/libglib-2.0.so.0
#7  0x0811904f in flatten_mailimap_set (set=<value optimized out>) at imap.c:1715
#8  0x0811d93b in imap_do_copy_msgs (folder=0x8609fa0, dest=0x860d8b0, msglist=0x8650dc0, relation=0x8435260) at imap.c:1823
#9  imap_copy_msgs (folder=0x8609fa0, dest=0x860d8b0, msglist=0x8650dc0, relation=0x8435260) at imap.c:1942
#10 0x080fec6a in do_copy_msgs (dest=0x860d8b0, msglist=0x8650dc0, remove_source=<value optimized out>) at folder.c:3345
#11 0x080ff924 in folder_item_move_msgs (dest=0x860d8b0, msglist=0x8650dc0) at folder.c:3545
#12 0x080f7ce5 in filtering_move_and_copy_msgs (msgs=0x86534e0) at filtering.c:245
#13 0x080fd9d4 in folder_item_scan_full (item=0x860e030, filtering=1) at folder.c:2257
#14 0x080fe539 in folder_item_scan (item=0x860e030) at folder.c:2380
#15 0x0810aab6 in folderview_check_new (folder=0x8609fa0) at folderview.c:1204
#16 0x0812c1b4 in inc_all_account_mail (mainwin=0x841b768, autocheck=1, notify=0) at inc.c:363
#17 0x0813e0b3 in defer_check_all (data=0x1) at main.c:356
#18 0xb787a53c in ?? () from /lib/libglib-2.0.so.0
#19 0xb7879e88 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#20 0xb787d730 in ?? () from /lib/libglib-2.0.so.0
#21 0xb787db9f in g_main_loop_run () from /lib/libglib-2.0.so.0
#22 0xb7d01419 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#23 0x08141407 in main (argc=1, argv=0xbffff9a4) at main.c:1666
(gdb) quit
A debugging session is active.

	Inferior 1 [process 8631] will be killed.

Quit anyway? (y or n) y
gdb claws-mail  27,13s user 6,91s system 12% cpu 4:29,98 total

Thx @ all
Comment 1 Colin Leroy 2010-01-14 16:55:15 UTC
Should be fixed in 3.7.4. I just have to build packages for it...
Comment 2 Sven Mueller 2010-01-15 11:26:45 UTC
Thx a lot.
Have installed the new package and will see in the next time.
Comment 3 Sven Mueller 2010-01-15 17:06:28 UTC
No, I have the same problem as before in the new version (3.7.4). Do you need another bug report from the new version??

Thx for help.
Comment 4 Colin Leroy 2010-01-15 18:31:10 UTC
Another backtrace would help, yes. Please install the claws-mail-dbg package, too, the backtrace will be more helpful !
Thanks
Comment 5 Sven Mueller 2010-01-18 09:17:57 UTC
Here is the new bug report from version 3.7.4 (3.7.4-1ubuntu1~ppakarmic0ubuntu1). Options and Plugins are same as above:

--- snip ---
procmsg.c:1941:Unsetting flags for message 304863 in folder INBOX
bogofilter.c:549:unflagging ham: 304863
procmsg.c:1941:Unsetting flags for message 304861 in folder INBOX
bogofilter.c:549:unflagging ham: 304861
procmsg.c:1941:Unsetting flags for message 304859 in folder INBOX
bogofilter.c:549:unflagging ham: 304859
procmsg.c:2261:mail_listfiltering_hooklist left unfiltered stuff. total 8 filtered 0 unfilt 8.
imap.c:5023:IMAP switching away from batch mode
filtering.c:189:checking 8 messages
filtering.c:229:8 messages to move in alarmierend
folder.c:3546:called inc_lock (lock count 2)
imap.c:1745:getting session...
imap.c:513:locking session 0x8656498 (0)
imap.c:526:unlocking session 0x8656498
imap.c:3222:using separator: \
imap.c:1807:Copying messages from INBOX to Inbox-Cleaning\Nagios - The network admin\alarmierend ...
imap.c:513:locking session 0x8656498 (0)
imap-thread.c:3124:imap copy - begin
imap-thread.c:387:found imap 0x864fb50
imap-thread.c:387:found imap 0x864fb50
[09:08:29] IMAP4> 15 UID COPY 304859,304861:304863,304865:304866,304868,304879 "Inbox-Cleaning\\Nagios - The network admin\\alarmierend" 
[09:08:32] IMAP4< 15 OK [COPYUID 15 304859304862:304863304866304879 105395:105402] COPY completed 
imap-thread.c:3113:imap copy run - end 0
imap-thread.c:403:generic_cb
imap-thread.c:3141:imap copy - end
imap.c:526:unlocking session 0x8656498

***MEMORY-ERROR***: claws-mail[4678]: GSlice: failed to allocate 120 bytes (alignment: 128): Cannot allocate memory


Program received signal SIGABRT, Aborted.
0xb7fe2422 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 2 (Thread 0xb6386b70 (LWP 4687)):
#0  0xb7fe2422 in __kernel_vsyscall ()
#1  0xb793fe15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb7736fdd in mailsem_internal_wait () from /usr/lib/libetpan.so.13
#3  0xb773703f in mailsem_down () from /usr/lib/libetpan.so.13
#4  0x08254273 in thread_run (data=0x86586e0) at etpan-thread-manager.c:324
#5  0xb793b80e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb75ef8de in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb6cfc980 (LWP 4678)):
#0  0xb7fe2422 in __kernel_vsyscall ()
#1  0xb754d4d1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7550932 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7895ecf in ?? () from /lib/libglib-2.0.so.0
#4  0xb7896745 in ?? () from /lib/libglib-2.0.so.0
#5  0xb78975ad in g_slice_alloc () from /lib/libglib-2.0.so.0
#6  0xb78987b2 in g_slist_prepend () from /lib/libglib-2.0.so.0
#7  0x08119f6f in flatten_mailimap_set (set=<value optimized out>) at imap.c:1714
#8  0x0811e840 in imap_do_copy_msgs (folder=0x85fc260, dest=0x860e840, msglist=0x8661430, relation=0x87dc0c0) at imap.c:1821
#9  imap_copy_msgs (folder=0x85fc260, dest=0x860e840, msglist=0x8661430, relation=0x87dc0c0) at imap.c:1938
#10 0x080ffb8a in do_copy_msgs (dest=0x860e840, msglist=0x8661430, remove_source=<value optimized out>) at folder.c:3347
#11 0x08100844 in folder_item_move_msgs (dest=0x860e840, msglist=0x8661430) at folder.c:3547
#12 0x080f8c05 in filtering_move_and_copy_msgs (msgs=0x8663610) at filtering.c:245
#13 0x080fe8f4 in folder_item_scan_full (item=0x8611738, filtering=1) at folder.c:2257
#14 0x080ff459 in folder_item_scan (item=0x8611738) at folder.c:2380
#15 0x0810b9d6 in folderview_check_new (folder=0x85fc260) at folderview.c:1204
#16 0x0812d024 in inc_all_account_mail (mainwin=0x841d780, autocheck=1, notify=0) at inc.c:363
#17 0x0813ef03 in defer_check_all (data=0x1) at main.c:356
#18 0xb787953c in ?? () from /lib/libglib-2.0.so.0
#19 0xb7878e88 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#20 0xb787c730 in ?? () from /lib/libglib-2.0.so.0
#21 0xb787cb9f in g_main_loop_run () from /lib/libglib-2.0.so.0
#22 0xb7d00419 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#23 0x08142257 in main (argc=1, argv=0xbffff994) at main.c:1666
(gdb) quit
A debugging session is active.

	Inferior 1 [process 4678] will be killed.

Quit anyway? (y or n) y
gdb claws-mail  27,61s user 6,67s system 10% cpu 5:21,42 total

Thx.
Comment 6 Sven Mueller 2010-01-18 09:35:02 UTC
Can this debug-output help you??

---- snip ----
main.c:2506:/dev/mem_notify not available (No such file or directory)

---- snip ----
Comment 7 Michael Rasmussen 2010-01-18 09:54:07 UTC
On my Ubuntu 9.10 at work:
$ /dev/mem_notify
bash: /dev/mem_notify: No such file or directory

Here claws-mail 3.7.4 works so I don't think this is the problem.
Comment 8 Michael Rasmussen 2010-01-18 09:55:39 UTC
Is your Ubuntu completely up to date? That is, have you installed all updates including kernel?
Comment 9 Sven Mueller 2010-01-18 10:09:31 UTC
Yes, my Ubuntu is up2date.

If I have opened the IMAP-Folder with original Lotus Notes Client, then works
Claws-Mail for a while. After a few minutes / hours, my desktop has stagnated
because not enough RAM. In the morning, when I start Claws Mail for the first
time, I usually have the same problem.
Comment 10 Colin Leroy 2010-01-18 10:56:49 UTC
/dev/mem_notify has nothing to do with this bug. The bug isn't clear, however...
Comment 11 Colin Leroy 2010-01-18 11:03:05 UTC
It seems to be a problem with Lotus' COPYUID extension :
[09:08:29] IMAP4> 15 UID COPY 304859,304861:304863,304865:304866,304868,304879
"Inbox-Cleaning\\Nagios - The network admin\\alarmierend" 
[09:08:32] IMAP4< 15 OK [COPYUID 15 304859304862:304863304866304879
105395:105402] COPY completed 

The source numbers in the COPYUID response are completely wrong (and overflow). Hoa : any idea about how to avoid that ?
Comment 12 users 2012-09-13 09:48:34 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-09-13 [colin]	3.8.1cvs55

	* src/imap.c
		Maybe fix bug #2096, "MEMORY-ERROR w/ 
		Claws-Mail/IMAP and Lotus Domino". Use
		correct types for start/end and test if
		start is indeed before end.
Comment 13 Colin Leroy 2012-09-13 10:09:54 UTC
Hi,

I'm marking that bug as fixed because I'm confident that the extra checks will fix the crash. Please reopen if not.