Access Violation when disconnecting wodWebServer (wodFtpDLX / wodFtpDLX.NET)
Hi guys,
We have an application that contains multiple wodWebServerCom components. Each one is in its own thread with a seperate port number allocated. Each one returns different information.
Everything works fine, until we come to disconnect. Occasionally we get an access violation in TwodWebServerCom::get_Activated().
I've captured the following stack trace using AQTime:
[code]
First chance exception 0xC0000005 ACCESS_VIOLATION occurred at 0x0044B35D, write of address 0x00000041 at 0x0044B35D (in E:codeSAMSInterface Connection ManagerInterfaceConnectionManager.exe) 1868 14:22:09:671
0x0044B35D Wodwebservercomlib_tlb::TwodWebServerCom::get_Activated + 0x225 in InterfaceConnectionManager.exe 1868
0x003B3D78 Wodwebservercomlib_tlb::TwodWebServerCom::InvokeEvent + 0x298 in weonlydo.bpl 1868
0x4017346C Oleserver::TServerEventDispatch::Invoke + 0x80 in vcl60.bpl 1868
0x79014FD5 DllUnregisterServer + 0x12D21 in wodWebD.dll 1868
0x790148EF DllUnregisterServer + 0x1263B in wodWebD.dll 1868
0x790108E4 DllUnregisterServer + 0xE630 in wodWebD.dll 1868
0x790103A6 DllUnregisterServer + 0xE0F2 in wodWebD.dll 1868
0x790098C7 DllUnregisterServer + 0x7613 in wodWebD.dll 1868
0x77E12CA8 GetSysColor + 0x444 in USER32.DLL 1868
0x77E12DC5 GetSysColor + 0x561 in USER32.DLL 1868
Second chance exception 0xC0000005 ACCESS_VIOLATION occurred at 0x0044B35D, write of address 0x00000041 at 0x0044B35D (in E:codeSAMSInterface Connection ManagerInterfaceConnectionManager.exe) 1868 14:22:09:781
[/code]
We have other threads in our app supporting ftp, raw, telnet that also use wod components and we have not seen anything similar with these.
Any idea what could be causing this?
Thanks
Paul.
Re: Access Violation when disconnecting wodWebServ
Paul,
looks to me like wodWebServer is destroyed in the background while you try to access one of it's properties (Activated).
How can I duplicate that? Can you send me your app?
Re: Access Violation when disconnecting wodWebServ
Hi,
Looking at the call stack it seems that an OLE event is being firing:
Oleserver::TServerEventDispatch::Invoke
which calls
Wodwebservercomlib_tlb::TwodWebServerCom::InvokeEvent
which in turn tries to do
TwodWebServerCom::get_Activated
all of this is outside of our code. Possibly a request is being received from the browser whilst the Server object is being deleted.
the crash does not happen very often.
I'll investigate more, but if you have any suggestions they would be most appreciated.
Our app is probably much too unwieldy to either zip up, or for you to get install as it is. I'll see if I can extract out the failing functionality.
Thanks
Paul.
Re: Access Violation when disconnecting wodWebServ
Just to clarify,
the
Wodwebservercomlib_tlb::TwodWebServerCom::InvokeEvent()
method (along with others) is code that is generated when the weonlydo.bpl is built, so is completely out of my control.
Thanks
Paul.
Re: Access Violation when disconnecting wodWebServ
Paul,
yes I know, invoke is called when event is fired.
Re: Access Violation when disconnecting wodWebServ
Hi,
From the stack trace:
[code]Wodwebservercomlib_tlb::TwodWebServerCom::get_Activated + 0x225 in InterfaceConnectionManager.exe 1868
0x003B3D78 Wodwebservercomlib_tlb::TwodWebServerCom::InvokeEvent + 0x298 in weonlydo.bpl 1868
0x4017346C Oleserver::TServerEventDispatch::Invoke + 0x80 in vcl60.bpl 1868[/code]
I see that get_Activated() is called from InvokeEvent().
The AV only occurs when I have a number of server objects (each in their own thread). I am disconnecting them whilst there are requests being received.
When I have disconnected I delete the Server object. Is it possible that the server object gets another event after the Server object has been deleted (a state change event possibly)?
I'll look at changing my code so that it makes sure the Server state is disconnected before it deletes it, and see if that helps.
Any further advice would be greatly appreciated.
Thanks
Paul.