Thread: Delphi 10 Seattle - DataSnap OpenSSL Access Violation on finalization
 |
This question is answered.
Helpful answers available: 2.
Correct answers available: 1.
|
|
Replies:
5
-
Last Post:
Dec 11, 2015 11:45 AM
Last Post By: Mathias Burbach
|
|
|
Posts:
42
Registered:
12/8/99
|
|
Hello Folks!
I have been running into an Access Violation when closing my DataSnap client compiled in Delphi 10 Seattle. It all worked fine until Delphi XE8. The error happens in the finalisation of TIdProc._RSA_free. Here is the call stack:
TIdProc._RSA_free
TRSACypher.ClearKey
TRSACypher.Clear
Finalization
FinalizeUnits
InterceptFinalizeUnits
InterceptHalt0FinalizeUnits
@Halt0
initialization
BaseThreadInitThunk
The error message is "Access violation at address 00000000 in module 'CRMClient.exe'. Read of address 00000000."
The error is mentioned on StackOverflow here:
http://stackoverflow.com/questions/32894526/delphi-xe7-10-seattle-datasnap-openssl-access-violation-on-finalization
If I remove the RSA filter in the TDSTCPServerTransport.Filters on the server side all is fine (just as described on StackOverflow). The StackOverflow article from 2 months ago is still without an answer.
Any ideas what might be wrong with Indy in Delphi 10 Seattle?
Salut,
Mathias
|
|
|
Posts:
42
Registered:
12/8/99
|
|
Hello Folks!
I have done some more testing as I had recently upgraded to VMware 12 (all development is done inside virtual machines, one per customer). Before that it was working with Delphi 10 Seattle. So I un-installed VMware 12, installed VMware 11.1.2 instead and was still running into the same exception.
I have now tried to run the DataSnap application server and the DataSnap client compiled with Delphi XE8. No problems there! As much as I would like to blame VMware, it really looks like a problem with Indy in Delphi 10 Seattle.
Anyone can contribute some ideas?
Salut,
Mathias
|
|
|
|
Posts:
42
Registered:
12/8/99
|
|
Hello Folks!
I have build a stock-standard DataSnap server (e.g. EchoString & ReverseString ) using the two encryption filters. They do run into the same problem. You can download the source code from here:
http://www.maranatha-consulting.com/Delphi/TestSSL.zip
Without a solution to this problem I will have to roll back to Delphi XE8 for my DataSnap projects.
Salut,
Mathias
|
|
|
|
Posts:
42
Registered:
12/8/99
|
|
|
|
|
Posts:
42
Registered:
12/8/99
|
|
Hello Folks!
I just double checked that I had in fact compiled the real CRM project with Delphi 10 Seattle on the 4th November 2015 and it was working. Only once I installed the Delphi 10 Seattle Update Pack 1 on the 20th November 2015 the problem started to surface.
Salut,
Mathias
|
|
|
|
Posts:
42
Registered:
12/8/99
|
|
After some internal research, we found that the problem is that Indy is finalized before Data.DBXOpenSSL. When Indy is finalized, it nils the function pointers to all OpenSSL methods. When Data.DBXOpenSSL is finalized it executes code which tries to use a function pointer that is now nil.
While we work out a solution, you could work around this behavior by making the Indy abstraction unit be the first unit in the uses clause (IPPeerClient on the client side, IPPeerServer on the server side) of their project. That would change the initialization and finalization sequences.
Hello Marco,
Thanks for your feedback. I added IPPeerCommon in the project files (server & client) directly after the madExcept unit names. As a result the order of the finalization has been changed and the error is gone.
Thanks for the workaround. I'm looking forward to the fix lateron.
Salut,
Mathias
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us