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

Add parser tests causing memory grow of control_stack #321

Closed
chfast opened this issue May 19, 2020 · 2 comments
Closed

Add parser tests causing memory grow of control_stack #321

chfast opened this issue May 19, 2020 · 2 comments

Comments

@chfast
Copy link
Collaborator

chfast commented May 19, 2020

Oops, I have not see this. In this case this is fine as we use std::deque, but still I should have think about this before :) I guess I need some tests that causes stack memory grow here and then ASan should find the bug, if it ever happen.

Originally posted by @chfast in #319

@gumb0
Copy link
Collaborator

gumb0 commented May 20, 2020

For me in #312 control stack using Stack often reallocates even when growing from size 1 to 2 (in Debug).
For example if order of frame updating and push is reversed here, some unit tests are failing (e.g. execute_control.br_table_as_return)

// Parent frame gets additional items on stack after this block exit.
frame.stack_height += arity;
// Push label with immediates offset after arity.
control_stack.push({Instr::block, code.instructions.size(), code.immediates.size(),
parent_stack_height, 0, false, arity});

@chfast
Copy link
Collaborator Author

chfast commented May 20, 2020

I checked all 3 cases in block, loop and if. If frame used after control_stack.push() and std::vector used as std::stack backend, all are causing ASan failures when running execute_control test suite.

@chfast chfast closed this as completed May 20, 2020
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