This is a discussion on Re: Library loading issue on multi processor Windows 2003 - Openssl ; This is a multi-part message in MIME format. --------------080206080100060309050605 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit As a state of art information: one of our customers that had this issue removed a CPU from his computer, and the issue vanished ! 8-) ...
This is a multi-part message in MIME format.
--------------080206080100060309050605
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 7bit
As a state of art information: one of our customers that had this issue
removed a CPU from his computer, and the issue vanished ! 8-)
Unfortunately, not all of our customers agree to downgrade thier
computers, so, please, if anyone has an advice about how to handle this
issue, it will be welcome !
Luc Perthuis wrote:
> Hello!
> We've got an issue using openssl (0.9.8a to 0.9.8d) libraries with our
> product.
> It works fine on any Unix or even on most windows platforms.
> But, unfortunately, it crashes if run on a quadri pro Xeon Windows
> 2003 platform.
> There is no evidence that's the only platform to show this issue, but
> it actually happens on at least four instances of such a machine.
> The stack of the crash often contains "RAND_POLL" but doesn't seem to
> be reliable.
>
> We could reproduce the same issue with the very simple code attached
> here.
>
> It crashes only if a bunch of executables are launched in a very short
> time.
> Sounds like a real time issue at loading time ... quite strange.
> Well "loading time" is an hypothesis based on the stack: most of the
> time it appears to happen before entering "main".
> We know that windows loads and initialises the DLL modules before
> calling main ... hence our hypothesis
>
> A command line like the following one may be usefull to reproduce the
> issue (it creates 200 wrnd instances):
> for %i in (0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j) do start /min
> /high wrnd.exe & start /min /high wrnd.exe & start /min /high wrnd.exe
> & start /min /high wrnd.exe & start /min /high wrnd.exe & start /min
> /high wrnd.exe & start /min /high wrnd.exe & start /min /high wrnd.exe
> & start /min /high wrnd.exe & start /min /high wrnd.exe
>
> wrnd.exe being built from the attached sample source code
>
> Any hint or help around such an issue will be really welcome.
>
> In case it could matter, here are the command lines used to build the
> executable:
>
> "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Bin\cl.exe"
> -IC:\3rdparty\openssl-0.9.8a\inc32 -I"c:\Program Files\Microsoft
> Visual Studio .NET 2003\Vc7\Include" /D WIN32 /GR /Ob1 /Oi /Ot /Gs
> /Gm- /Gy /D "NDEBUG" /MD /Zi /GL /wd4786 /GB /Oy /TC /c /W3 /EHsc
> /Zm1000 -c -o test.obj test.c
>
> "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\Bin\link.exe"
> /LTCG:status /nologo /nodefaultlib /out:wrnd.exe test.obj
> "C:\openssl\lib\libeay32.lib" "C:\openssl\lib\ssleay32.lib"
> "c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\lib\msvcrt.lib" "c:\Program Files\Microsoft
> SDK\lib\kernel32.lib" "c:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\lib\OLDNAMES.lib"
>
> ------------------------------------------------------------------------
>
> #include
> #include
> #include
> #include
> #include
> #ifdef WIN32
> #include
> #define my_sleep(n) Sleep(1000*(n))
> #else
> #define my_sleep(n) sleep(n)
> #endif
>
> int main(int argc)
> {
> register int i, j;
> int retcode = 0;
> time_t start, end;
> char buffer [2000];
> unsigned char data [512];
> const char *file = NULL;
> const char rng_seed [] = "string to make the random number " \
> "generator think it has entropy";
>
> time(&start);
> if (argc != 1) {
> #ifdef WIN32
> DebugBreak();
> #else
> while (argc != 1) {
> sleep(1);
> }
> #endif
> }
>
> ERR_load_crypto_strings ();
> SSL_load_error_strings ();
>
> file = RAND_file_name (buffer, sizeof (buffer));
>
> if (file != NULL) {
> printf("Rand file = %s\n", file);
> retcode = RAND_load_file (file, -1);
> }
>
> #ifdef WIN32
> RAND_screen ();
> #endif
>
> if (file == NULL || !retcode) {
> if (RAND_status () == 0) {
> RAND_seed (rng_seed, sizeof (rng_seed) - 1);
> }
> }
> printf("RAND_status = %d\n", RAND_status());
>
> j=123;
> for (i=0; i<41; i++) {
> my_sleep(1+(data[j]%13));
> if (!RAND_bytes(data, 512)) {
> printf("Rand generation stopped at step %d\n", i);
> ERR_print_errors_fp(stdout);
> break;
> }
> j=data[j];
> }
>
> if (file != NULL) {
> retcode = RAND_write_file (file);
> }
> RAND_cleanup ();
> ERR_print_errors_fp(stdout);
>
> EVP_cleanup ();
> CRYPTO_cleanup_all_ex_data ();
> ERR_remove_state (0);
> ERR_free_strings ();
>
> time(&end);
> printf("time ellapsed: %d seconds\n", (int)(end-start));
>
> return retcode;
> }
>
--
alea+
Luc
--------------080206080100060309050605
Content-Type: text/x-vcard; charset=utf-8;
name="luc.perthuis.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="luc.perthuis.vcf"
YmVnaW46dmNhcmQNCmZuOkx1YyBQZXJ0aHVpcw0KbjpQZXJ0aH VpcztMdWMNCm9yZzpBdGVt
cG8gUy5BLjtFbmdpbmVlcmluZw0KYWRyOjs7UElCUztWQU5ORV M7OzU2MDAwO0ZSQU5DRQ0K
ZW1haWw7aW50ZXJuZXQ6bHVjLnBlcnRodWlzQGF0ZW1wby5jb2 0NCnRpdGxlOkNvcmUgVGVj
aG5vbG9naWVzIEdyb3VwIE1hbmFnZXINCnRlbDt3b3JrOjAyID k3IDY4IDQwIDI2DQp0ZWw7
ZmF4OjAyIDk3IDY4IDQwIDI1DQp0ZWw7Y2VsbDowNiA4OSAxNi A5NiAzNw0Kbm90ZTtxdW90
ZWQtcHJpbnRhYmxlOkVuYWJsaW5nIEluZm9ybWF0aW9uIExpZm VjeWNsZSBTdHJhdGVnaWVz
PTBEPTBBPQ0KCQ0KeC1tb3ppbGxhLWh0bWw6VFJVRQ0KdXJsOm h0dHA6Ly93d3cuYXRlbXBv
LmNvbQ0KdmVyc2lvbjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------080206080100060309050605--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org