Skip to content

[Flang] fatal internal error: CHECK(p) failed at /root/llvm-project/flang/include/flang/Semantics/symbol.h(785) #85776

Closed
@k-arrows

Description

@k-arrows

Reproducible on Godbolt:
https://godbolt.org/z/feW6aGqd8

Reproducer:

$ cat test.f90
real :: r
block
asynchronous :: r
parameter (r = 1.0)
end block
end

Stack dump:

fatal internal error: CHECK(p) failed at /root/llvm-project/flang/include/flang/Semantics/symbol.h(785)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -S -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -mframe-pointer=all -o /app/output.s -x f95-cpp-input /app/example.f90
 #0 0x00000000036e9c58 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x36e9c58)
 #1 0x00000000036e75cc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fab68242520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007fab682969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007fab68242476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007fab682287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000004b51ba9 (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x4b51ba9)
 #7 0x0000000003fe2466 Fortran::semantics::DeclarationVisitor::Pre(Fortran::parser::NamedConstantDef const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x3fe2466)
 #8 0x0000000003fe2c70 void Fortran::parser::Walk<Fortran::common::Indirection<Fortran::parser::ParameterStmt, false>, Fortran::semantics::ResolveNamesVisitor>(Fortran::parser::Statement<Fortran::common::Indirection<Fortran::parser::ParameterStmt, false>> const&, Fortran::semantics::ResolveNamesVisitor&) (.part.0) resolve-names.cpp:0:0
 #9 0x0000000003feac5b void Fortran::parser::Walk<Fortran::parser::DeclarationConstruct, Fortran::semantics::ResolveNamesVisitor>(std::__cxx11::list<Fortran::parser::DeclarationConstruct, std::allocator<Fortran::parser::DeclarationConstruct>> const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x3feac5b)
#10 0x0000000003fe9a4d Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::SpecificationPart const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x3fe9a4d)
#11 0x0000000003fea239 std::enable_if<TupleTrait<Fortran::parser::SpecificationPart>, void>::type Fortran::parser::Walk<Fortran::parser::SpecificationPart, Fortran::semantics::ResolveNamesVisitor>(Fortran::parser::SpecificationPart const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x3fea239)
#12 0x00000000040088f9 Fortran::semantics::ConstructVisitor::Pre(Fortran::parser::BlockConstruct const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x40088f9)
#13 0x0000000004008ba7 void Fortran::parser::Walk<Fortran::semantics::ResolveNamesVisitor>(std::__cxx11::list<Fortran::parser::ExecutionPartConstruct, std::allocator<Fortran::parser::ExecutionPartConstruct>> const&, Fortran::semantics::ResolveNamesVisitor&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x4008ba7)
#14 0x000000000400c012 Fortran::semantics::ResolveNamesVisitor::ResolveExecutionParts(Fortran::semantics::ProgramTree const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x400c012)
#15 0x0000000004010173 Fortran::semantics::ResolveNamesVisitor::Pre(Fortran::parser::ProgramUnit const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x4010173)
#16 0x0000000004011754 Fortran::semantics::ResolveNames(Fortran::semantics::SemanticsContext&, Fortran::parser::Program const&, Fortran::semantics::Scope&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x4011754)
#17 0x0000000004069341 Fortran::semantics::Semantics::Perform() (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x4069341)
#18 0x000000000372dfb7 Fortran::frontend::FrontendAction::runSemanticChecks() (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x372dfb7)
#19 0x0000000003a57170 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x3a57170)
#20 0x000000000372d595 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x372d595)
#21 0x000000000371d367 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x371d367)
#22 0x000000000373381d Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x373381d)
#23 0x0000000001ed6368 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x1ed6368)
#24 0x0000000001ddb6ad main (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x1ddb6ad)
#25 0x00007fab68229d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007fab68229e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000000001ed52ce _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240319/bin/flang-new+0x1ed52ce)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git 5373daad9492e157c0c1ad496334f5dfd78d7da0)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]flang:frontend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions