[Quickfix-developers] Bug - ThreadedSocketAcceptor crashes in Windows 2003 Itanium
Brought to you by:
orenmnero
|
From: Djalma R. d. S. F. <drs...@gm...> - 2007-02-06 19:01:36
|
Hi,
I got the following error, only in a Itanium server (IA64) and only in
Release mode:
Unhandled exception at 0x180021004a000800 in BTSFIXGateway.exe:
0xC0000005: Access violation executing location 0x180021004a000800.
After many hours of remote debugging, I found a bug fixing for it in
socket_getsockopt function (Utility.cpp).
The reason is that the last getsockopt parameter (*optlen) *is both for
input and output, thus it should be properly initialized, indeed all the
MSDN examples that I saw do it.
My opinion is that maybe this error is occurring only with Windows
IA64 because of specific processor optimization, as I said, it does
not occur in debug mode even with Itanium.
As I work a lot with 64 bit platforms, I would appreciate this modification
in next QuickFIX version.
Thanks,
Djalma
///////////////////////////////////////////////////////////////////
int socket_getsockopt( int s, int opt, int& optval )
{ QF_STACK_PUSH(socket_getsockopt)
int level = SOL_SOCKET;
if( opt == TCP_NODELAY )
level = IPPROTO_TCP;
#ifdef _MSC_VER
int length = sizeof(int); // @@This is an IN/OUT parameter and should be
initialized this way
#else
socklen_t length;
#endif
return ::getsockopt( s, level, opt,
( char* ) & optval, & length );
QF_STACK_POP
}
///////////////////////////////////////////////////////////////////
|