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

[symex] make alloca handling more robust #2095

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

intrigus-lgtm
Copy link
Collaborator

Don't free pointers returned from allocate functions. Pointers from functions called alloca$ will still be incorrectly freed, but this is for a future PR.

@intrigus-lgtm intrigus-lgtm force-pushed the intrigus/symex-more-robust-alloca branch from 1e12e2f to 157bbfa Compare October 24, 2024 00:10
@lucasccordeiro lucasccordeiro requested a review from XLiZHI October 24, 2024 11:55
@lucasccordeiro lucasccordeiro force-pushed the intrigus/symex-more-robust-alloca branch from 157bbfa to 54930be Compare October 24, 2024 11:55
@rafaelsamenezes
Copy link
Contributor

Maybe we could replace it with a regex? Something like "alloca$\d+".

@lucasccordeiro
Copy link
Contributor

Maybe we could replace it with a regex? Something like "alloca$\d+".

@intrigus: could you please try this approach?

@intrigus-lgtm
Copy link
Collaborator Author

Maybe we could replace it with a regex? Something like "alloca$\d+".

@intrigus: could you please try this approach?

I will not try this approach as it's also not complete, i.e. a function called alloca$111 would still fail.
I don't have the time for a complete solution and the alloca handling in esbmc looks pretty broken anyway.

The main motivation for this PR is to unblock my c++ code that uses std::allocator.

@rafaelsamenezes
Copy link
Contributor

Maybe we could replace it with a regex? Something like "alloca$\d+".

@intrigus: could you please try this approach?

I will not try this approach as it's also not complete, i.e. a function called alloca$111 would still fail. I don't have the time for a complete solution and the alloca handling in esbmc looks pretty broken anyway.

That would generate "alloca$111$", no?

@lucasccordeiro
Copy link
Contributor

The main motivation for this PR is to unblock my c++ code that uses std::allocator.

Thanks, @intrigus.

I have asked Rafael to submit another PR with his proposal.

Don't free pointers returned from `alloca`te functions.
Pointers from functions called `alloca$` will still be incorrectly freed, but this is for a future PR.
@lucasccordeiro lucasccordeiro force-pushed the intrigus/symex-more-robust-alloca branch from 54930be to 71f882a Compare October 24, 2024 13:53
@lucasccordeiro lucasccordeiro merged commit 70a5c7f into master Oct 24, 2024
11 checks passed
@lucasccordeiro lucasccordeiro deleted the intrigus/symex-more-robust-alloca branch October 24, 2024 13:54
@lucasccordeiro
Copy link
Contributor

Thanks for submitting this PR, @intrigus-lgtm.

@intrigus-lgtm
Copy link
Collaborator Author

The main motivation for this PR is to unblock my c++ code that uses std::allocator.

Thanks, @intrigus.

I have asked Rafael to submit another PR with his proposal.

Sorry, for not being more helpful, just pretty busy and keeping my thesis' deadline in mind.

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

Successfully merging this pull request may close these issues.

5 participants