<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58357>58357</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            mlir-cpu-runner/async-group.mlir fails and freeze the test suite
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    log: https://llvm-jenkins.debian.net/job/llvm-toolchain-binaries/architecture=i386,distribution=unstable,label=i386/680/console

```

Testing: 0  2  4  6  8  10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 
FAIL: MLIR :: mlir-cpu-runner/async-group.mlir (1614 of 1617)
******************** TEST 'MLIR :: mlir-cpu-runner/async-group.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1';     /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-opt /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir -pass-pipeline="async-to-async-runtime,func.func(async-runtime-ref-counting,async-runtime-ref-counting-opt),convert-async-to-llvm,func.func(convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts"  | /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner                                                           -e main -entry-point-result=void -O0                                    -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_c_runner_utils.so       -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_runner_utils.so         -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_async_runtime.so    | /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/FileCheck /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir
--
Exit Code: 2

Command Output (stderr):
--
free(): invalid pointer
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner -e main -entry-point-result=void -O0 -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_c_runner_utils.so -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_runner_utils.so -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_async_runtime.so
 #0 0xf0e19e71 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:569:13
 #1 0xf0e1a0f0 PrintStackTraceSignalHandler(void*) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:635:3
 #2 0xf0e17d8c llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:104:20
 #3 0xf0e1a42d SignalHandler(int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:0:3
 #4 0xf7f89570 (linux-gate.so.1+0x570)
 #5 0xf7f89559 (linux-gate.so.1+0x559)
 #6 0xefffcec7 (/lib/i386-linux-gnu/libc.so.6+0x85ec7)
 #7 0xeffadb41 raise (/lib/i386-linux-gnu/libc.so.6+0x36b41)
 #8 0xeff97262 abort (/lib/i386-linux-gnu/libc.so.6+0x20262)
 #9 0xeffefc6c (/lib/i386-linux-gnu/libc.so.6+0x78c6c)
#10 0xf000837d (/lib/i386-linux-gnu/libc.so.6+0x9137d)
#11 0xf0009e53 (/lib/i386-linux-gnu/libc.so.6+0x92e53)
#12 0xf000c802 cfree (/lib/i386-linux-gnu/libc.so.6+0x95802)
#13 0xf0359818 operator delete(void*) (/lib/i386-linux-gnu/libstdc++.so.6+0x88818)
#14 0xead7afda mlir::runtime::AsyncToken::~AsyncToken() build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:173:8
#15 0xead7b04c mlir::runtime::(anonymous namespace)::RefCounted::destroy() build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:149:41
#16 0xead792c3 mlirAsyncRuntimeDropRef build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:237:1
#17 0xf7f7e0a8 
#18 0xf7f7e4a8 
#19 0x56662543 compileAndExecute((anonymous namespace)::Options&, mlir::Operation*, llvm::StringRef, (anonymous namespace)::CompileAndExecuteConfig, void**) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:250:3
#20 0x5665ed72 compileAndExecuteVoidFunction((anonymous namespace)::Options&, mlir::Operation*, llvm::StringRef, (anonymous namespace)::CompileAndExecuteConfig) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:267:10
#21 0x5665d9b0 mlir::JitRunnerMain(int, char**, mlir::DialectRegistry const&, mlir::JitRunnerConfig) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:402:23
#22 0x565c3aa0 main build-llvm/tools/clang/stage2-bins/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.
Testing: 0  2  4  6  8  10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 
FAIL: MLIR :: mlir-cpu-runner/async-group.mlir (1614 of 1617)
******************** TEST 'MLIR :: mlir-cpu-runner/async-group.mlir' FAILED ********************
Script:
--
: 'RUN: at line 1';     /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-opt /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir -pass-pipeline="async-to-async-runtime,func.func(async-runtime-ref-counting,async-runtime-ref-counting-opt),convert-async-to-llvm,func.func(convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts"  | /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner                                                           -e main -entry-point-result=void -O0                                    -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_c_runner_utils.so       -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_runner_utils.so         -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_async_runtime.so    | /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/FileCheck /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir
--
Exit Code: 2

Command Output (stderr):
--
free(): invalid pointer
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner -e main -entry-point-result=void -O0 -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_c_runner_utils.so -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_runner_utils.so -shared-libs=/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/./lib/libmlir_async_runtime.so
 #0 0xf0e19e71 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:569:13
 #1 0xf0e1a0f0 PrintStackTraceSignalHandler(void*) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:635:3
 #2 0xf0e17d8c llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:104:20
 #3 0xf0e1a42d SignalHandler(int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:0:3
 #4 0xf7f89570 (linux-gate.so.1+0x570)
 #5 0xf7f89559 (linux-gate.so.1+0x559)
 #6 0xefffcec7 (/lib/i386-linux-gnu/libc.so.6+0x85ec7)
 #7 0xeffadb41 raise (/lib/i386-linux-gnu/libc.so.6+0x36b41)
 #8 0xeff97262 abort (/lib/i386-linux-gnu/libc.so.6+0x20262)
 #9 0xeffefc6c (/lib/i386-linux-gnu/libc.so.6+0x78c6c)
#10 0xf000837d (/lib/i386-linux-gnu/libc.so.6+0x9137d)
#11 0xf0009e53 (/lib/i386-linux-gnu/libc.so.6+0x92e53)
#12 0xf000c802 cfree (/lib/i386-linux-gnu/libc.so.6+0x95802)
#13 0xf0359818 operator delete(void*) (/lib/i386-linux-gnu/libstdc++.so.6+0x88818)
#14 0xead7afda mlir::runtime::AsyncToken::~AsyncToken() build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:173:8
#15 0xead7b04c mlir::runtime::(anonymous namespace)::RefCounted::destroy() build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:149:41
#16 0xead792c3 mlirAsyncRuntimeDropRef build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/AsyncRuntime.cpp:237:1
#17 0xf7f7e0a8 
#18 0xf7f7e4a8 
#19 0x56662543 compileAndExecute((anonymous namespace)::Options&, mlir::Operation*, llvm::StringRef, (anonymous namespace)::CompileAndExecuteConfig, void**) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:250:3
#20 0x5665ed72 compileAndExecuteVoidFunction((anonymous namespace)::Options&, mlir::Operation*, llvm::StringRef, (anonymous namespace)::CompileAndExecuteConfig) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:267:10
#21 0x5665d9b0 mlir::JitRunnerMain(int, char**, mlir::DialectRegistry const&, mlir::JitRunnerConfig) build-llvm/tools/clang/stage2-bins/mlir/lib/ExecutionEngine/JitRunner.cpp:402:23
#22 0x565c3aa0 main build-llvm/tools/clang/stage2-bins/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp:0:10
#23 0xeff983b5 (/lib/i386-linux-gnu/libc.so.6+0x213b5)
#24 0xeff9847f __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x2147f)
#25 0x565c3877 _start (/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner+0x16877)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/FileCheck /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir
cpp:0:10
#23 0xeff983b5 (/lib/i386-linux-gnu/libc.so.6+0x213b5)
#24 0xeff9847f __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x2147f)
#25 0x565c3877 _start (/build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/mlir-cpu-runner+0x16877)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/build-llvm/tools/clang/stage2-bins/bin/FileCheck /build/llvm-toolchain-snapshot-16~++20221013100845+25162418c604/mlir/test/mlir-cpu-runner/async-group.mlir

```

it freeze the execution of the testsuite.

(I am not 100% that it is this test causing the failure of the testsuite)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztW1tzo7gS_jXOSxcuIUCIBz9knKR2Ts2emUqy5zUlhLA1g4GSRE6yv_60AN-SnYvn7Ox4t0i5MEjo06dWd6u7Xcmb4nlRNatZdAlr51qLNzN6g5-qetwEH1X9Sdd2Xqhci3peK4c9H5t82--appJroesg17UwWlnsEUautVPSdUbNoisdcTajy0JbZ3TeOd3U2NrV1om8UthTiVxVuxdvGCd4lU1tG-wmVzNyOV4ZGT8HjffKOl33_AkABYgBGAAHCAmEFMIYQgYhB0qAUqAxUAaUQ0QgohDFEDGIOMQEYgpxDDGDmENCIKGQxJAwSDgwAowCi4ExYBxSAimFNIaUQcqBE-AUeAycAeeQEcgoZDFkDAaON5dv33mCv757ewtewHi_qbQJZNsFpqtrZbzY7HMtg5Vpunbue2FGeciQf1PiEsJ0RrNx4fT7P3B_fXePyOlpXHAA-FVcX8H_M_vA_04a3To_d_8YBOOykAnOc_vbv_2dcFDpWkGITbPoDfg_JJZ3uipea5-tRWvXjQtCNkuvZ_QNfiihNCRhFBLC48Q3JCGjccglI_EWKvBA-OChvO7KSqAy0RtUzpWiXqt9K37htRdT07o_mccg3xuHiryd5Mt6EbTC2qDVrfISQsOZUTq85JpguMHBTm-8cZVdLef-gtp01BcYVQay8Q9-xcvPd_o1e-WjSzTKR2VcsJttkN7RJLt3jHbr_TuHw_2bB6ONwg6pKxV0tVGi0r-rIpDCOhQ9GvQsXZ7Fzu83Bb7_L1CwQdr4XTvzHLSNrh0K23YVGsTVY6MLCN6Tb0Kya2FQUJXOba8DP0lCcz-jzoerF9SDfBjE9IC-vrJz25w94z_me86Mewt8GK11pH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