Issue 135804
Summary [Flang] Dumping 'flang' type causes a crash
Labels flang
Assignees
Reporter erichkeane
    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
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to