Issue Details (XML | Word | Printable)

Key: CORE-6231
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: René Hoffmann
Votes: 0
Watchers: 6

If you were logged in you would be able to see more operations.
Firebird Core

access violation on shutdown of xnet connection to local database when events have been registered

Created: 16/Jan/20 10:53 AM   Updated: 17/Jan/20 01:54 PM
Component/s: API / Client Library
Affects Version/s: 3.0.4, 3.0.5
Fix Version/s: 4.0 Beta 2, 3.0.6

File Attachments: 1. Zip Archive (3.02 MB)

Firebird or
ClassicServer (64-bit)
Windows 10 64-bit

QA Status: No test

 Description  « Hide
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 from xnet.cpp - begin =======
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_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 from xnet.cpp - end=======

I created a command line application for testing, which I uploaded to this issue:
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.