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

Fix the function-return detection #44

Open
pdigiglio opened this issue Feb 3, 2017 · 2 comments
Open

Fix the function-return detection #44

pdigiglio opened this issue Feb 3, 2017 · 2 comments
Assignees

Comments

@pdigiglio
Copy link
Collaborator

By running the interpreter on Valgrind, I found out there is a bug in DBInterpreter::processReturn(). The top of the call stack is accessed when the stack is empty. This has undefined behavior.

Also, I think the call stack should be handled by the EventGenerator so that a call ID is pushed on a new CallEvent and popped on a ReturnEvent.

Maybe a segment stack would make return detection easier?

@pdigiglio
Copy link
Collaborator Author

  • The segment-ID stack was not needed. The DBInterpreter now only keeps track of the last segment ID, which is enough to detect a function return;
  • The CallStack is now handled by the EventGenerator as described above;
  • There are no longer invalid accesses in the DBInterpreter::processReturn() member function.

@pdigiglio
Copy link
Collaborator Author

I still can't figure out how to properly detect function returns. Maybe there should be a call and segment stack per thread.

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

No branches or pull requests

1 participant