Page 1 of 1
Recursive calls
Posted: Sun Jul 19, 2026 7:26 am
by Natter
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?
Re: Recursive calls
Posted: Sun Jul 19, 2026 7:40 am
by hmpaquito
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
Re: Recursive calls
Posted: Sun Jul 19, 2026 8:27 am
by Natter
- 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.
- I don't think that modifying errsysw.prg will solve this problem. I use SetErrorDialog(), but in this case error.log is not created.
Re: Recursive calls
Posted: Sun Jul 19, 2026 1:10 pm
by karinha
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.
Re: Recursive calls
Posted: Sun Jul 19, 2026 1:49 pm
by Natter
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" ?
Re: Recursive calls
Posted: Sun Jul 19, 2026 2:28 pm
by karinha
Natter wrote: Sun Jul 19, 2026 1: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" ?
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.
Re: Recursive calls
Posted: Sun Jul 19, 2026 2:35 pm
by karinha
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.
Re: Recursive calls
Posted: Sun Jul 19, 2026 3:03 pm
by karinha
Look,
https://www.fivetechsupport.com/forums/ ... 36#p132536
https://www.fivetechsoft.com/forums/vie ... 851#p26851
Code: Select all | Expand
// 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.
Re: Recursive calls
Posted: Sun Jul 19, 2026 5:27 pm
by Natter
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.