Ticket #62 (defect)

Opened 1 year ago

Last modified 3 months ago

Invalid filedescriptor on close() in valgrind

Status: closed (fixed)

Reported by: pvanhoof Assigned to: pvanhoof
Priority: major Milestone: A second release
Component: libtinymail-camel Version: 2.0
Keywords: Cc:

Run tinymail with valgrind and open a message, wait 5 seconds and you'll see this:

Get-Message service dies (15, 15) -> M00006 LOGOUT

==24327== Warning: invalid file descriptor -1 in syscall close()

Attachments

Change History

10/09/07 21:28:48: Modified by anonymous

  • component changed from bindings to libtinymail-camel.

08/27/08 20:32:34: Modified by mbonnin

stream_close is called twice on the same stream.

Get-Message service dies
imap_disconnect_online
let_idle_die starts
let_idle_die finished
(15, 15) -> B00013 LOGOUT

(.., ..) <- * BYE Courier-IMAP server shutting down
imap_disconnect_offline
let_idle_die starts
let_idle_die finished
camel_imap_store_stop_idle 265
camel_imap_folder_stop_idle
(6, 8) -> DONE
(.., ..) <- A00063 OK IDLE completed (IDLE response)
idle_thread 4242
camel_imap_folder_stop_idle 4302
[Thread 0x43202b90 (LWP 7002) exited]

Breakpoint 6, 0x4002b060 in close () from /lib/libpthread.so.0
(gdb) where
#0  0x4002b060 in close () from /lib/libpthread.so.0
#1  0x40edc806 in stream_close (stream=0x93cd750) at camel-tcp-stream-openssl.c:699
#2  0x40f0e470 in camel_stream_close (stream=0x93cd750) at camel-stream.c:154
#3  0x40f0b765 in stream_close (stream=0x93c9f58) at camel-stream-buffer.c:431
#4  0x40f0e470 in camel_stream_close (stream=0x93c9f58) at camel-stream.c:154
#5  0x425ce352 in imap_disconnect_offline (service=0x92dddd8, clean=1, ex=0x0) at camel-imap-store.c:2128
#6  0x425ce55a in imap_disconnect_online (service=0x92dddd8, clean=1, ex=0x0) at camel-imap-store.c:2180
#7  0x40ea61a2 in disco_disconnect (service=0x92dddd8, clean=1, ex=0x0) at camel-disco-store.c:213
#8  0x40ecb024 in camel_service_disconnect (service=0x92dddd8, clean=1, ex=0x0) at camel-service.c:506
#9  0x425c22ed in check_gmsgstore_die (user_data=0x931ea98) at camel-imap-folder.c:4600
#10 0x40899348 in g_timeout_dispatch (source=0x9416860, callback=0x425c2249 <check_gmsgstore_die>, user_data=0x931ea98)
    at gmain.c:3446
#11 0x40895e42 in g_main_dispatch (context=0x92f71f0) at gmain.c:2012
#12 0x40897328 in g_main_context_dispatch (context=0x92f71f0) at gmain.c:2564
#13 0x4089787c in g_main_context_iterate (context=0x92f71f0, block=0, dispatch=1, self=0x92d05d8) at gmain.c:2645
#14 0x40897aae in g_main_context_iteration (context=0x92f71f0, may_block=0) at gmain.c:2708
#15 0x4082df27 in emsg_main_loop (param=0x94cc18c) at src/emsg_main_loop.c:48
#16 0x08462da2 in Timers_Trigger (t=0x8e68880) at Source/timers.c:271
#17 0x08367a21 in mainloop_enter () at Source/mainloop.c:118
#18 0x083678ea in main (argc=1, argv=0xbfffee04) at Source/main.c:42
(gdb) frame 1
#1  0x40edc806 in stream_close (stream=0x93cd750) at camel-tcp-stream-openssl.c:699
699     camel-tcp-stream-openssl.c: No such file or directory.
        in camel-tcp-stream-openssl.c
(gdb) print (((CamelTcpStreamSSL *)stream)->priv->sockfd)
$14 = 22
(gdb) c
Continuing.

Breakpoint 6, 0x4002b060 in close () from /lib/libpthread.so.0
(gdb) where
#0  0x4002b060 in close () from /lib/libpthread.so.0
#1  0x40edc806 in stream_close (stream=0x93cd750) at camel-tcp-stream-openssl.c:699
#2  0x40f0e470 in camel_stream_close (stream=0x93cd750) at camel-stream.c:154
#3  0x425ce382 in imap_disconnect_offline (service=0x92dddd8, clean=1, ex=0x0) at camel-imap-store.c:2134
#4  0x425ce55a in imap_disconnect_online (service=0x92dddd8, clean=1, ex=0x0) at camel-imap-store.c:2180
#5  0x40ea61a2 in disco_disconnect (service=0x92dddd8, clean=1, ex=0x0) at camel-disco-store.c:213
#6  0x40ecb024 in camel_service_disconnect (service=0x92dddd8, clean=1, ex=0x0) at camel-service.c:506
#7  0x425c22ed in check_gmsgstore_die (user_data=0x931ea98) at camel-imap-folder.c:4600
#8  0x40899348 in g_timeout_dispatch (source=0x9416860, callback=0x425c2249 <check_gmsgstore_die>, user_data=0x931ea98)
    at gmain.c:3446
#9  0x40895e42 in g_main_dispatch (context=0x92f71f0) at gmain.c:2012
#10 0x40897328 in g_main_context_dispatch (context=0x92f71f0) at gmain.c:2564
#11 0x4089787c in g_main_context_iterate (context=0x92f71f0, block=0, dispatch=1, self=0x92d05d8) at gmain.c:2645
#12 0x40897aae in g_main_context_iteration (context=0x92f71f0, may_block=0) at gmain.c:2708
#13 0x4082df27 in emsg_main_loop (param=0x94cc18c) at src/emsg_main_loop.c:48
#14 0x08462da2 in Timers_Trigger (t=0x8e68880) at Source/timers.c:271
#15 0x08367a21 in mainloop_enter () at Source/mainloop.c:118
#16 0x083678ea in main (argc=1, argv=0xbfffee04) at Source/main.c:42
(gdb) frame 1
#1  0x40edc806 in stream_close (stream=0x93cd750) at camel-tcp-stream-openssl.c:699
699     in camel-tcp-stream-openssl.c
(gdb) print (((CamelTcpStreamSSL *)stream)->priv->sockfd)
$15 = -1
(gdb) print (((CamelTcpStreamSSL *)stream)->priv->sockfd)
$16 = -1
(gdb) c

08/27/08 21:12:31: Modified by anonymous

  • status changed from new to closed.
  • resolution set to fixed.

Patch on Mailinglist committed in trunk


Add/Change #62 (Invalid filedescriptor on close() in valgrind)




Change Properties
Action