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

memoryLimit doesn't work in for tag #776

Closed
prd-dao-nguyen opened this issue Dec 4, 2024 · 2 comments
Closed

memoryLimit doesn't work in for tag #776

prd-dao-nguyen opened this issue Dec 4, 2024 · 2 comments
Labels

Comments

@prd-dao-nguyen
Copy link

Hey
This code will cause memory allocation failure. This will also break the playground.

{% for i in (1..1000000000) %} {{'a'}} {% endfor %}

Please check and tell me if there's any way to fix this!

Thank you!

@prd-dao-nguyen
Copy link
Author

I ran some debug in the library and this code is the root cause:

function* evalRangeToken(token, ctx) {
    const low = yield evalToken(token.lhs, ctx);
    const high = yield evalToken(token.rhs, ctx);
    // console.log("Come here and die")
    return range(+low, +high + 1);
}

Should we add some check here?

@harttle
Copy link
Owner

harttle commented Dec 4, 2024

Yes we already have cpu and mem limit mechanism in place, but not yet applied here.
Good catch!

@harttle harttle added the bug label Dec 4, 2024
@harttle harttle closed this as completed Dec 22, 2024
github-actions bot pushed a commit that referenced this issue Dec 22, 2024
## [10.19.1](v10.19.0...v10.19.1) (2024-12-22)

### Bug Fixes

* add sideEffects=false to package.json ([734eb52](734eb52))
* inconsistent continue behaviour, fixes [#779](#779) ([e3ef574](e3ef574))
* memoryLimit doesn't work in for tag, [#776](#776) ([2af297f](2af297f))
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