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

vmarea and heap exit flags not reset on re-init #2571

Closed
s-kanev opened this issue Jul 28, 2017 · 2 comments
Closed

vmarea and heap exit flags not reset on re-init #2571

s-kanev opened this issue Jul 28, 2017 · 2 comments

Comments

@s-kanev
Copy link
Contributor

s-kanev commented Jul 28, 2017

This came up in the following case:

  • static attach with a client (drmemtrace), which detaches with dr_app_stop_and_cleanup().
  • later, from the same process, invoke raw2trace_t, which uses dr_init_standalone() to map modules and decode instructions.
    Mapping modules then fails because update_dynamo_areas_on_release() doesn't remove VM areas thinking it's exiting, because both vm_areas_exited and heap_exiting are still set.

The fix is simple, don't statically initialize them, but use the proper _init() functions.

s-kanev added a commit to s-kanev/dynamorio that referenced this issue Jul 28, 2017
@derekbruening
Copy link
Contributor

Re-initializing the same DR library instance is not fully supported yet: #2157 covers the main feature and initial work for full (non-standalone) re-attach.

@s-kanev
Copy link
Contributor Author

s-kanev commented Jul 28, 2017

Understood, I'm guessing the standalone case is much simpler than #2157 because it touches on fewer static variables.

derekbruening pushed a commit that referenced this issue Jul 29, 2017
Resets heap and vmareas exit flags on detach to avoid problems on re-init.

Tested: ctest,internal repro.

Fixes #2571
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