-
Notifications
You must be signed in to change notification settings - Fork 424
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
picocli throws a big StackOverflowError #1680
Comments
Thanks for raising this, that doesn't look good! |
Quick update: |
Thanks for the update. I re-arranged a little bit the command line interface and that way StackOverflowError dissapeared. |
Hi @zappee, I finally had a chance to spend some time stepping through this in a debugger. The /**
* Coinbase PRO API configuration.
*/
@CommandLine.ArgGroup(
exclusive = false,
multiplicity = "0", // <---------------- this is not good
heading = "%nCoinbase PRO API:%n")
private final CoinbaseDataSourceArgGroup coinbaseArgGroup = new CoinbaseDataSourceArgGroup(); Note the From the beginning, there are zero matches, so the max multiplicity (zero) is reached, and picocli then gets in an infinite loop...
Great catch, thank you for raising this! On the application side, this can be avoided by specifying On the library side, I will look at adding validation for the multiplicity range: it does not make sense to define ArgGroups that can be specified zero times (never) by the user. Also, there may still be a potential for an infinite loop in that code, even when max multiplicity is larger than zero, I need to investigate that further. |
Thx for the response. As I remember during the refactor that I did I modified the multiplicity value as well. So maybe this is why the issue has dissapeared. Thx. |
I am working on a Java CLI application and I get a picocli StackOverflowError.
This is a strange error and really hard to reproduce. I have tried to create a simple class that demonstrates the issue but that is not easy so the best is if you use the original project.
Steps to reproduce the StackOverflowError:
result:
The picocli works great, the error only appears in this specific use case:
price -i bb -d COINBASE_PRO -k aa -p aa -e aa
I hope that you can reproduce this error.
The text was updated successfully, but these errors were encountered: