Skip to content

[RISC-V] MLIR test (CAPI/execution_engine.c) fails with a SIGSEGV on Fedora #162655

@kashyapc

Description

@kashyapc

Description

The CAPI execution engine test from the MLIR test suite, CAPI/execution_engine.c, fails with a segmentation fault (SIGSEGV). This is on RISC-V hardware:"HiFive Premier P550" from SiFive.

If need be, I could run test teset separately and get the backtrace from GBD.

(Note: about 27 tests from the MLIR test suite fail. I wanted to hold off filing more issues, as I was wondering if this seg-fault is the cause for them too. Some more details in the "Additional information" section further below.)

I'm also wondering how many of these tests actually make sense on RISC-V. Are they supposed to pass on RISC-V?

Environment

  • LLVM 21.1.1
  • Fedora 42
  • Hardware: "HiFive Premier P550" by SiFive

Steps to reproduce

Build LLVM 21.1.1 on Fedora 42 (or even F41) running on HiFive Premier P550:

$ fedpkg clone llvm && cd llvm
$ fedpkg sources
$ sudo dnf builddep llvm.spec
$ mock -r fedora-42-riscv64 path/to/llvm-21.1.1.src.rpm
$ fedpkg mockbuild

(I have a local build environment, so I can assist with any additional debugging if need be.)

Actual results

The mlir/test/CAPI/execution_engine.c test fails with a SIGSEGV (-11):

[...]
FAIL: MLIR :: CAPI/execution_engine.c (50 of 2687)
******************** TEST 'MLIR :: CAPI/execution_engine.c' FAILED ********************
Exit Code: 2
Command Output (stdout):
--
# RUN: at line 10
/builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/llvm/redhat-linux-build/bin/mlir-capi-execution-engine-test 2>&1 | /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/llvm/redhat-linux-build/bin/FileCheck /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/mlir/test/CAPI/execution_engine.c
# executed command: /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/llvm/redhat-linux-build/bin/mlir-capi-execution-engine-test
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11
# executed command: /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/llvm/redhat-linux-build/bin/FileCheck /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/mlir/test/CAPI/execution_engine.c
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/llvm/redhat-linux-build/bin/FileCheck /builddir/build/BUILD/llvm-21.1.1-build/llvm-project-21.1.1.src/mlir/test/CAPI/execution_engine.c
# `-----------------------------
# error: command failed with exit status: 2
--
********************
[...]

From Fedora's build log from here: https://riscv-koji.fedoraproject.org/koji/packageinfo?packageID=21312

NB: currently the build "succeeds" on Fedora because the tests are allowed to pass for now with a blunt and temporary workaround such as:

-%cmake_build --target check-mlir
+%cmake_build --target check-mlir || true

Expected results

The test should succeed.

Additional information

There are 26 more failures from the MLIR test suite on Fedora. I haven't filed any issues for them yet as they also seem to

Failed Tests (27):
  MLIR :: CAPI/execution_engine.c
  MLIR :: mlir-runner/async-error.mlir
  MLIR :: mlir-runner/async-func.mlir
  MLIR :: mlir-runner/async-group.mlir
  MLIR :: mlir-runner/async-value.mlir
  MLIR :: mlir-runner/async.mlir
  MLIR :: mlir-runner/bare-ptr-call-conv.mlir
  MLIR :: mlir-runner/copy.mlir
  MLIR :: mlir-runner/expand-arith-ops.mlir
  MLIR :: mlir-runner/global-constructors.mlir
  MLIR :: mlir-runner/global-memref.mlir
  MLIR :: mlir-runner/math-polynomial-approx.mlir
  MLIR :: mlir-runner/memref-reinterpret-cast.mlir
  MLIR :: mlir-runner/memref-reshape.mlir
  MLIR :: mlir-runner/sgemm-naive-codegen.mlir
  MLIR :: mlir-runner/simple.mlir
  MLIR :: mlir-runner/test-expand-math-approx.mlir
  MLIR :: mlir-runner/unranked-memref.mlir
  MLIR :: mlir-runner/utils.mlir
  MLIR :: python/execution_engine.py
  MLIR :: python/multithreaded_tests.py
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/0/6
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/1/6
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/2/6
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/3/6
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/4/6
  MLIR-Unit :: ExecutionEngine/./MLIRExecutionEngineTests/5/6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions