Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EInvalidPointer when running jMeter against Sample Project #335

Closed
rfx77 opened this issue Mar 2, 2020 · 5 comments
Closed

EInvalidPointer when running jMeter against Sample Project #335

rfx77 opened this issue Mar 2, 2020 · 5 comments
Assignees

Comments

@rfx77
Copy link

rfx77 commented Mar 2, 2020

When i create a simple Sample Project where i start the mvc framework with this code:
LServerListener := TMVCListener.Create(TMVCListenerProperties.New
.SetName('Listener1')
.SetPort(APort)
.SetMaxConnections(1024)
.SetWebModuleClass(TMyWebModule)
);
LServerListener.Start;

i am getting e EInvalidPointer Exception frequently

i attached my eurekalog logfile where you can see the stacktarce. i also attached a screenshot of the stacktrace.

There seems to be a concurrency issue when the TWebModule Create is called. The Problem occurs on TRttiContext.DropContext in EndGlobalLoading. The Problem only occurs when i start dmvc with the TMVCListerner - Code from above

stack

log.zip

@rfx77
Copy link
Author

rfx77 commented Mar 2, 2020

here is the sample-project.
dmvc01.zip

i am on Delphi 10.3.3 Enterprise

@rfx77
Copy link
Author

rfx77 commented Mar 2, 2020

The Problem seems to be that the usafe of WebModuleClass field in TIdHTTPWebBrokerBridge is only supported for backwards-compatibility and the implementation og the Method RunWebModuleClass seems to be not really ThreadSafe and does not pool the WebModules.

@rfx77
Copy link
Author

rfx77 commented Mar 2, 2020

I opened a ticket at embarcadero. TRttiContext.DropContext has a bug and is not threadsafe. This affects TWebModule.Create and TDataModule.Create. Please vote for the Ticket if you have access to quality.embarcadero.com

https://quality.embarcadero.com/browse/RSP-27771

@danieleteti
Copy link
Owner

Voted! Let's wait a fix...

@joaoduarte19
Copy link
Collaborator

This bug is present even in the most current versions of delphi. But it can be solved using a workaround proposed in https://quality.embarcadero.com/browse/RSP-38281.

Just add the following code to one of the units of your project:

initialization
  TRttiContext.KeepContext;
finalization
  TRttiContext.DropContext;
end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants