unidac_9.0.1 TCRVioSocket access violation in thread trying to connect to nonexistent IP second time
Posted: Fri 15 Oct 2021 12:51
Hi, (D 10.4.2 Ent)
We had to move back to 8.4.1 !
We don't know exactly, because if we test it in simple app it works, but with other components in bigger app we get those exceptions,
Anyway if we move back to 8.4.1 it works again.
Scenario:
If We try to reconnect in existing connection we get exception second time we try to connect.
In our bigger project we create TUniConnection in thread:
C := TUniConnection.Create(nil);
try
C.ConnectString := fConnStr;
while not fconnected do begin
try
C.Connected := true; <== if we try to connect to non existent IP
fconnected := true;
C.Connected := false;
except on e:exception do begin <== here we get this exception dialog second time we try
ferrstr:= e.Message;
fconnected := false;
end;
if not fconnected then begin
sleep(1000)
else
exit;
end;
finally
C.free;
end;
Here is text from madExcept:
exception message : Access violation at address 0040B818 in module 'PotopneKlient.exe'. Read of address 8D0057FF.
thread $2f88 (TConnector):
0040b818 +008 PotopneKlient.exe System 105 +0 UTF8IdentToString
0040b939 +00d PotopneKlient.exe System 105 +0 TObject.ClassName
0057ff6a +04e PotopneKlient.exe System.Classes TPersistent.AssignError
0057ffd9 +001 PotopneKlient.exe System.Classes TPersistent.AssignTo
019d6573 +00f PotopneKlient.exe CRVioSocket TCRVioSocket.CloseSocket
019d85bd +005 PotopneKlient.exe CRVioTcp TCRVioTcp.CloseSocket
019d8b66 +3be PotopneKlient.exe CRVioTcp TCRVioTcp.InternalConnect
019db7a1 +009 PotopneKlient.exe CRVioTcp TConnector.Execute
004c643f +02b PotopneKlient.exe madExcept HookedTThreadExecute
00596bb5 +049 PotopneKlient.exe System.Classes ThreadProc
00596c18 +0ac PotopneKlient.exe System.Classes ThreadProc
0040d9a4 +028 PotopneKlient.exe System 105 +0 ThreadWrapper
004c6325 +00d PotopneKlient.exe madExcept CallThreadProcSafe
004c638a +032 PotopneKlient.exe madExcept ThreadExceptFrame
76fdfa27 +017 KERNEL32.DLL BaseThreadInitThunk
>> created by thread $2bd0 (TOmniThread) at:
00596c7c +018 PotopneKlient.exe System.Classes TThread.Create
We had to move back to 8.4.1 !
We don't know exactly, because if we test it in simple app it works, but with other components in bigger app we get those exceptions,
Anyway if we move back to 8.4.1 it works again.
Scenario:
If We try to reconnect in existing connection we get exception second time we try to connect.
In our bigger project we create TUniConnection in thread:
C := TUniConnection.Create(nil);
try
C.ConnectString := fConnStr;
while not fconnected do begin
try
C.Connected := true; <== if we try to connect to non existent IP
fconnected := true;
C.Connected := false;
except on e:exception do begin <== here we get this exception dialog second time we try
ferrstr:= e.Message;
fconnected := false;
end;
if not fconnected then begin
sleep(1000)
else
exit;
end;
finally
C.free;
end;
Here is text from madExcept:
exception message : Access violation at address 0040B818 in module 'PotopneKlient.exe'. Read of address 8D0057FF.
thread $2f88 (TConnector):
0040b818 +008 PotopneKlient.exe System 105 +0 UTF8IdentToString
0040b939 +00d PotopneKlient.exe System 105 +0 TObject.ClassName
0057ff6a +04e PotopneKlient.exe System.Classes TPersistent.AssignError
0057ffd9 +001 PotopneKlient.exe System.Classes TPersistent.AssignTo
019d6573 +00f PotopneKlient.exe CRVioSocket TCRVioSocket.CloseSocket
019d85bd +005 PotopneKlient.exe CRVioTcp TCRVioTcp.CloseSocket
019d8b66 +3be PotopneKlient.exe CRVioTcp TCRVioTcp.InternalConnect
019db7a1 +009 PotopneKlient.exe CRVioTcp TConnector.Execute
004c643f +02b PotopneKlient.exe madExcept HookedTThreadExecute
00596bb5 +049 PotopneKlient.exe System.Classes ThreadProc
00596c18 +0ac PotopneKlient.exe System.Classes ThreadProc
0040d9a4 +028 PotopneKlient.exe System 105 +0 ThreadWrapper
004c6325 +00d PotopneKlient.exe madExcept CallThreadProcSafe
004c638a +032 PotopneKlient.exe madExcept ThreadExceptFrame
76fdfa27 +017 KERNEL32.DLL BaseThreadInitThunk
>> created by thread $2bd0 (TOmniThread) at:
00596c7c +018 PotopneKlient.exe System.Classes TThread.Create