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

[SR-14104] Crash with async mutating method #56490

Open
natecook1000 opened this issue Jan 25, 2021 · 1 comment
Open

[SR-14104] Crash with async mutating method #56490

natecook1000 opened this issue Jan 25, 2021 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself concurrency Feature: umbrella label for concurrency language features

Comments

@natecook1000
Copy link
Member

Previous ID SR-14104
Radar rdar://problem/73742483
Original Reporter @natecook1000
Type Bug

Attachment: Download

Environment

Apple Swift version 5.4-dev (LLVM a9b8270, Swift 1d7d282)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Concurrency
Assignee None
Priority Medium

md5: 93a61161cf78cb58214c3dcfe2ba629f

Issue Description:

Assertion failed: (value == expected), function operator(), file /Users/buildnode/jenkins/workspace/oss-swift-package-macos/swift/lib/IRGen/GenProto.cpp, line 2739.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2021-01-19-a.xctoolchain/usr/bin/swift-frontend -frontend -interpret /Users/nate/Desktop/mutating-extension.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -color-diagnostics -enable-experimental-concurrency -target-sdk-version 11.0 -module-name main

  1. Apple Swift version 5.4-dev (LLVM a9b8270, Swift 1d7d282)
  2. While running user code "/Users/nate/Desktop/mutating-extension.swift"
  3. While evaluating request IRGenRequest(IR Generation for module main)
  4. While emitting IR SIL function "@$s4mainyyYcfU_SiyYcfu_".
    for expression at [/Users/nate/Desktop/mutating-extension.swift:11:19 - line:19:3] RangeText="numbers.withAsyncUnsafeMutableBuffer { buffer -> Int in
    var sum = 0
    for i in buffer.indices {
    sleep(1)
    defer
    { buffer[i] += sum }
    sum += buffer[i]
    }
    return sum
    "
    0 swift-frontend 0x000000010cc1b9b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
    1 swift-frontend 0x000000010cc1ac15 llvm::sys::RunSignalHandlers() + 85
    2 swift-frontend 0x000000010cc1bf86 SignalHandler(int) + 262
    3 libsystem_platform.dylib 0x00007fff204d4d7d _sigtramp + 29
    4 swift-frontend 0x000000010f7e9e92 cmark_strbuf__initbuf + 204605
    5 libsystem_c.dylib 0x00007fff203e2720 abort + 120
    6 libsystem_c.dylib 0x00007fff203e19d6 err + 0
    7 swift-frontend 0x000000010cd50f13 llvm::Value* llvm::function_ref<llvm::Value* (swift::irgen::GenericRequirement)>::callback_fn<void save<swift::irgen::NecessaryBindings::save(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Explosion&) const::$_5>(swift::irgen::NecessaryBindings const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::NecessaryBindings::save(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Explosion&) const::$_5)::'lambda'(swift::irgen::GenericRequirement)>(long, swift::irgen::GenericRequirement) (.cold.1) + 35
    8 swift-frontend 0x00000001086ffbdb llvm::Value* llvm::function_ref<llvm::Value* (swift::irgen::GenericRequirement)>::callback_fn<void save<swift::irgen::NecessaryBindings::save(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Explosion&) const::$_5>(swift::irgen::NecessaryBindings const&, swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::NecessaryBindings::save(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Explosion&) const::$_5)::'lambda'(swift::irgen::GenericRequirement)>(long, swift::irgen::GenericRequirement) + 123
    9 swift-frontend 0x00000001086f8ce9 swift::irgen::emitInitOfGenericRequirementsBuffer(swift::irgen::IRGenFunction&, llvm::ArrayRef<swift::irgen::GenericRequirement>, swift::irgen::Address, llvm::function_ref<llvm::Value* (swift::irgen::GenericRequirement)>) + 217
    10 swift-frontend 0x00000001086f7702 swift::irgen::NecessaryBindings::save(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::irgen::Explosion&) const + 114
    11 swift-frontend 0x000000010861d83c (anonymous namespace)::AsyncCallEmission::setArgs(swift::irgen::Explosion&, bool, swift::irgen::WitnessMetadata*) + 2860
    12 swift-frontend 0x0000000108793f7e (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 3246
    13 swift-frontend 0x0000000108778a7f (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 7983
    14 swift-frontend 0x00000001087765f3 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1523
    15 swift-frontend 0x00000001086511db swift::irgen::IRGenerator::emitLazyDefinitions() + 1819
    16 swift-frontend 0x000000010873afd7 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2263
    17 swift-frontend 0x0000000108775c4d swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 157
    18 swift-frontend 0x0000000108775b6e swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 14
    19 swift-frontend 0x0000000108746af8 llvm::Expected<swift::IRGenRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenRequest>(swift::IRGenRequest const&) + 408
    20 swift-frontend 0x000000010873c190 swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::_1::unique_ptr<swift::SILModule, std::1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> > >, llvm::GlobalVariable**) + 576
    21 swift-frontend 0x000000010849965d swift::RunImmediately(swift::CompilerInstance&, std::_1::vector<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> >, std::1::allocator<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char> > > > const&, swift::IRGenOptions const&, swift::SILOptions const&, std::1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >&&) + 349
    22 swift-frontend 0x0000000108461711 performCompileStepsPostSILGen(swift::CompilerInstance&, std::_1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1953
    23 swift-frontend 0x0000000108460d4c performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 636
    24 swift-frontend 0x0000000108455978 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5224
    25 swift-frontend 0x00000001083f1c32 main + 866
    26 libdyld.dylib 0x00007fff204ab591 start + 1
    27 libdyld.dylib 0x000000000000000d start + 18446603339974396541
    fish: '/Library/Developer/Toolchains/s...' terminated by signal SIGABRT (Abort)
@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

2 participants