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
  • #5070
Closed
Open
Issue created Sep 01, 2021 by Assad Hashmi@AssadHashmiContributor

CRASH: AArch64 decoder cannot handle certain combinations of encoding definitions.

The codec.py decode generator is flawed in that it can't handle certain encodings due to an overlap between operands and opcodes.

Specifically, cases where the ONLY difference between two encoding definitions is some part of an operand field and some part of an opcode field.

For example, when adding: 0x0011110xxxxxxx111111xxxxxxxxxx n fcvtzs dq0 : dq5 sd_sz immhb

The following encoding overlap error is detected:

$ ./codec.py `pwd`/codec.txt `pwd` 
Traceback (most recent call last):
  File "./codec.py", line 489, in <module>
    main()
  File "./codec.py", line 477, in main
    consistency_check(patterns, opndtab)
  File "./codec.py", line 420, in consistency_check
    pattern_to_str(*patterns[i])))
Exception: Overlapping patterns:
0x00111100000xxx111111xxxxxxxxxx fmov dq0 : fpimm8 h_sz
0x0011110xxxxxxx111111xxxxxxxxxx fcvtzs dq0 : dq5 sd_sz immhb

Similarly when adding: 0x00111100000xxxxxxx01xxxxxxxxxx n movi dq0 : imm8 cmode4

$ ./codec.py `pwd`/codec.txt `pwd` 
Traceback (most recent call last):
  File "./codec.py", line 489, in <module>
    main()
  File "./codec.py", line 477, in main
    consistency_check(patterns, opndtab)
  File "./codec.py", line 420, in consistency_check
    pattern_to_str(*patterns[i])))
Exception: Overlapping patterns:
0x00111100000xxxxxxx01xxxxxxxxxx movi dq0 : imm8 cmode4
0x00111100000xxxxxx101xxxxxxxxxx orr dq0 : imm8 cmode3

codec.py needs to be able to generate correct decode logic for such overlaps.

Assignee
Assign to
Time tracking