Recursive calls

Post Reply
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Recursive calls

Post 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?

hmpaquito
Posts: 1534
Joined: Thu Oct 30, 2008 2:37 pm

Re: Recursive calls

Post 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

Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: Recursive calls

Post by Natter »

  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.
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Recursive calls

Post 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.

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

Re: Recursive calls

Post 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" ?

User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Recursive calls

Post 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.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Recursive calls

Post 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.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Recursive calls

Post 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.

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

Re: Recursive calls

Post 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.

Post Reply