[mlir][shard] SIGSEGV while handling incomplete shard-partition annotations
I observed a SIGSEGV from mlir-opt while running shard-partition on incompletely annotated IR at the revision below. I am reporting the saved behavior as a diagnostic/robustness question: the input does not satisfy all of the pass's annotation requirements, so successful partitioning is not the expected outcome.
This report is based on an existing execution record. It does not claim an independently repeated failure, a current-main regression, or a confirmed new root cause.
Environment
- LLVM/MLIR revision:
67005b724c917e1bdca50c82ecaa1b21a69244ed. - Observed executable:
mlir-opt. - Executable SHA-256:
9b1858d58d1d2e0371e5d02ee65a88757ef9fa9cbbae571dd59737b52f0bd37a. - Pass:
shard-partition, on a function inside a module. - The recorded invocation enabled verification between passes and IR logging, with MLIR threading disabled.
- Complete build flags and assertion settings have not been recovered for this report.
Reproducer
The original saved input is included below without edits. It is not a newly generated or minimized testcase. SHA-256: dc6277ef8f94f5f3ca13cb84f099c80a2c464b822aa4fd29475577fce74d26ae.
func.func @shard_shard_addi(%arg0: tensor<2x3xi32>, %arg1: tensor<2x3xi32>, %sharding: !shard.sharding) -> tensor<2x3xi32> {
%0 = shard.shard %arg0 to %sharding : tensor<2x3xi32>
%1 = shard.shard %arg1 to %sharding : tensor<2x3xi32>
%2 = arith.addi %0, %1 : tensor<2x3xi32>
return %2 : tensor<2x3xi32>
}
The input is incompletely annotated: operand annotations have no user-side marker, and the arithmetic result has no result-side annotation. The sharding value is a block argument; a defining grid/sharding operation is not present in this input. I am not claiming that these bytes meet the pass preconditions.
Steps to reproduce
The recorded execution supplied the bytes above on stdin to mlir-opt. These are the saved argument values, with only the private IR-dump destination replaced by a descriptive placeholder:
[
"--pass-pipeline=builtin.module(func.func(shard-partition))",
"--verify-each=true",
"--mlir-disable-threading",
"--mlir-print-ir-before-all",
"--mlir-print-ir-after-all",
"--mlir-print-ir-module-scope",
"--mlir-print-ir-tree-dir=<recorded-dump-directory>",
"--mlir-pass-statistics"
]
This is an invocation record, not a newly tested command. No replay, input mutation or current-main execution was performed while preparing this update.
Actual behavior
The target compiler terminated with SIGSEGV (signal 11; subprocess return code -11), and the child was reaped. The saved elapsed time was about 0.079 seconds with a 10-second deadline. Stdout was empty. The saved stderr is reproduced below; private executable and dump-directory paths have been redacted. This is the original stack, not a newly obtained trace.
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: mlir-opt --pass-pipeline=builtin.module(func.func(shard-partition)) --verify-each=true --mlir-disable-threading --mlir-print-ir-before-all --mlir-print-ir-after-all --mlir-print-ir-module-scope --mlir-print-ir-tree-dir=<recorded-dump-directory> --mlir-pass-statistics
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 mlir-opt 0x000055aa8e95a915 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 117
1 mlir-opt 0x000055aa8e9571d8 llvm::sys::RunSignalHandlers() + 72
2 mlir-opt 0x000055aa8e95734b
3 libpthread.so.0 0x00007fede0231980
4 mlir-opt 0x000055aa9556271e
5 mlir-opt 0x000055aa9556ab83
6 mlir-opt 0x000055aa9556be33
7 mlir-opt 0x000055aa97817ea9 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 2617
8 mlir-opt 0x000055aa97818214 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 404
9 mlir-opt 0x000055aa97819434 mlir::detail::OpToOpPassAdaptor::runOnOperationImpl(bool) + 1076
10 mlir-opt 0x000055aa97817d81 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 2321
11 mlir-opt 0x000055aa97818214 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 404
12 mlir-opt 0x000055aa9781a17e mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) + 94
13 mlir-opt 0x000055aa9781b16f mlir::PassManager::run(mlir::Operation*) + 3887
14 mlir-opt 0x000055aa8ea1cdd6
15 mlir-opt 0x000055aa8ea1d767
16 mlir-opt 0x000055aa97be98a9 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) + 201
17 mlir-opt 0x000055aa8ea1877a
18 mlir-opt 0x000055aa8ea1dea8 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) + 1432
19 mlir-opt 0x000055aa8ea1e100 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) + 480
20 mlir-opt 0x000055aa8e8c1a78 main + 872
21 libc.so.6 0x00007feddeda9c87 __libc_start_main + 231
22 mlir-opt 0x000055aa8e93a7da _start + 42
Expected behavior
For this incomplete input, a handled diagnostic and pass failure would be the useful outcome, rather than successful partitioning.
The pinned pass definition requires fully annotated IR and compatible partitioning interfaces/shardings. The pinned annotation checks provide diagnostics for missing or incorrectly placed annotations.
Could maintainers clarify whether this class of incomplete annotation is intended to be rejected by those diagnostics, or whether an additional caller precondition applies before those checks?
Analysis
This is a saved fixed-version observation, not evidence that a valid partitioning workload is miscompiled. Incomplete annotations are a known limitation of the input. A source-level explanation of the signal remains provisional; no exact defect mechanism, regression range or novelty claim is made.
The existing checks do not by themselves show that every earlier function/block preparation step is covered. I have not verified the runtime behavior of this exact input on current main. The original input and saved invocation are now included. Complete build flags, current-main behavior and exact root attribution remain unverified.
Related issues
- #176000 introduced correct/full annotation checks and is the basis for the diagnostic-handling question. It is not evidence that this exact input was verified fixed.
- #183028 contains related partitioning/propagation hardening; equivalence to this saved failure has not been established.
- #185050 covers empty functions and a bufferization interface case. The saved input has a function body and does not contain that bufferization operation.
- #223332 concerns a Shard-related canonicalization failure with a same-parent-block assertion. Its route and diagnostic differ from this recorded partitioning SIGSEGV.
I have not established an exact duplicate from this bounded review. That is not a claim of exhaustive novelty.
Assisted-by: OpenAI Codex (substantial assistance with evidence review and report preparation).
@llvm/issue-subscribers-mlir
Author: lin334141-cell
This report is based on an existing execution record. It does not claim an independently repeated failure, a current-main regression, or a confirmed new root cause.
Environment
- LLVM/MLIR revision:
67005b724c917e1bdca50c82ecaa1b21a69244ed. - Observed executable:
mlir-opt. - Executable SHA-256:
9b1858d58d1d2e0371e5d02ee65a88757ef9fa9cbbae571dd59737b52f0bd37a. - Pass:
shard-partition, on a function inside a module. - The recorded invocation enabled verification between passes and IR logging, with MLIR threading disabled.
- Complete build flags and assertion settings have not been recovered for this report.
Reproducer
A self-contained testcase is not attached to this initial report. The saved input is identified by SHA-256 dc6277ef8f94f5f3ca13cb84f099c80a2c464b822aa4fd29475577fce74d26ae.
The input contains one function, two tensor annotations, an arithmetic operation and a return. Its annotation structure is incomplete: the operand annotations lack the user-side marker, and the arithmetic result lacks a result-side annotation. Other partitionability requirements are not established. The presence of annotation operations must not be read as proof that the input is supported by this pass.
Steps to reproduce
The saved execution submitted the original input to mlir-opt with shard-partition at the function scope described above. This is a description of the recorded execution, not a newly verified standalone reproduction recipe. I have not replayed these exact bytes on a current-main binary.
Actual behavior
The target compiler terminated with SIGSEGV, signal 11 (subprocess return code -11). The child process was reaped. The recorded elapsed time was about 0.079 seconds with a 10-second deadline, so the stored outcome was a signal rather than a timeout.
Stdout was empty. Stderr contained the compiler crash banner and a stack; a before-pass IR dump was also saved. The available record concerns the target compiler, not an auxiliary checker. It does not establish a complete root cause or rule out every possible environmental contribution.
Expected behavior
For this incomplete input, a handled diagnostic and pass failure would be the useful outcome, rather than successful partitioning.
The pinned pass definition requires fully annotated IR and compatible partitioning interfaces/shardings. The pinned annotation checks provide diagnostics for missing or incorrectly placed annotations.
Could maintainers clarify whether this class of incomplete annotation is intended to be rejected by those diagnostics, or whether an additional caller precondition applies before those checks?
Analysis
This is a saved fixed-version observation, not evidence that a valid partitioning workload is miscompiled. Incomplete annotations are a known limitation of the input. A source-level explanation of the signal remains provisional; no exact defect mechanism, regression range or novelty claim is made.
The existing checks do not by themselves show that every earlier function/block preparation step is covered. I have not verified the runtime behavior of this exact input on current main. A maintainer may need a complete shareable testcase before deciding whether to accept or close this report.
Related issues
- #176000 introduced correct/full annotation checks and is the basis for the diagnostic-handling question. It is not evidence that this exact input was verified fixed.
- #183028 contains related partitioning/propagation hardening; equivalence to this saved failure has not been established.
- #185050 covers empty functions and a bufferization interface case. The saved input has a function body and does not contain that bufferization operation.
- #223332 concerns a Shard-related canonicalization failure with a same-parent-block assertion. Its route and diagnostic differ from this recorded partitioning SIGSEGV.
I have not established an exact duplicate from this bounded review. That is not a claim of exhaustive novelty.