carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

Explorer crashes

Open eschnett opened this issue 1 year ago • 0 comments

Description of the bug:

I wanted to have a first look at Carbon and am following the instructions in the Github README. When I try to run the explorer I see a stack backtrace instead.

What did you do, or what's a simple way to reproduce the bug?

I am using macOS. I installed Bazelisk via MacPorts via sudo port install bazelisk, and then ran

bazel run //explorer -- ./explorer/testdata/print/format_only.carbon

After downloading and building many files this failed.

What did you expect to happen?

n/a

What actually happened?

I see this backtrace:

$ bazel run //explorer -- ./explorer/testdata/print/format_only.carbon
INFO: Invocation ID: 64530060-f9c2-4f52-a62e-63ac93ab4d3e
INFO: Analyzed target //explorer:explorer (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //explorer:explorer up-to-date:
  bazel-bin/explorer/explorer
INFO: Elapsed time: 0.216s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/explorer/explorer ./explorer/testdata/print/format_only.carbon
Please report issues to https://github.com/carbon-language/carbon-lang/issues and include the crash backtrace.
 #0 0x000000010f25abfd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100593bfd)
 #1 0x000000010f25b1cb PrintStackTraceSignalHandler(void*) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1005941cb)
 #2 0x000000010f258456 llvm::sys::RunSignalHandlers() (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100591456)
 #3 0x000000010f25c0cf SignalHandler(int) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1005950cf)
 #4 0x00007ff81298837d (/usr/lib/system/libsystem_platform.dylib+0x7ff80046937d)
 #5 0x000000010f2efe22 llvm::raw_string_ostream::~raw_string_ostream() (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100628e22)
 #6 0x00007ff812878a49 (/usr/lib/system/libsystem_c.dylib+0x7ff800359a49)
 #7 0x000000010f196895 Carbon::Internal::ExitingStream::Done() (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1004cf895)
 #8 0x000000010eccd335 Carbon::Internal::operator|(Carbon::Internal::ExitingStream::Helper, Carbon::Internal::ExitingStream&) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100006335)
 #9 0x000000010f09ff62 Carbon::AddPrelude(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, Carbon::Arena*, std::__1::vector<Carbon::Declaration*, std::__1::allocator<Carbon::Declaration*>>*, int*) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1003d8f62)
#10 0x000000010ece8663 Carbon::ParseAndExecute(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, bool, Carbon::TraceStream*, llvm::raw_ostream*)::$_0::operator()() const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100021663)
#11 0x000000010ece8dd5 decltype(fp()) Carbon::RunWithExtraStack<Carbon::ParseAndExecute(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, bool, Carbon::TraceStream*, llvm::raw_ostream*)::$_0>(Carbon::ParseAndExecute(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, bool, Carbon::TraceStream*, llvm::raw_ostream*)::$_0)::'lambda'()::operator()() const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100021dd5)
#12 0x000000010ece8da5 void llvm::function_ref<void ()>::callback_fn<decltype(fp()) Carbon::RunWithExtraStack<Carbon::ParseAndExecute(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, bool, Carbon::TraceStream*, llvm::raw_ostream*)::$_0>(Carbon::ParseAndExecute(llvm::vfs::FileSystem&, std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, bool, Carbon::TraceStream*, llvm::raw_ostream*)::$_0)::'lambda'()>(long) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100021da5)
#13 0x000000010f09fd29 llvm::function_ref<void ()>::operator()() const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1003d8d29)
#14 0x000000010f09fd07 Carbon::Internal::RunWithExtraStackHelper(llvm::function_ref<void ()>)::$_0::operator()() const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1003d8d07)
#15 0x000000010f09fcc5 void llvm::function_ref<void ()>::callback_fn<Carbon::Internal::RunWithExtraStackHelper(llvm::function_ref<void ()>)::$_0>(long) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1003d8cc5)
#16 0x000000010f09fd29 llvm::function_ref<void ()>::operator()() const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x1003d8d29)
#17 0x000000010f21068c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054968c)
#18 0x000000010f210abf RunSafelyOnThread_Dispatch(void*) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x100549abf)
#19 0x000000010f211464 auto void llvm::thread::GenericThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*)::'lambda'(auto&&, auto&&...)::operator()<void (*&)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*&>(auto&&, auto&&...) const (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a464)
#20 0x000000010f2113f5 decltype(std::declval<auto>()(std::declval<auto>()...)) std::__1::__invoke[abi:ue170006]<void llvm::thread::GenericThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*)::'lambda'(auto&&, auto&&...), void (*&)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*&>(auto&&, auto&&...) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a3f5)
#21 0x000000010f2113be decltype(auto) std::__1::__apply_tuple_impl[abi:ue170006]<void llvm::thread::GenericThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*)::'lambda'(auto&&, auto&&...), std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>&, 0ul, 1ul>(auto&&, std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>&, std::__1::__tuple_indices<0ul, 1ul>) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a3be)
#22 0x000000010f21134d decltype(auto) std::__1::apply[abi:ue170006]<void llvm::thread::GenericThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*)::'lambda'(auto&&, auto&&...), std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>&>(auto&&, std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>&) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a34d)
#23 0x000000010f2112fc void llvm::thread::GenericThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a2fc)
#24 0x000000010f211075 void* llvm::thread::ThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*) (/private/var/tmp/_bazel_eschnett/f97ee0db37df4b24e8b4eac2a7a185dc/execroot/_main/bazel-out/darwin_x86_64-fastbuild/bin/explorer/explorer+0x10054a075)
#25 0x00007ff81295a202 (/usr/lib/system/libsystem_pthread.dylib+0x7ff80043b202)
#26 0x00007ff812955bab (/usr/lib/system/libsystem_pthread.dylib+0x7ff800436bab)
FATAL failure at explorer/syntax/prelude.cpp:22: Failed to parse prelude:
prelude.carbon:0: Error opening file: No such file or directory

Any other information, logs, or outputs that you want to share?

$ uname -a
Darwin redshift.local 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:10 PST 2023; root:xnu-10002.61.3~2/RELEASE_X86_64 x86_64 i386 Darwin

$ port version
Version: 2.8.1

$ port installed bazelisk
The following ports are currently installed:
  bazelisk @1.19.0_0 (active)

eschnett avatar Dec 26 '23 19:12 eschnett