KhronosGroup / KhronosGroup/SPIRV-Tools

spirv-dis terminates on invalid instructions

Open
#6,806 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.4k
Forks
709
Avg merge
1d 22h
Merged PRs (30d)
28

Description

The problem with is is it makes it very difficult to diagnose the actual problem. One needs to

1. Disassemble using --offsets, noting the offset of the last instruction printed
2. Go to that offset in a hex editor
3. Decode the instruction at that offset (to get its length)
4. Skip to the next instruction
5. Analyze that instruction to diagnose the issue

At a minimum, spirv-dis should output the raw ints for the instruction (preferably in hex) assuming the count value in the first int is reasonable (if it's not reasonable, maybe the first 8 ints).

Ideally, spirv-dis should print the disassembly of the offending instruction with the errors highlighted, then continue disassembly if recovery is possible.

Contributor guide

Open the contributing guide

Research direction

Start with the spirv-dis entry point and its --offsets handling, then reproduce the termination on an invalid instruction. The issue describes success as printing the offending raw ints, preferably in hex, and continuing disassembly when recovery is possible.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.