Question: Error, (in OrProp) too many levels of recursion. try catch is not catching it

This is very strange problem, and it seems to happen at random times.

From my worksheet, I call a function in a local fille maple_proc.mpl. This function ends up calling int() command with a timeout.

I Have the int() call wrapped by try...catch:.. end try in order to catch timeout and any other error.

Yet, when I run my worksheet, looping over hundreds of integrals, for each one, calling the function in maple_proc to integrate it, and after running for many many integrals, then sometimes, the worksheet terminates with error, at some iteration with error

Error, (in OrProp) too many levels of recursion |maple_proc.mpl:45|
 

So the try/catch I have in place are not catching the above error, wherever it is coming from.  

line 44 in maple_proc.mpl, just does this (it is the line with cpu_time := .... below

try
print(`before calling int`); 
cpu_time := timelimit(180,CodeTools[Usage](assign('result_of_int',int(lst[i,1],lst[i,2])),output='realtime')):   
print(`after calling int`); 
catch "time expired":
   #...
catch: 
   #...
end try;

Again, this works for sometimes for hundreds of iterations, and then on some entry, it gives this error.

I do not use recursion myself at all. i.e. I have no place where the function calls itself. Worksheet does a loop, and in each interation calls this function in maple_proc.mpl.

Sometimes, when I run the worksheet again, the error do not show up again. I have print statements in the catch above, and these do not show up at all, which means this error is not cought.

What should I do to find why this happens? This did not happen in Maple 2019.2. Is there any other way to trap this error so my loop does not terminate like this and I have to restart it again each time? 

I am using Physics 642 and Maple 2020 on windows 10.

Update

I was able to strip all the code and make a MWE. There is a zip file attached.

one worksheet, which calls a maple_proc() function now in the same worksheet. 

This function reads a plain text file in same folder, which contains list of integrals. The function maple_proc() does a "read" which reads all problems into a variable called lst

Now it simply does a LOOP over all entries in lst calling int() on each integral (one integral per line) with a timeout. You see there is catch() there.

I get the erorr 

At iteration number 188 each time.

I will attach a ZIP file now, which contains one folder which contains the worksheet and the input plain textfile. All what you need to do to reproduce this is open the worksheet and evaluate the call there. You might want to edit the hardcoded folder in the worksheet to your own folder where you unzipped the zip file.
 

currentdirName :="C:/MAPLE_BUG";
currentdir(currentdirName);

I hope someone will be able to repoduce this. It looks like a real bug in Maple 2020.

The problem is not in the integral 188 itself. Because if the loop starts at say 100 or 120, instead from 1, the integral now is processed OK and no error is generated.

MAPLE_BUG.zip

Please Wait...