<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/135804>135804</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Dumping 'flang' type causes a crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
erichkeane
</td>
</tr>
</table>
<pre>
See below: I've provided enough backtrace I think to figure out what is going on here, but I'm trying to figure out the type of `loweredExpr`, but it causes a crash in the `getContext`.
Args:
```
(gdb) show args
Argument list to give program being debugged when it is started is "-fc1 -fopenacc flang_parallel_self.f90 -emit-fir -o -".
```
Soruce of that file is:
https://godbolt.org/z/aaEd4oxWj
```
(gdb) p loweredExpr.getType().dump()
Program received signal SIGSEGV, Segmentation fault.
mlir::Dialect::getContext (this=0x7fffffff18a8cc) at /local/home/ekeane/llvm-project/flang/../mlir/include/mlir/IR/Dialect.h:52
52 MLIRContext *getContext() const { return context; }
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(mlir::Type::dump() const) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) bt
#0 mlir::Dialect::getContext (this=0x7fffffff18a8cc) at /local/home/ekeane/llvm-project/flang/../mlir/include/mlir/IR/Dialect.h:52
#1 0x0000000022628cad in mlir::Type::getContext (this=0x7fffffff17e0) at /local/home/ekeane/llvm-project/mlir/lib/IR/Types.cpp:35
#2 0x00000000223dff6b in mlir::Type::print (this=0x7fffffff17e0, os=...) at /local/home/ekeane/llvm-project/mlir/lib/IR/AsmPrinter.cpp:3968
#3 0x00000000223e0055 in mlir::Type::dump (this=0x7fffffff17e0) at /local/home/ekeane/llvm-project/mlir/lib/IR/AsmPrinter.cpp:3976
#4 <function called from gdb>
#5 Fortran::lower::convertExprToValue (loc=..., converter=..., expr=..., symMap=..., stmtCtx=...) at /local/home/ekeane/llvm-project/flang/lib/Lower/ConvertExprToHLFIR.cpp:2086
#6 0x00000000175fcca7 in (anonymous namespace)::FirConverter::genExprValue (this=0x7fffffff4070, expr=..., context=..., locPtr=0x7fffffff1af8) at /local/home/ekeane/llvm-project/flang/lib/Lower/Bridge.cpp:664
#7 0x000000001817780a in genIfClause (converter=..., clauseLocation=..., ifClause=0x23109b20, ifCond=..., stmtCtx=...) at /local/home/ekeane/llvm-project/flang/lib/Lower/OpenACC.cpp:1690
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUlstu2z4Wxp-G3hzEoCnr4oUXjh1lAqSYognaZUFRRxJbihRIynHm6Qek5Npp0xnMpYu_4QXv_PE7H6nDnZOtRtyS9JakhwUffWfsFq0U3XfkGheVqV-3T4hQoTIvJNkBPBCWHxEGa46yxhpQm7HtoOLiu7dcIDyA76T-Dt5AI9vRIpjRw0vHPUgHrZG6BaOhQ4uE7aEafVyzB29fQ9_beb5D8K8DgmmAZFSZF7RY350GSzJ6ni89CD46dMBBWO46kDrOJBlt0e-N9njyJKNLAEJ3hO52tnUkCaWwzPSnO8KKtq4I24DrzAvwMCiOHXvUHpR0PuC1chKgtbyHCgN0jdXYtljDS4c68EgHznPrsQ5FwthNI1Zw05gBNRcCGsV1-3XgliuF6qtD1SybDYUb7KW_aaSFGwM3hLHlT4xPxo4iyuGDpI1UCHI-S-f9EIusJKxsTV0Z5ZfGtoSV_yCs5PyuXpvTl2-TCO8ffYArkZct-ufXAQkrCNss67EfpuK0wsdZBIsC5RFrCIbiCp4e7p_u7j-H-DxhG8TjXhoNDR-VDyfqlbQBNNkdJFco_FS5BAsIK3wXDnagp7yZfquCF0IESB4GlMoIrggrO9MjYSVG04Z2dexvBmu-hYVZGbUmrFwuCSvjzqyUWqixxkvDwyfCyhlm2ZFklzJCdymDD48Pny5QV4iTECCMdh5IfgsW_Wh1aIjdyS2Q_ADRcs_d7x3D3SxbtE-MpwYOzahFFE0Ei9TQWNPD_eE2y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