Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !5357

i#5356: Add drwrap control inversion option

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i5356-drwrap-ctl-inversion into master Feb 15, 2022
  • Overview 37
  • Commits 11
  • Pipelines 0
  • Changes 7

Adds a new global flag to drwrap which inverts control such that the client must explicitly invoke drwrap's app2app and instrumentation handlers. This lets a client use drbbdup with drwrap only applying to a subset of the cases.

Given missing pieces in drbbdup, only drwrap wrapping is supported this way: not drwrap replacing. (For full support, we would need to add app2app event support inside drbbdup, as well as support for returning other than DR_EMIT_DEFAULT for the various instrumentation handlers.)

Adds a new test drbbdup-drwrap-test which wraps a function in only one of its drbbdup cases.

The new test includes a check for drwrap_set_global_flags() being called after drwrap_init() by having a drwrap_init;drwrap_exit;drwrap_init sequence. This revealed several missing unregister calls in drwrap_exit, which we fix here. These are not assumed to affect full re-attach since drmgr resets its state completely; they cause a use-after-free here because drwrap but not drmgr was reset and we had two thread exit handlers.

Issue: #3995, #5356 (closed) Fixes #5356 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i5356-drwrap-ctl-inversion