FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Recursive calls
Posts: 1402
Joined: Mon May 14, 2007 09:49 AM

Recursive calls

Posted: Sun Jul 19, 2026 07:26 AM

Hi,

If I leave my program running overnight, an error message like "Too many recursive calls" will appear in the morning.
The error.log file is not being created. Is it possible to find out where that critical recursive call is happening in the program?

Posts: 1530
Joined: Thu Oct 30, 2008 02:37 PM

Re: Recursive calls

Posted: Sun Jul 19, 2026 07:40 AM

Good morning,

Two possible solutions:
1 - Use BEGIN SEQUENCE - RECOVERY - END SEQUENCE to catch the error.

2 - Modify errsysw.prg to write an early_error.log before the Harbour system error goes into a tailspin.

Regards,


*******************************

Buenos días,

Dos posibles soluciones:
1 - Utilizar BEGIN SEQUENCE - RECOVERY - END SEQUENCE para atrapar el error

2 - Modificar errsysw.prg para grabar una early_error.log antes de que el error system de harbour entre en barrena

Salu2

Posts: 1402
Joined: Mon May 14, 2007 09:49 AM

Re: Recursive calls

Posted: Sun Jul 19, 2026 08:27 AM
  1. What exactly should be included in BEGIN SEQUENCE - RECOVERY - END SEQUENCE ? In the program, the timer makes an Http request, but there are no recursive calls.
  2. I don't think that modifying errsysw.prg will solve this problem. I use SetErrorDialog(), but in this case error.log is not created.
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: Recursive calls

Posted: Sun Jul 19, 2026 01:10 PM

Show the *.prg source code that causes this stack overflow; what does it do all night long? Is there a WHILE... ENDDO loop in this module?

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1402
Joined: Mon May 14, 2007 09:49 AM

Re: Recursive calls

Posted: Sun Jul 19, 2026 01:49 PM

I do not know which part of the code causes the message "Too many recursive calls". The one I suspect doesn't have a WHILE_ENDDO loop. Maybe it is possible to intercept the event that triggers the message "Too many recursive calls" ?

Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: Recursive calls

Posted: Sun Jul 19, 2026 02:28 PM
Natter wrote:

I do not know which part of the code causes the message "Too many recursive calls". The one I suspect doesn't have a WHILE_ENDDO loop. Maybe it is possible to intercept the event that triggers the message "Too many recursive calls" ?

It is not possible to intercept a stack overflow. The issue could be a lack of RAM, a virus, your antivirus software interfering, or a program performing an unwanted task for an extended period. Without knowing the cause (source), diagnosis is difficult. Please explain: What does your program do all night long? Do you use a pause timer or SysRefresh()? Does it run in the Windows system tray?

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: Recursive calls

Posted: Sun Jul 19, 2026 02:35 PM

Natter, are you using a modified ERRSYSW.PRG? If so, swap it for the original one from the FWH version you are compiling with and test to see what happens.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8716
Joined: Tue Dec 20, 2005 07:36 PM

Re: Recursive calls

Posted: Sun Jul 19, 2026 03:03 PM

Look,

https://www.fivetechsupport.com/forums/viewtopic.php?p=132536#p132536

https://www.fivetechsoft.com/forums/viewtopic.php?p=26851#p26851

// C:\FWH2603\SAMPLES\ERRBLOCK.PRG

#Include "FiveWin.Ch"

FUNCTION Main() 

   //In your Main()

   LOCAL oErr, bOldError := ErrorBlock( { | oErr | MyErrorHandler( oErr ) } )

   BEGIN SEQUENCE

  // Error, example

  ? 10 / 0

   RECOVER USING oErr

  ? "Error recovered:", oErr:description

   END SEQUENCE

   // Restaura o manipulador original
   ErrorBlock( bOldError )

RETURN NIL

STATIC FUNCTION MyErrorHandler( oErr )

? "A system error occurred:"

? "Description:", oErr:description

// Você pode registrar isso em um log e retornar o objeto de erro para um bloco RECOVER

BREAK( oErr )

RETURN NIL

// FIN / END

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1402
Joined: Mon May 14, 2007 09:49 AM

Re: Recursive calls

Posted: Sun Jul 19, 2026 05:27 PM

Found ! My timer program makes HTTP requests to the startup .php checks the availability of Bitrix24. At night, Bitrix24 "fell asleep", and the timeout was too short oHttp:setTimeouts(800, 600, 1000, 2000). The program crashed with the message "Too many recurrent calls". I increased the timeout and everything worked fine.

Continue the discussion