Forum > LCL

[SOLVED] TEventLog.Info call caues Stack overflow in daemon app

(1/1)

omurolmez:
Hello everyone,

If I build this code below with def FAIL, it adds "Recursion too deep; the stack overflowed." to Windows.Application log.

If I build it without def FAIL, it adds "Incorrect function."

Should I create a bug report or should I wait for someone else to try and approve bug to avoid creating unnecessary bug report ?

Lazarus 2.2.6 Fpc 3.2.2 Win 10 x64

--- Edit: SOLVED ----------------------------------------------------------------
There is no stack overflow.
Since the code does not supply a message file, Windows Event Log uses some default. So, event id 1001 comes across to that "Recursion too deep; the stack overflowed." message.
--- Edit: SOLVED ----------------------------------------------------------------


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Program daemon_test;{$DEFINE FAIL} Uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  CThreads,  {$ENDIF}{$ENDIF}  Classes, DaemonApp; type  TDaemon1 = class(TCustomDaemon)  public    function Start: boolean; override;  end; type  TDaemonMapper1 = class(TCustomDaemonMapper)  private  protected  public    constructor Create(AOwner :TComponent); override;  end;   function TDaemon1.Start: boolean;  begin    {$IFDEF FAIL}    Logger.Info('TDaemon1.Start');    {$ELSE}    Logger.Log('TDaemon1.Start');    {$ENDIF}         Result := True;  end; constructor TDaemonMapper1.Create(AOwner :TComponent);begin  inherited Create(AOwner);  with TDaemonDef(self.DaemonDefs.Add) do  begin    DaemonClassName :='TDaemon1';    Name :='TestDaemon';    DisplayName :='Test Daemon';    Options := [doAllowStop];    WinBindings.StartType := stManual;    WinBindings.ServiceType := stWin32;  end;end; begin  RegisterDaemonClass(TDaemon1);  RegisterDaemonMapper(TDaemonMapper1);   Application.EventLog.Identification :='Daemon 1';   Application.Run;end.
Regards
Ömür Ölmez.

Navigation

[0] Message Index

Go to full version