Skip to content

StackOverflow in recursive functions possible #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mschessler opened this issue May 30, 2022 · 2 comments
Closed

StackOverflow in recursive functions possible #263

mschessler opened this issue May 30, 2022 · 2 comments
Labels

Comments

@mschessler
Copy link

MathParser.org-mXparser verssion: v.5.0.5
Framework: java

Functions such as:

  • org.mariuszgromada.math.mxparser.mathcollection.MathFunctions#eulerNumber(int, int)
  • org.mariuszgromada.math.mxparser.mathcollection.MathFunctions#lucasNumber(int)
  • org.mariuszgromada.math.mxparser.mathcollection.MathFunctions#fibonacciNumber(int)
  • and more

Have no max recursion depth and easily can lead to a Stackoverflow.
There seems to be a recursion counter set by org.mariuszgromada.math.mxparser.mXparser#setMaxAllowedRecursionDepth() which is only used for user defined Arguments. It needs to either be expanded to include these functions, or they just need to catch the exception.

@mariuszgromada
Copy link
Owner

Thanks. Yes! I will fix this today :-)

@mariuszgromada
Copy link
Owner

mXparser.setMaxAllowedRecursionDepth() already works on MathCollection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants