Skip to content
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

Parsed BigDecimal is not limited for a scale value and has an UNLIMITED math context that is unsafe for open systems #65

Closed
plokhotnyuk opened this issue Jun 11, 2018 · 1 comment

Comments

@plokhotnyuk
Copy link
Contributor

plokhotnyuk commented Jun 11, 2018

The code bellow can grab CPU core for several minutes and then will throw an out of memory error:

JsonStringInput.read[BigDecimal]("\"1e2000000000\"") + 1

More details: scala/bug#10882

@plokhotnyuk plokhotnyuk changed the title Parsed BigDecimal has UNLIMITED math context that is unsafe for open systems Parsed BigDecimal is not limited for a scale value and has an UNLIMITED math context that is unsafe for open systems Jun 11, 2018
@ghik
Copy link
Contributor

ghik commented Jul 16, 2018

Fixed as part of #66 in #74, JsonStringInput uses BigDecimal.defaultMathContext (DECIMAL128) which can be adjusted using JsonOptions.

@ghik ghik closed this as completed Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants