Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > openssl & threads OS 10.2.1

openssl & threads OS 10.2.1
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 1999
Location: mars,ca,usa
Status: Offline
Reply With Quote
Oct 5, 2002, 01:34 AM
 
So, here is the deal. I've got a threaded application running. And my threads happen to use openssl calls. I've implemented thread protection as recommended by open ssl documentation. Basically pthread mutex locks. And it works. But then I bencmark my stuff by hitting it a bunch. And I get an error like:

md_rand.c:311: failed assertion `md_c[1] == md_count[1]'

The program gets an ABRT signal and exits normally according to project builder. But I can't seem to catch the signal and I don't want the app to quit.

So, I look at the openssl source code for version g I see:

for file md_rand.c line 311
#if !defined(THREADS) && !defined(WIN32)
assert(md_c[1] == md_count[1]);
#endif

I know I'm not on windows. But what about threads?

Now, I've linked in these openssl libraries in pb:

/usr/lib/libssl.dylib
/usr/lib/libcrypto.dylib

And the openssl headers are in /usr/include and my stuff links just fine. But my app uses threads and the code snippet implies that apple's build is not a thread build? I know in the Makefile for openssl there is a THREADS= flag. was this not set? I'd like to avoid having to use my own build in case Apple updates or something. Any suggestions or am I just on drugs?
     
Fresh-Faced Recruit
Join Date: Dec 1999
Location: mars,ca,usa
Status: Offline
Reply With Quote
Oct 5, 2002, 02:18 PM
 
Well, I just just linked against my own build. I set config for threads and shared libraries. The problem went away. There are no asserts in it now.

So, problem solved with my own library build...end of thread.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2