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

Stack overflow during codegen #3690

Closed
dkasak opened this Issue Jun 3, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@dkasak

dkasak commented Jun 3, 2017

mruby overflows the stack during codegen with the following POC. The file is almost a megabyte in size, so I'm not inlining it here.

It seems the crash was introduced with 103ef78. Before that commit, the same POC makes mruby exit with:

#<NoMethodError: no method named d>
@matz

This comment has been minimized.

Show comment
Hide comment
@matz

matz Jun 3, 2017

Member

It's system stack overflow. I think 103ef78 made C stack consumed slightly more.
There's no easy way to detect this kind of overflow. Probably we can limit recursion levels explicitly.

Member

matz commented Jun 3, 2017

It's system stack overflow. I think 103ef78 made C stack consumed slightly more.
There's no easy way to detect this kind of overflow. Probably we can limit recursion levels explicitly.

@dkasak

This comment has been minimized.

Show comment
Hide comment
@dkasak

dkasak Jun 3, 2017

That sounds reasonable given that this kind of source file is unlikely to represent a practically useful program and this approach seems to work reasonably well in other places it's been added.

dkasak commented Jun 3, 2017

That sounds reasonable given that this kind of source file is unlikely to represent a practically useful program and this approach seems to work reasonably well in other places it's been added.

@matz matz closed this in fc7096f Jun 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment