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
  • !3174

i#3171: fix hang running Go programs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i3171-go-clone into master Sep 18, 2018
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 5

Go's thread creation looks at the SYS_clone stack parameter post-syscall, which DR was not restoring after replacing it with the dstack. We fix that here.

That bug led to Go programs using the dstack, resulting in them executing DR memory, where DR tried to raise an artificial SIGSEGV. However, this ended up in Go's signal handler where SIGSEGV was blocked, and due to various #196 (closed) checks lining up incorrectly, this led to an infinite loop.

To fully fix the infinite loop and get the SIGSEGV to the outer lever, I changed os_forge_exception() to set SI_KERNEL and added a forged flag into execute_default_action() and avoid trying to call decode_sizeof() there (just crashes b/c SIGSEGV handler removed). I alo cleared the app's signal mask, to avoid SIGSEGV being blocked during cleanup, causing the supposed-to-be-fatal SYS_kill to just return, and another hang in debug build in debug_infinite_loop.

Issue: #196 (closed), #3171 (closed) Fixes #3171 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i3171-go-clone