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

Dereferenced non-allocated pointer error #75

Open
adam-mcdaniel opened this issue Aug 24, 2020 · 1 comment
Open

Dereferenced non-allocated pointer error #75

adam-mcdaniel opened this issue Aug 24, 2020 · 1 comment
Labels
error handling Related to Oak's error handling system hardening Improvement to the soundness of the project memory Related to Oak's memory management

Comments

@adam-mcdaniel
Copy link
Owner

To make programs more correct, runtime checks could be added for determining whether or not the program is accessing memory it does not own.

To be a valid pointer, it must either:

  1. Point to an address that is less than the stack pointer. Pointers to stack variables are valid pointers.
  2. Point to allocated memory on the heap. Non-allocated memory on the heap should not be accessed.

Dereferencing an address that violates either of those rules could throw a accessed unowned memory error.

@adam-mcdaniel adam-mcdaniel added hardening Improvement to the soundness of the project memory Related to Oak's memory management error handling Related to Oak's error handling system labels Aug 24, 2020
@kevinramharak
Copy link
Contributor

Does this mean that every dereference of a pointer has to be checked? I'm assuming performance is not really a concern right now, but does this not generate a lot of overhead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Related to Oak's error handling system hardening Improvement to the soundness of the project memory Related to Oak's memory management
Projects
None yet
Development

No branches or pull requests

2 participants