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
  • Issues
  • #3934
Closed
Open
Issue created Nov 13, 2019 by Derek Bruening@derekbrueningContributor

drreg_init's realloc of accumulated slots across multiple calls assumes single-threaded use and breaks prior use during process init

drreg_init takes the num_spill_slots requested by each caller and accumulates them. It re-allocates to add the new request, without any synchronization. It implicitly assumes it's single-threaded for all of these calls: basically that it's during process init. This should be explicitly documented and checked for.

There is a further restriction stemming from this realloc: drreg operations that use spill slots can't be used until all components have called drreg_init, because the slot numbers may change. This could be problematic for clients/extensions who want to use drreg for some static code tweaking during process init. I don't think we have any existing code like that in the DR repo, but Dr. Memory does this (WIP drreg branch https://github.com/DynamoRIO/drmemory/tree/i1795-use-drreg). It has out-of-line call code generated at init time, with an array of them for each of different registers to restore. In fact, I enabled use during process init for DrM for #2910 (closed). We'll need to reconcile this somehow.

Assignee
Assign to
Time tracking