cURL / Mailing Lists / curl-library / Single Mail


libcurl openssl thread crash - Windows XP

From: Matt Veenstra <>
Date: Wed, 29 Apr 2009 16:22:26 -0700

Hi there,
I have one client machine that is always crashing when we start multiple
threads with each thread using separate easy handles with OpenSSL. I
tracked this down to each thread calling Curl_ossl_seed() at the same time,
with some fun remote WinDBG sessions.

The call stack basically looks like this.

Heap32Next() // crash.

I have the proper OpenSSL thread call backs in place for Windows setting
CRYPTO_set_locking_callback() as documented. I call curl_global_init() at
the start of my app. There is an option to build OpenSSL to NOT use
RAND_screen(). I did this but still had the crash.

Removing the seed call (which I assume is used for the salt) solves the
crash. Should the seed be set in curl_global_init()?

I am using a slightly old version of libcurl (7.18.0) and OpenSSL I looked at the changes since then and nothing related to the
seed has changed in the current version.

Does anyone have input into this? This is a not a common bug. There are
over many other copies of the app running that do NOT have this problem. It
only happens when spawning a group of downloads all at once.

Thanks for the feedback. Hopefully this can help someone else as well.

Received on 2009-04-30