Issue Details (XML | Word | Printable)

Key: CORE-100
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: thomashauck
Votes: 1
Watchers: 1
Operations

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

Access Violation in fcblient.dll v1.5.3 on disconnecting

Created: 16/May/06 12:00 AM   Updated: 26/Dec/07 11:22 AM
Component/s: API / Client Library
Affects Version/s: 1.5.3
Fix Version/s: 2.1 Beta 2, 2.0.4

Time Tracking:
Not Specified

Issue Links:
Relate
 

SF_ID: 1489433


 Description  « Hide
SFID: 1489433#
Submitted By: thomashauck

I'am useing Firebird 1.5.3 on Windows XP SP2. I
recompiled the fbclient with VS.Net 2003. In my app i
use the event notification so i get notifyed if one of
the tables are changed. When the app is closed, i first
deregister the event notification and than disconnect
from the database. Sometimes the disconnect will
produce a acceass violation exactly on this line of the
fbclient source code.

// Clear context reference for the associated event handler
// to avoid SEGV during shutdown

if (port->port_async) {
 port->port_async->port_context = NULL; << access violation
}


The "port->port_async" is pointing to some wild address
how is not anywhere in the address space of the app or
any of the dll's

If i use a older gds32.dll (version 1.5.1.4481) renamed
to fbclient.dll everything is OK.

If i use the orginal fbclient.dll (version 1.5.3.4870)
from the Firebird Download, VS.Net 2003 will come up
with a "unhandled execption" by disconnecting from the
database.

If i'am not useing the eventnotification of firebird
everything works fine, and there is no execption by
disconnecting from the database.

Befor i forget. I have more than one Database
connections open, but the event notification is allways
in the first connection to firebird, and is the last
one to disconnect.

It is not reproducable all the time. It works on some
PC's and on some others it will produce the exeption.

To me it looks as if the "port->port_async" variable is
in some state of the disconnet a "wild" pointer, and
depending on his value, the exeption is raised or not.


Good luck in finding the bug.
Thomas

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alice F. Bird added a comment - 14/Jun/06 09:32 AM
Date: 2006-05-17 21:16
Sender: dimitr
Logged In: YES
user_id=61270

Known issue that does not exist in v2.0.

Anders Larsen added a comment - 31/Jul/07 08:46 AM
I'm experiencing the same with Firebird 2.0.1.12855: access violation if isc_detach_database() is called too soon after isc_que_events() or isc_cancel_events().

If I make my application sleep for about 200ms before calling isc_detach_database() there is no access violation.

When linking with Borland's gds32 instead of the fbclient I don't have to put the application to sleep before isc_detatch_database() and there is no access violation.

Using Windows XP and MSVC 2005.

Dmitry Yemanov added a comment - 31/Jul/07 08:55 AM
Could you provide a reproducable test case, either binary or source code?

thomashauck added a comment - 22/Oct/07 02:50 AM
I think this issue is resolvet with:
http://tracker.firebirdsql.org/browse/CORE-1452

I did not test it, but i sounds like the same thing to me.

@Dmitry
Sorry i can't provide a testcase. I rewrote my application so i was not useing events any more.