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
  • #2088
Closed
Open
Issue created Dec 01, 2016 by Derek Bruening@derekbrueningContributor

the clear of TLS_SEG in emit_new_thread_dynamo_start() clobbers any app use of aux seg

This code in emit_new_thread_dynamo_start() seems problematic:

# ifdef X86
    /* We avoid get_thread_id syscall in get_thread_private_dcontext()
     * by clearing the segment register here (cheaper check than syscall)
     * (xref PR 192231).  If we crash prior to this point though, the
     * signal handler will get the wrong dcontext, but that's a small window.
     * See comments in get_thread_private_dcontext() for alternatives.
     */
    APP(&ilist, XINST_CREATE_load_int
        (dcontext, opnd_create_reg(REG_AX), OPND_CREATE_INT16(0)));
    APP(&ilist, INSTR_CREATE_mov_seg
        (dcontext, opnd_create_reg(SEG_TLS), opnd_create_reg(REG_AX)));
# endif

We swap to native, but then we clear the aux seg reg -- so if the app is using the aux reg too and isn't using the MSR won't we mess it up? Our init won't know that it's using a segment.

Assignee
Assign to
Time tracking