Mail Notification, A mail notification for freedesktop.org-compliant system trays - Bugs: bug #19643, openssl assertions about multiple...
You are not allowed to post comments on this tracker with your current authentication level.
bug #19643: openssl assertions about multiple threads in a context are triggered
Submitter: | None | ||
Submitted: | Fri 20 Apr 2007 01:56:38 PM UTC | ||
Severity: | 5 - Blocker | Status: | Fixed |
Privacy: | Public | Assigned to: | None |
Originator Name: | Originator Email: | -email is unavailable- | |
Open/Closed: | Closed |
Jump to the original submission
Tue 26 Jun 2007 12:40:30 PM UTC, comment #13: |
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 06:10:33 PM UTC, comment #12: I have added your patch for now.
|
-Deleted Account- <lexort> |
Fri 20 Apr 2007 06:07:22 PM UTC, comment #11: You're right, deadlock is not the appropriate word. I mean that it would cause mailboxes to block on each other for a very long time. For instance, when the IMAP IDLE extension is used, a perfectly functioning mailbox can wait in SSL_read() for as much as 29 minutes.
|
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 05:50:47 PM UTC, comment #10: I don't see that locking SSL_{read,write} would cause 'deadlocks' (which is a cycle), but it would allow one broken network connection to block another, so I agree that it's undesirable, but perhaps better than not locking.
|
-Deleted Account- <lexort> |
Fri 20 Apr 2007 05:46:55 PM UTC, comment #9: Sorry, from reading the code in mn_ssl_init, it looked like the first call stored the context in a static variable and returned it for subsequent calls. But I see that then session->ssl is initialized from ctx, and that's the "context" passed into the calls.
|
-Deleted Account- <lexort> |
Fri 20 Apr 2007 05:45:35 PM UTC, comment #8: Actually, no need to test the patch. I'd probably also need to lock SSL_read() and SSL_write(), and that is not feasible since it would cause deadlocks between mailboxes.
|
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 05:23:47 PM UTC, comment #7: MN does not use the same SSL connection from multiple threads. Each mailbox check is performed in a separate thread, and the SSL* handle is only used from that thread.
|
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 04:32:44 PM UTC, comment #6: The openssl docs say that a connection may not be used simultaneously by multiple threads:
|
-Deleted Account- <lexort> |
Fri 20 Apr 2007 04:29:26 PM UTC, comment #5: That's correct; there is no THREAD defined. I will inquire about this on NetBSD lists. Does openssl with thread support protect against multiple operations on the same context? |
-Deleted Account- <lexort> |
Fri 20 Apr 2007 04:25:41 PM UTC, comment #4: It appears that your OpenSSL was not compiled with thread support, otherwise you would not get that assertion failure:
|
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 03:46:27 PM UTC, comment #3: Thanks for the quick reply. The patch does not fix the problem, although it seems to make it less frequent. I got a backtrace that shows the problem is not in openssl's calling of non-threadsafe functions without a lock, but mn calling openssl with the same context at the same time. The openssl documentation was unclear about this, but it seems reasonable to avoid doing this. So I think you need an additional lock for the context, or to create a new context for each use.
|
-Deleted Account- <lexort> |
Fri 20 Apr 2007 02:58:27 PM UTC, comment #2: Please test if the attached patch fixes the problem. |
Jean-Yves Lefort <jylefort> |
Fri 20 Apr 2007 01:58:02 PM UTC, comment #1: Sorry, forgot to sign this. Bug is entered by Greg Troxel <gdt@ir.bbn.com>, and I'm the maintainer of the pkgsrc entry for mail-notification. |
Anonymous |
Fri 20 Apr 2007 01:56:38 PM UTC, original submission:
On NetBSD 4.99.17 with a dual-processor machine, monitoring two IMAP/ssl mailboxes, mail-notification 4.0 release crashes on startup with:
|
Anonymous |
Depends on the following items: None found
Items that depend on this one: None found
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-06-26 | jylefort | Status | Confirmed | Fixed | |
Open/Closed | Open | Closed | |||
2007-04-20 | jylefort | Status | Need Info | Confirmed | |
2007-04-20 | jylefort | Attached File | - | Added mn-ssl-global-lock.diff, #12537 | |
2007-04-20 | jylefort | Attached File | - | Added mn-ssl-locking.diff, #12536 | |
Status | None | Need Info | |||
Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-d3ae.
Corresponding source code
Fixed in 4.1 (locking added, and a multi-threaded OpenSSL is now required by the configure script).