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

    <tr>
        <th>Summary</th>
        <td>
            MLIR SparseTensor integration tests fail asan
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir:sparse,
            mlir
      </td>
    </tr>

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

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

<pre>
    The following tests have asan leaks:

```
MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_codegen_dim.mlir
MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
```

E.g.:

```
Direct leak of 8320 byte(s) in 1 object(s) allocated from:
    #0 0x55e2e81cc88e in malloc (llvm-project/build/bin/mlir-cpu-runner+0x446888e) (BuildId: 585742220edf8ec5)
    #1 0x7f41b92633a9  (<unknown module>)
    #2 0x7f41b92639fc  (<unknown module>)
    #3 0x55e2e97a96da in compileAndExecuteVoidFunction((anonymous namespace)::Options&, mlir::ModuleOp, llvm::StringRef, (anonymous namespace)::CompileAndExecuteConfig) llvm-project/mlir/lib/ExecutionEngine/JitRunner.cpp:250:10
    #4 0x55e2e97a3a04 in mlir::JitRunnerMain(int, char**, mlir::DialectRegistry const&, mlir::JitRunnerConfig) llvm-project/mlir/lib/ExecutionEngine/JitRunner.cpp:383:23
    #5 0x55e2e8209fb1 in main llvm-project/mlir/tools/mlir-cpu-runner/mlir-cpu-runner.cpp:33:10
    #6 0x7f41bb324082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVUtv2zgQ_jXyRbBBUS_qoEPixEAWG3SRtns1KGoks6FIQaTS5N_vkHK8jlPs9mCBoMQh-c1881Jj2rf62wHizihlfkrdxw6ss_GBv0DMLdexAv5so_QmIncReZ8Lchxh-fjnw1Psj6Q38YN20E_cSaMjuruTXIFw-PV15JOFb6CtmXC5_es7zjYI98K00IPet3LYDEpO10EduHsBcU1A556n8YqAlg-jgtZbOszqmsDjcO7Ji3At8_2m3_x3WO_khKpCAsSmi1lKSdy8OYgosxGtYqnjJDbNj2DPIuKYRYI7aONuMsMJPsYnoimJyWueAwWWCMEYeIQhXMFdptTLsB4ns-Dtmlmq1r-l5-3JrMU4r6dZa0DCt-Q1ywqGKF4vXr_15x9a77Kc5WVGKSXQdgxEjic-2JGgHWWXJU1FizTllReyKN3O-lmbn2iTaWcFUXp_eZGeX6w68dsX03fmVcmrouWeuTDDKBXc6Pb-FcTs4G8j292sxRJqhoNro98GM9tY8wEwuMKzXRLjy-jPodeLiG7jEOwgfww2fBm91Lt0kX51Exb3E3Re_D_I20vDtkZ3svd-vohR0Ep3SjY4L4fRpnvdS41wuz-kewrh2ohxRGCaE5wT8sE12ZlrUk6ykBQnNieIR-7zgEntPANx4Kj4Joxz8sfyeIJeWje9oY-1dZ9cdAK9FrGUpZ5e-oFYfsp2SqquSZZsx-nXupwxyv4q0y8l7zrTz74s3vOzSWlGGPUq93tkIfbW8cntg_6QW0dur6zYF9laST2_rns9LxtiY82mCEUWcD6XWMJKBkWTlXlJiShFnlRFBUXFG9rSsug4FG3SApwK4aK3rKBOigJP5vis2jptq7TiKyedgjq0v_P-hjxOTfD4g-q4VOEHtZonVR-cG8NPiu5w9NId5maDBebp-BpYXmdOl9bO4N2dl0WRrg61yErGKG1I2xIuGgJAiqpK8iRhRGQkWSnegLJ1lN9GlB5zaWm3uF6qahHjKr9byZoS7EAVqbDfIM6G5QLZAkNJVaW8izICGA618ZZtzNSvpjoY2cy9xU2FGWz_3eTWyl4DHA3gGM1GPh-V8dkdzFQ_yReYSlKuArs6UPsHi4Rqbg">