-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]flang:frontend
Description
flang-new
version is:flang-new version 20.0.0git (https://github.com/llvm/llvm-project.git 0cc2cd781594aec741f7262df7a48d73a7d09a18)
- Reduced test case:
! foo.f90
module foo
interface
subroutine doFoo(i)
implicit none
end subroutine doFoo
end interface
end module foo
flang-new
invocation is:flang-new foo.f90
- Expected behavior is: The code errors with
No explicit type declared for 'i'
. - Actual behavior: Compilation aborts with the following stack trace:
fatal internal error: nullptr dereference at /root/llvm-project/flang/lib/Semantics/mod-file.cpp(958)
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-20240917/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -debug-info-kind=standalone -resource-dir /opt/compiler-explorer/clang-llvmflang-trunk-20240917/lib/clang/20 -mframe-pointer=all -O0 -o CMakeFiles/main.dir/main.f90.o -x f95-cpp-input /app/main.f90
#0 0x00000000035f7288 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x35f7288)
#1 0x00000000035f4c2c SignalHandler(int) Signals.cpp:0:0
#2 0x00007ce86e042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007ce86e0969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007ce86e042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007ce86e0287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000000004c1c029 (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x4c1c029)
#7 0x00000000041c9f38 (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41c9f38)
#8 0x00000000041ca8ac Fortran::semantics::ModFileWriter::PutEntity(llvm::raw_ostream&, Fortran::semantics::Symbol const&, std::function<void ()>, Fortran::semantics::Attrs) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41ca8ac)
#9 0x00000000041ce00d Fortran::semantics::ModFileWriter::PutObjectEntity(llvm::raw_ostream&, Fortran::semantics::Symbol const&) (.part.0) mod-file.cpp:0:0
#10 0x00000000041ce7dd auto Fortran::semantics::ModFileWriter::PutSymbol(llvm::raw_ostream&, Fortran::semantics::Symbol const&)::'lambda10'(auto const&)::operator()<Fortran::semantics::EntityDetails>(auto const&) const (.isra.0) mod-file.cpp:0:0
#11 0x00000000041ce9d5 Fortran::semantics::ModFileWriter::PutSymbol(llvm::raw_ostream&, Fortran::semantics::Symbol const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41ce9d5)
#12 0x00000000041cfc3a Fortran::semantics::ModFileWriter::PutSubprogram(Fortran::semantics::Symbol const&) (.part.0) mod-file.cpp:0:0
#13 0x00000000041cebaa Fortran::semantics::ModFileWriter::PutSymbol(llvm::raw_ostream&, Fortran::semantics::Symbol const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41cebaa)
#14 0x00000000041d4fce Fortran::semantics::ModFileWriter::PutSymbols(Fortran::semantics::Scope const&, std::set<Fortran::common::Reference<Fortran::semantics::Symbol const>, Fortran::semantics::SymbolAddressCompare, std::allocator<Fortran::common::Reference<Fortran::semantics::Symbol const>>>*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41d4fce)
#15 0x00000000041d344e Fortran::semantics::ModFileWriter::Write(Fortran::semantics::Symbol const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41d344e)
#16 0x00000000041d55e0 Fortran::semantics::ModFileWriter::WriteAll() (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x41d55e0)
#17 0x0000000003feb235 Fortran::semantics::Semantics::Perform() (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x3feb235)
#18 0x000000000364fe1d Fortran::frontend::FrontendAction::runSemanticChecks() (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x364fe1d)
#19 0x000000000398691a Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x398691a)
#20 0x000000000364f025 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x364f025)
#21 0x000000000363e447 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x363e447)
#22 0x00000000036558ad Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x36558ad)
#23 0x0000000001cdd5c8 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x1cdd5c8)
#24 0x0000000001bbe1ac main (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x1bbe1ac)
#25 0x00007ce86e029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007ce86e029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000000001cdc52e _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240917/bin/flang-new+0x1cdc52e)
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 20.0.0git (https://github.com/llvm/llvm-project.git 0cc2cd781594aec741f7262df7a48d73a7d09a18)
- Additional info: Removing
implicit none
and compiling withflang-new -fimplicit-none foo.f90
also reproduces the issue.
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]flang:frontend