I have an extremely simple SmtpServer set up to simply receive emails and write them to disk. My problem is that over several hours the number of active threads just keeps growing, leading me to believe they are not being freed correctly. I further have to conclude it is quite likely as a result of something I am doing or not doing that is causing this, however for the life of me I cant seem to identify the problem.
I have attached my sources, they do contain an external reference to a text file logging routine that is thread safe (file protected by critical section) that has been used without issue for many years.
In my current setup I am binding to 20 IP addresses and they all seem to receive and handle the incomming email as expected. The load on the system is between 1 and 5 messages per minute. after 24 hours there are well over 1,000 threads active, this would not be all the threads created (fewer than messages received) in that period.
By my speculation my error should be in my configuration of the component
with WwolSmtpServ do
begin
ReuseSocket := rsTrue;
AllowPipelining := True;
ServerName := 'WWOL SMTP server';
DefaultPort := 25;
ListenQueue := 50;
MaxConnections := 0;
MaxMsgSize := 0;
TerminateWaitTime := 500;
UseNagle := True;
UseTLS := utNoTLSSupport;
end;
OR in my component exception handlers
procedure TdSmtpServ.WwolSmtpServException(AContext: TIdContext; AException: Exception);
begin
try
if ((AException is EIdConnClosedGracefully) or (AException is EIdNotConnected)) then
begin
Exit;
end
else
begin
if AContext.Connection.Connected then
begin
Log(Now, 0, 1, AContext.Binding.IP, AContext.Binding.PeerIP, AException.ClassName, AException.message + ' - ' + ' SmtpServException still connected');
AContext.Connection.Disconnect;
end
else
Log(Now, 0, 1, AContext.Binding.IP, AContext.Binding.PeerIP, AException.ClassName, AException.message + ' - ' + ' SmtpServException disconnected');
// AContext.Connection.Disconnect(False);
end;
except
on E: Exception do
begin
dmMain.TextLog('WwolSmtpServException : ' + E.Message);
dmMain.TextLog('WwolSmtpServException : ' + AContext.Binding.IP + ' : ' + AContext.Binding.PeerIP + ' : ' + AException.ClassName + ' : ' + AException.message);
end;
end;
end;
I have a Delphi console project I am porting to Linux using FreePascal 3.0.4 and Lazarus 1.8.4.
It uses Indy10 email and FTP components with OpenSSL.
The port is towards Ubuntu Linux on x86_64. So it is now a 64 bit program.
I installed the IndyLaz package for Indy10 via OnlinePackageManager in Lazarus and it seems like it accepts all of my Indy calls during compile.
But this Delphi project relied on two dlls (libeay32.dll and ssleay32.dll) for SSL to operate on Windows.
Do I need to put some corresponding Linux binaries into my project directory and if so where can I get them?
Or is the fact that I installed OpenSSL into Ubuntu enough for Indy10 to be able to use SSL?
I have not yet reached the point where I can test run the application since it needs specific email data to work from.
EDIT after being able to test run application
It turns out that the SSL connection apparently needs something extra in Linux...
I am getting the following exception when connecting to the mail server to retrieve email using POP3:
Followed by this when I click No twice:
This happens in this code section:
Code:
try
IdGetMail.Connect; // This is an IdPop3 object. Exception thrown here
MailCnt := IdGetMail.CheckMessages;
if MailCnt = 0 then {Nothing to process}
Some week ago I switched 14.2.1 from 14.0.58. Lately I realized that all forms using TIWTabControl doesn't work anymore throwing an Access Violation error clicking on tabs bar (Please see below the trace-back)
I checked my project and even in the IDE (RAD studio XE) the issue occurs.
Testing is quite simple. Just place on a IWForm a TIWTabControl, add few pages and then click on the tabs bar and observe the pop up dialog reporting the AV error.
Has anybody else experienced/reported this issue?
Has been fixed in earlier releases? (unfortunately I cannot further upgrade since 14..2.1 is the latest version allowed by my license)
Does a workaround is available?
Thanks in advance
Andrea
Application Error An unhandled application error has occured within EnteBilaterale
Error message: Access violation at address 48488BD2. Read of address 48488BD2
Depending on the error condition, it might be possible to restart the application.
In order to restart the application, please click the link below:
Please note that depending on the actual exception that occured, restarting the application might not be possible. If this is the case, please report the error message to the administrator.
This puts the edit in the grid in the (sort of) correct place, I then edit the value in the grid (change 1 to 2), if I then add a new row the edit goes back to it's original value (1). How do I get this to work?
You will find 2 projects there as part of CGIRunnerDemo project group:
CGIRunnerReport: A stand alone IW application which executes a CGI application
CGIReport: A std CGI application, WebBroker based, also created with Delphi, which generates a sample PDF report.
CGI applications can be used in several situations: - you already have a working CGI application and want to call it from your new or existing IW application; - You have a complex report which can't be easily ported to a multi-threaded application (have in mind that a CGI application behaves like a normal desktop application regarding multi-thread, i.e, a CGI application is basically a single-threaded console application). - You want to use and/or integrate 3rd party components - including report generators - which are not multi-thread friendly.
I want to upgrade my bundled edition of Intraweb. I have Delphi 10.2. I wanted to upgrade to Intraweb v15. However, the Bundled key generator sent me a new license key stating it would work with Intraweb 12 and 14. Is there a way to get a free license key for Intraweb v15 in Delphi 10.2?
I updated from IW15.0.13 to IW15.0.14 and saw the following error.
My application uses cookies to support autologin. The first form, TDlgLogin, checks a cookie and if it's ok, bypasses the login form by creating the next application form.
In IW15.0.14 the TDlgLogin form is showed instead of the next application form.
Very simplified the testcase is this:
Code:
type
TIWForm1 = class(TIWAppForm)
IWLabel1: TIWLabel;
public
constructor Create(aOwner: TComponent); override;
end;
I presume there is a little problem in Indy for FPC 3.0.4, Lazarus 1.8.4, Debian x86_64:
Compile package indylaz 10.6.2: Exit code 256, Errors: 2, Hints: 4
IdSSLOpenSSLHeaders.pas(17956,49) Hint: C arrays are passed by reference
IdSSLOpenSSLHeaders.pas(17958,64) Hint: C arrays are passed by reference
IdSSLOpenSSLHeaders.pas(17963,68) Hint: C arrays are passed by reference
IdSSLOpenSSLHeaders.pas(19230,65) Hint: Local variable "LLen" does not seem to be initialized
IdSSLOpenSSLHeaders.pas(19571,10) Error: function header doesn't match the previous declaration "GetCryptLibHandle:Int64;"
IdSSLOpenSSLHeaders.pas(18191,10) Error: Found declaration: GetCryptLibHandle:QWord;
Cards are finished. Had to add 8 new region types to make all the magic work!
Also finished component badges. Component badges were created because of the deep nesting of divs and other tags that is needed by Bootstrap. They are a little "in your face", so I'll probably have an option to disable them. But I have already gotten used to them.
I have included an image of the design-time IntraWeb page as well as the output, so you can see both badges and cards.