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
  • #5683
Closed
Open
Issue created Oct 12, 2022 by Derek Bruening@derekbrueningContributor

drstatecmp incorrectly uses pre-app2app ilist when block was truncated in app2app

When I remove -exit_after_tracing from the tool.drcachesim.drstatecmp-delay-simple test it reports a statecmp error:

$ bin64/drrun -t drcachesim -trace_after_instrs 20000 -enable_drstatecmp -- suite/tests/bin/simple_app
Application basic block where mismatch detected: 
TAG  0x00007f5f9756a56e
 +0    L3 @0x00007f5d531ae1e8  49 8b 4f 68          mov    0x68(%r15)[8byte] -> %rcx
 +4    L3 @0x00007f5d531a8950  48 8b 72 08          mov    0x08(%rdx)[8byte] -> %rsi
 +8    L3 @0x00007f5d531ac2d0  48 8d 3d 90 d3 01 00 lea    <rel> 0x00007f5f9758790d -> %rdi
 +15   L3 @0x00007f5d531b15e0  48 03 71 08          add    0x08(%rcx)[8byte] %rsi -> %rsi
 +19   L3 @0x00007f5d531b6508  b9 0a 00 00 00       mov    $0x0000000a -> %ecx
 +24   L3 @0x00007f5d531a9220  f3 a6                rep cmps %ds:(%rsi)[1byte] %es:(%rdi)[1byte] %rsi %rdi %rcx -> %rsi %rdi %rcx
 +26   L3 @0x00007f5d531b6b28  0f 97 c2             setnbe  -> %dl
 +29   L3 @0x00007f5d531afeb8  80 da 00             sbb    $0x00 %dl -> %dl
 +32   L3 @0x00007f5d531b1560  84 d2                test   %dl %dl
 +34   L3 @0x00007f5d531aedc0  0f 85 e1 fa ff ff    jnz    $0x00007f5f9756a077
END 0x00007f5f9756a56e

ASSERT FAILURE: ext/drstatecmp/drstatecmp.c:430: false (xdi)

Looks like drstatecmp uses the pre-app2app ilist when the block is truncated, so the reg state result incorrectly doesn't match:

after instrumentation:
TAG  0x00007f5f9756a56e
 <...>
 +638  L3 @0x00007f5d531b7990  f3 a6                rep cmps %ds:(%rsi)[1byte] %es:(%rdi)[1byte] %rsi %rdi %rcx -> %rsi %rdi %rcx
 +640  L3 @0x00007f5d531b5b88  0f 97 c2             setnbe  -> %dl
 +643  L3 @0x00007f5d530b3090  80 da 00             sbb    $0x00 %dl -> %dl
 +646  L3 @0x00007f5d531ac250  84 d2                test   %dl %dl
 <...>
END 0x00007f5f9756a56e
Assignee
Assign to
Time tracking