Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl is configured to be thread safe if libetpan is compiled to be reentrant #36

Merged
merged 1 commit into from
Jul 13, 2012

Conversation

mronge
Copy link
Contributor

@mronge mronge commented Jul 11, 2012

No description provided.

dinhvh added a commit that referenced this pull request Jul 13, 2012
openssl is configured to be thread safe if libetpan is compiled to be reentrant
@dinhvh dinhvh merged commit 4c9a020 into dinhvh:master Jul 13, 2012
@junjie
Copy link

junjie commented May 16, 2013

I'm using libetpan through MailCore, and have been having an issue where when multiple accounts disconnect at once, I sometimes get the entire thread (one thread per account) locked up.

Here's the stack trace of one such locked thread:

#0 0x397950fc in __psynch_mutexwait ()
#1 0x396dde6a in pthread_mutex_lock ()
#2 0x0052eb4c in locking_function at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream_ssl.c:163
#3 0x00532db2 in CRYPTO_lock at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/cryptlib.c:600
#4 0x0059ccd6 in int_thread_get at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/err/err.c:446
#5 0x0059ce34 in int_thread_get_item at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/err/err.c:491
#6 0x0059bf7c in ERR_get_state at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/err/err.c:1014
#7 0x0059c18a in get_error_values at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/err/err.c:798
#8 0x0059c420 in ERR_peek_error at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/crypto/err/err.c:770
#9 0x00601cea in SSL_get_error at /UAS8000/MailCore/iOSPorts/ports/security/openssl/openssl/ssl/ssl_lib.c:2289
#10 0x0052ec5c in mailstream_low_ssl_read at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream_ssl.c:765
#11 0x0052cf18 in mailstream_low_read at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream_low.c:209
#12 0x0052c454 in mailstream_feed_read_buffer at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream.c:309
#13 0x0052c778 in mailstream_read_line_append at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream_helper.c:101
#14 0x0052c6e4 in mailstream_read_line at /UAS8000/MailCore/libetpan/build-mac/../src/data-types/mailstream_helper.c:62
#15 0x005006e4 in mailimap_read_line at /UAS8000/MailCore/libetpan/build-mac/../src/low-level/imap/mailimap.c:2396
#16 0x00500dd6 in mailimap_logout at /UAS8000/MailCore/libetpan/build-mac/../src/low-level/imap/mailimap.c:747
#17 0x004f3646 in imapdriver_logout at /UAS8000/MailCore/libetpan/build-mac/../src/driver/implementation/imap/imapdriver.c:326
#18 0x004ff422 in mailsession_logout at /UAS8000/MailCore/libetpan/build-mac/../src/driver/interface/maildriver.c:134
#19 0x0052b7d0 in mailstorage_disconnect at /UAS8000/MailCore/libetpan/build-mac/../src/driver/interface/mailstorage.c:334
#20 0x004e37dc in -[CTCoreAccount disconnect] at /UAS8000/MailCore/Source/CTCoreAccount.m:149

#2 seems to point to the code that's present in this commit. I'm not sure if I'm doing anything wrong here that is causing the locks. Any idea?

@dinhvh
Copy link
Owner

dinhvh commented May 16, 2013

Could you investigate if the lock has been acquired somewhere else?
(It might be tricky to investigate it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants