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
  • #5534
Closed
Open
Issue created Jun 16, 2022 by Felix Moessbauer@fmoessbauerContributor

Return of local addr in fragment_add_ibl_target

With gcc 10 and -Werror=return-local-addr it reports that a local reference is returned in fragment_add_ibl_target.

For me it looks like this is an actual bug:

  1. Returned reference to fragment_t wrapper stack-variable: https://github.com/DynamoRIO/dynamorio/blob/master/core/fragment.c#L4106
  2. Ref passed to fragment_coarse_lookup_wrapper as arg: https://github.com/DynamoRIO/dynamorio/blob/master/core/fragment.c#L4111
  3. Ref to wrapper returned from fragment_coarse_lookup_wrapper: https://github.com/DynamoRIO/dynamorio/blob/master/core/fragment.c#L8052
  4. Ref returned from fragment_add_ibl_target: https://github.com/DynamoRIO/dynamorio/blob/master/core/fragment.c#L4139

I did not check if this is actually a realistic code path, but theoretically it should be valid and IMO should be fixed by making a copy of the wrapper. Note, that this path can only be reached in some configurations (with defined(RETURN_AFTER_CALL) || defined(RCT_IND_BRANCH)).

To Reproduce

Compile with gcc 10 and -Wall -Werror=return-local-addr

Versions Current master (c3b73b02) / 9.0.19146

Note: found while working on #5153

Assignee
Assign to
Time tracking