llvm-objdump LLVM ERROR when disassembling `isb` instruction with `--arch-name=thumb`
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
When I use `llvm-objdump` to disassemble a file that uses the ISB thumb instruction and pass `--arch-name=thumb`, it crashes with the following error:
```
Disassembly of section .text:
00000000 :
LLVM ERROR: t2ISB: expected 3 operands, got 1
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump --disassemble-all --arch-name=thumb input.o
#0 0x0000560134b45adb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump+0x93badb)
#1 0x0000560134b42e3a SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007fc5aa64bdf0 (/lib/x86_64-linux-gnu/libc.so.6+0x3fdf0)
#3 0x00007fc5aa6a095c (/lib/x86_64-linux-gnu/libc.so.6+0x9495c)
#4 0x00007fc5aa64bcc2 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3fcc2)
#5 0x00007fc5aa6344ac abort (/lib/x86_64-linux-gnu/libc.so.6+0x284ac)
#6 0x00005601342c7bf1 createInMemoryBuffer(llvm::StringRef, unsigned long, unsigned int) (.cold) FileOutputBuffer.cpp:0:0
#7 0x0000560134ad749e (llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump+0x8cd49e)
#8 0x000056013479d270 (anonymous namespace)::ARMDisassembler::getInstruction(llvm::MCInst&, unsigned long&, llvm::ArrayRef, unsigned long, llvm::raw_ostream&) const ARMDisassembler.cpp:0:0
#9 0x000056013479d5ae (anonymous namespace)::ARMDisassembler::getInstruction(llvm::MCInst&, unsigned long&, llvm::ArrayRef, unsigned long, llvm::raw_ostream&) const ARMDisassembler.cpp:0:0
#10 0x000056013431ef32 disassembleObject(llvm::object::ObjectFile&, llvm::object::ObjectFile const&, (anonymous namespace)::DisassemblerTarget&, std::optional<(anonymous namespace)::DisassemblerTarget>&, llvm::objdump::SourcePrinter&, bool, llvm::raw_ostream&) llvm-objdump.cpp:0:0
#11 0x00005601343236a9 disassembleObject(llvm::object::ObjectFile*, bool, llvm::raw_ostream&) llvm-objdump.cpp:0:0
#12 0x0000560134327614 dumpObject(llvm::object::ObjectFile*, llvm::object::Archive const*, llvm::object::Archive::Child const*) llvm-objdump.cpp:0:0
#13 0x0000560134329818 llvm_objdump_main(int, char**, llvm::ToolContext const&) (llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump+0x11f818)
#14 0x00005601342c9713 main (llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump+0xbf713)
#15 0x00007fc5aa635ca8 (/lib/x86_64-linux-gnu/libc.so.6+0x29ca8)
#16 0x00007fc5aa635d65 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29d65)
#17 0x00005601342f71d1 _start (llvm-project-llvmorg-22.1.4/build/bin/llvm-objdump+0xed1d1)
Aborted (core dumped)
```
# Reproduction steps
Create input.s with the following contents:
```
foo:
isb sy
```
Assemble the file using the following command (note: I used `clang` from Debian Trixie; I don't think this issue is sensitive to the assembler used):
```
clang -c input.s --target=thumbv7m-none-eabi
```
Then invoke llvm-objdump using:
```
llvm-objdump --disassemble-all --arch-name=thumb input.o
```
Weirdly, removing `--arch-name=thumb` makes the issue disappear.
# Background/other notes
Rust ships LLVM tools including llvm-objdump as an optional component. I discovered this during a Rust toolchain update. It appeared sometime between the nightly-2026-01-01 and nightly-2026-02-01 Rust toolchains, and there was an LLVM update in between those. nightly-2026-01-01's llvm-objdump (which does not exhibit this issue) gives the following --version output:
```
LLVM (http://llvm.org/):
LLVM version 21.1.8-rust-1.94.0-nightly
Optimized build.
[Registered targets list snipped]
```
while nightly-2026-02-01's llvm-objdump (which does exhibit this issue) gives the following --version output:
```
LLVM (http://llvm.org/):
LLVM version 22.1.0-rust-1.95.0-nightly
Optimized build.
[Registered targets list snipped]
```
I've verified this issue still exists in the 22.1.4 tagged release from this repository.
Contributor guide
Research direction
Reproduce the failure with input.s containing `isb sy`, the shown clang assembly command, and `llvm-objdump --disassemble-all --arch-name=thumb input.o`. Start in ARMDisassembler.cpp at the getInstruction frames in the stack trace; done means llvm-objdump disassembles this input without aborting, with a regression test for the command or equivalent behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100