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

Stack overflow during codegen #3690

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

Stack overflow during codegen #3690

dkasak opened this issue Jun 3, 2017 · 2 comments

Comments

@dkasak
Copy link

@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
Copy link
Member

@matz 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
Copy link
Author

@dkasak 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 as completed in fc7096f Jun 5, 2017
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