MinGW+Wine and "DBG: rndw32: get performance data problem: ec=2"
Simon Josefsson
simon at josefsson.org
Wed Jan 16 15:25:17 CET 2008
Hi! On MinGW built binaries run under Wine, libgcrypt generates a lot
of these error messages:
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
DBG: rndw32: get performance data problem: ec=2
The relevant code in cipher/rndw32.c:registry_poll:
pPerfData = gcry_xmalloc (cbPerfData);
for (iterations=0; iterations < 10; iterations++)
{
dwSize = cbPerfData;
if ( debug_me )
log_debug ("rndw32#slow_gatherer_nt: get perf data\n" );
status = RegQueryValueEx (HKEY_PERFORMANCE_DATA, "Global", NULL,
NULL, (LPBYTE) pPerfData, &dwSize);
if (status == ERROR_SUCCESS)
{
if (!memcmp (pPerfData->Signature, L"PERF", 8))
(*add) ( pPerfData, dwSize, requester );
else
log_debug ("rndw32: no PERF signature\n");
break;
}
else if (status == ERROR_MORE_DATA)
{
cbPerfData += PERFORMANCE_BUFFER_STEP;
pPerfData = gcry_xrealloc (pPerfData, cbPerfData);
}
else
{
log_debug ("rndw32: get performance data problem: ec=%ld\n",
status);
break;
}
}
gcry_free (pPerfData);
The error code 2:
/usr/i586-mingw32msvc/include/winerror.h:#define ERROR_FILE_NOT_FOUND 2L
According to:
http://msdn2.microsoft.com/en-us/library/ms724911(VS.85).aspx
Return Value
...
If the lpValueName registry value does not exist, the function returns
ERROR_FILE_NOT_FOUND.
Libgcrypt can't know that the syscall will fail, but is there any reason
to believe that if the first of the 10 calls returns FILE_NOT_FOUND,
that another call to the same function with the same parameters will
succeed? Possibly the code should just abort the loop in this
situation.
In any case, other calls to log_debug in that file are protected behind
a 'if (debug_me)' so I would suggest the patch below as a first step.
Thanks,
Simon
Index: rndw32.c
===================================================================
--- rndw32.c (revision 1280)
+++ rndw32.c (working copy)
@@ -1,5 +1,5 @@
/* rndw32.c - W32 entropy gatherer
- * Copyright (C) 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000, 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
* Copyright Peter Gutmann, Matt Thomlinson and Blake Coverett 1996-2006
*
* This file is part of Libgcrypt.
@@ -440,8 +440,9 @@
}
else
{
- log_debug ("rndw32: get performance data problem: ec=%ld\n",
- status);
+ if ( debug_me )
+ log_debug ("rndw32: get performance data problem: ec=%ld\n",
+ status);
break;
}
}
More information about the Gcrypt-devel
mailing list