Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explorer crashes when a function with auto return type has a __continuation/__run/__await as the only (or last) statement in function body #1257

Closed
pk19604014 opened this issue May 12, 2022 · 0 comments · Fixed by #1258
Assignees

Comments

@pk19604014
Copy link
Contributor

pk19604014 commented May 12, 2022

$ cat /tmp/crash3.carbon 
// Generated by proto_to_carbon.

package EmptyIdentifier impl;

fn EmptyIdentifier() -> auto 
{
   __await;
}

fn Main() -> i32 {
  return 0;
}

$ bazel run explorer:explorer  /tmp/crash3.carbon
INFO: Invocation ID: 90b23507-8256-4849-9f15-0058b33311b7
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.358s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
/usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/optional:911: _LIBCPP_ASSERT 'this->has_value()' failed. optional operator* called on a disengaged value
Please report issues to https://github.com/carbon-language/carbon-lang/issues and include the crash backtrace.
Stack dump:
0.	Program arguments: /usr/local/google/home/pk19604014/.cache/bazel/_bazel_pk19604014/0c0c6d5ac7dde4460fd40f446af91e37/execroot/carbon/bazel-out/k8-fastbuild/bin/explorer/explorer /tmp/crash3.carbon
 #0 0x00005626ebbdea7b backtrace /tmp/llvm-20220302-9880-1faggz0/llvm-project-13.0.1.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:4202:13
 #1 0x00005626ebef71ab llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /proc/self/cwd/external/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:13
 #2 0x00005626ebef744b PrintStackTraceSignalHandler(void*) /proc/self/cwd/external/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
 #3 0x00005626ebef1aa8 llvm::sys::RunSignalHandlers() /proc/self/cwd/external/llvm-project/llvm/lib/Support/Signals.cpp:98:18
 #4 0x00005626ebef89fe SignalHandler(int) /proc/self/cwd/external/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #5 0x00007f3d5f6f3200 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12200)
 #6 0x00007f3d5f39c8a1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:50:1
 #7 0x00007f3d5f386546 abort ./stdlib/abort.c:81:7
 #8 0x00005626ec07200f (/usr/local/google/home/pk19604014/.cache/bazel/_bazel_pk19604014/0c0c6d5ac7dde4460fd40f446af91e37/execroot/carbon/bazel-out/k8-fastbuild/bin/explorer/explorer+0x90900f)
 #9 0x00005626ebc843f2 std::__1::optional<Carbon::Value const*>::operator*() const & /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/optional:911:9
#10 0x00005626ebcd3d1d Carbon::ReturnTerm::static_type() const /proc/self/cwd/./explorer/ast/return_term.h:64:54
#11 0x00005626ebcd7920 Carbon::TypeChecker::DeclareFunctionDeclaration(Carbon::FunctionDeclaration*, Carbon::ImplScope const&) /proc/self/cwd/explorer/interpreter/type_checker.cpp:1729:3
#12 0x00005626ebcde8c2 index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:788:12
#13 0x00005626ebcde8c2 index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1438:59
#14 0x00005626ebcde8c2 __holds_alternative<1UL, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1464:14
#15 0x00005626ebcde8c2 holds_alternative<Carbon::Success, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1470:10
#16 0x00005626ebcde8c2 ok /proc/self/cwd/./common/error.h:61:36
#17 0x00005626ebcde8c2 Carbon::TypeChecker::DeclareDeclaration(Carbon::Declaration*, Carbon::ImplScope&) /proc/self/cwd/explorer/interpreter/type_checker.cpp:2160:7
#18 0x00005626ebceb10b index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:788:12
#19 0x00005626ebceb10b index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1438:59
#20 0x00005626ebceb10b __holds_alternative<1UL, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1464:14
#21 0x00005626ebceb10b holds_alternative<Carbon::Success, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1470:10
#22 0x00005626ebceb10b ok /proc/self/cwd/./common/error.h:61:36
#23 0x00005626ebceb10b Carbon::TypeChecker::TypeCheck(Carbon::AST&) /proc/self/cwd/explorer/interpreter/type_checker.cpp:2078:5
#24 0x00005626ebc6645b ~__tree /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/__tree:1791:11
#25 0x00005626ebc6645b ~set /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/set:619:5
#26 0x00005626ebc6645b ~TypeChecker /proc/self/cwd/./explorer/interpreter/type_checker.h:21:7
#27 0x00005626ebc6645b Carbon::ExecProgram(Carbon::Arena*, Carbon::AST, std::__1::optional<llvm::raw_ostream*>) /proc/self/cwd/explorer/interpreter/exec_program.cpp:46:3
#28 0x00005626ebc58be0 ~AST /proc/self/cwd/./explorer/ast/ast.h:17:8
#29 0x00005626ebc58be0 Carbon::Main(llvm::StringRef, int, char**) /proc/self/cwd/explorer/main.cpp:78:3
#30 0x00005626ebc57bec index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:788:12
#31 0x00005626ebc57bec index /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1438:59
#32 0x00005626ebc57bec __holds_alternative<1UL, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1464:14
#33 0x00005626ebc57bec holds_alternative<Carbon::Success, Carbon::Error, Carbon::Success> /usr/local/google/home/pk19604014/.linuxbrew/Cellar/llvm/13.0.1_1/bin/../include/c++/v1/variant:1470:10
#34 0x00005626ebc57bec ok /proc/self/cwd/./common/error.h:61:36
#35 0x00005626ebc57bec Carbon::ExplorerMain(llvm::StringRef, int, char**) /proc/self/cwd/explorer/main.cpp:88:69
#36 0x00005626ebc57061 main /proc/self/cwd/explorer/main_bin.cpp:0:10
#37 0x00007f3d5f3877fd __libc_start_main ./csu/../csu/libc-start.c:332:16
#38 0x00005626ebba5e5a _start (/usr/local/google/home/pk19604014/.cache/bazel/_bazel_pk19604014/0c0c6d5ac7dde4460fd40f446af91e37/execroot/carbon/bazel-out/k8-fastbuild/bin/explorer/explorer+0x43ce5a)
@pk19604014 pk19604014 self-assigned this May 12, 2022
jonmeow pushed a commit that referenced this issue May 17, 2022
zygoloid pushed a commit that referenced this issue May 26, 2022
For issues #1248, #1249, #1257, #1263
Before the samples were only recorded as fuzzer corpus files which are less 'durable'
chandlerc pushed a commit that referenced this issue Jun 28, 2022
chandlerc pushed a commit that referenced this issue Jun 28, 2022
For issues #1248, #1249, #1257, #1263
Before the samples were only recorded as fuzzer corpus files which are less 'durable'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant