access violation on shutdown of xnet connection to local database when events
have been registered
--------------------------------------------------------------------------------------------------
Key: CORE-6231
URL: http://tracker.firebirdsql.org/browse/CORE-6231
Project: Firebird Core
Issue Type: Bug
Components: API / Client Library
Affects Versions: 3.0.5, 3.0.4
Environment: Firebird 3.0.4.33054 or 3.0.5.33220
ClassicServer (64-bit)
Windows 10 64-bit
Reporter: René Hoffmann
A reproducible access violation occurs on connection shutdown, when there have
events been registered.
Occurs only for XNET connections.
Workaround: If I force local connection via tcp/ip per "inet://..." database
name, it works all properly.
The access violation is raised when accessing "xch" in the loop of function
"xnet_read":
{code:c++}
while (!xnet_shutdown)
{
...
const DWORD wait_result =
WaitForSingleObject(xcc->xcc_event_recv_channel_filled,
XNET_RECV_WAIT_TIMEOUT);
if (wait_result == WAIT_OBJECT_0)
{
// Client has written some data for us (server) to read
port->port_rcv_packets++;
port->port_rcv_bytes += xch->xch_length; // <------ the
memory address of 'xch' is invalid
xdrs->x_handy = xch->xch_length;
xdrs->x_private = xdrs->x_base;
return TRUE;
}
...
}
{code}
I created a command line application for testing, which I uploaded to
"https://nextcloud.hksinformatik.de/index.php/s/cBsMmR3iXjogx2f" (password:
firebirdcrash):
A command line {{FirebirdEventListenerCrashTest.exe "inet://%cd%\MYDB.FDB"
-u:SOMEBODY -p:something}} will run successfully.
A command line {{FirebirdEventListenerCrashTest.exe "xnet://%cd%\MYDB.FDB"
-u:SOMEBODY -p:something}} will stop prematurely.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel