Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: Access violation inside TIdTCPClientCustom
| Subject: | Re: Access violation inside TIdTCPClientCustom |
| Posted by: | "Michael Stieler" (michael.stiel..@rie.eu) |
| Date: | Thu, 17 Jan 2008 12:14:27 |
Remy Lebeau (TeamB) schrieb:
> "Michael Stieler" <michael.stieler@rie.eu> wrote in message
> news:478f1d80$1@newsgroups.borland.com...
>
>> we have massive problems debugging one of our products
>> depending on Indy 10.
>
> Which build number of Indy 10 are you actually using?
As for the build number, I dont't know where to look for this.
The latest entry in IdTcpClient is
Rev 1.38 1/15/05 2:14:58 PM
made by you.
>
>> The program is multi-threaded, and works fine for hours..
>> but then the program exits with an access violation and I am
>> not able to track it because it never happened in the IDE yet.
>
> Have you tried using third-party tracers yet, such as MadExcept?
No, I didn't know this was possible or neccesary, but I will try it.
>
>> The exception was thrown a few lines later at
>>
>> IOHandler.Open;
>
> That is not enough to diagnose your problem. Open() does a lot of work
> internally. You are going to have to trace further than that.
>
The problem is, that IOHandler is nil at this point, I forgot to mention
this.
>> Since I can't understand why this could happen in a linear execution,
>> I guess it happens because of a multi-threading issue.
>
> Do you have threads accessing the client while Connect() is still running?
This is what I was thinking about. Connect() blocks until success or
failure, so my poll thread couldn't call during this time.
But if for example a Status Disconnected would be fired during
Connect(), this could lead to a call to Disconnect().
Hm.. so could this happen if I call Connect() although the connection is
already established because I think it isn't.. then inside the Connect()
function the connection brakes, the IOHandler is Freed and then the Line
IOHandler.Open() leads to the access violation?
I rember hearing about a (performance?) problem with calling
conn.Connected, so I used my own status variable for this. Wrong? This
of course can lead to out-of-sync-problems...
Thanks,
Michael
>
>
> Gambit