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-11064] @Published failed to run in playground #4562
Comments
jingham@apple.com (JIRA User), we were just talking about this, right? |
Comment by Jim Ingham (JIRA) This could be the issue where promoting access control to public meant that some property wrapper accessors were expected but hadn't been generated. Davide fixed that in 281c55183302635e543aa646fcc72eb1a134ea00 |
cc @dcci |
I'm not entirely sure this is the same issue, but I'm going to investigate. |
No, this is not the same issue. Reproduces with the REPL on ToT. 1> import Foundation
2> import SwiftUI
3> import Combine
4> @Published var password = ""
5. password = "abcd"
password: String = <computed property>
error: Couldn't lookup symbols:
__lldb_expr_8.(_password in _5548754462C78259F55DA6F04588F7AF) : Combine.Published<Swift.String>
4> @Published var password = ""
password: String = <computed property>
error: Couldn't lookup symbols:
__lldb_expr_10.(_password in _A53E14A5BE650E96AADE0122C9B49D7E) : Combine.Published<Swift.String>
4> password="abcd"
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
Process 8435 stopped
* thread #​1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #​0: 0x0000000000000000
error: memory read failed for 0x0
Target 0: (repl_swift) stopped. |
jingham@apple.com (JIRA User) it looks to me some symbol is missing. You fixed several issues in this area, can you take a look and reassign to me if you find it's not actually the case? |
The integrated REPL instead crashes in the verifier. % ./swift
*** You are running Swift's integrated REPL, ***
*** intended for compiler and stdlib ***
*** development and testing purposes only. ***
*** The full REPL is built as part of LLDB. ***
*** Type ':help' for assistance. ***
(swift) import Foundation
(swift) import SwiftUI
(swift) import Combine
(swift) @Published var password = ""
Combine.Published:3:16: warning: property wrapper's `value` property should be renamed to 'wrappedValue'; use of 'value' is deprecated
public var value: Value { get set }
^
Combine.Published:10:16: warning: property wrapper's `delegateValue` property should be renamed to 'projectedValue'; use of 'delegateValue' is deprecated
public var delegateValue: Published<Value>.Publisher { mutating get }
^
Global is external, but doesn't have external or weak linkage!
[24 x i8]* @"$s6REPL_39_password33_1A982C302490160D9F7355F575D42EA4LL7Combine9PublishedVySSGvp"
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Broken module found, compilation aborted!
Stack dump:
0. Program arguments: /Users/local/swift/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64/bin/swift -frontend -repl -enable-objc-interop -sdk /Applications/Xcode8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name REPL
1. Swift version 5.1-dev (LLVM 8d110eebee, Swift e4989cd749)
2. while processing REPL source:
import Foundation
import SwiftUI
import Combine
@Published var password = ""
0 swift 0x0000000108c7ebc5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x0000000108c7dc08 llvm::sys::RunSignalHandlers() + 248
2 swift 0x0000000108c7f1b8 SignalHandler(int) + 264
3 libsystem_platform.dylib 0x00007fff67fc3b1d _sigtramp + 29
4 libsystem_platform.dylib 0x000000011bd0f9a4 _sigtramp + 3017064100
5 libsystem_c.dylib 0x00007fff67e99a5c abort + 120
6 swift 0x00000001050f16c7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 519
7 swift 0x0000000108bf500b llvm::report_fatal_error(llvm::Twine const&, bool) + 251
8 swift 0x0000000108bf4f0b llvm::report_fatal_error(char const*, bool) + 43
9 swift 0x0000000108ba77a2 (anonymous namespace)::VerifierLegacyPass::doFinalization(llvm::Module&) + 178
10 swift 0x0000000108b33356 llvm::FPPassManager::doFinalization(llvm::Module&) + 54
11 swift 0x0000000108b32ae5 llvm::legacy::FunctionPassManagerImpl::doFinalization(llvm::Module&) + 85
12 swift 0x00000001052390f8 swift::performLLVMOptimizations(swift::IRGenOptions&, llvm::Module*, llvm::TargetMachine*) + 1304
13 swift 0x0000000105239cf0 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 1856
14 swift 0x000000010523d10d performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 2349
15 swift 0x000000010523b5b0 swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 960
16 swift 0x0000000105105dcb REPLEnvironment::executeSwiftSource(llvm::StringRef, 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&) + 827
17 swift 0x0000000105101353 swift::runREPL(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&, bool) + 1795
18 swift 0x00000001050ee723 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 3075
19 swift 0x00000001050ecbe2 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3026
20 swift 0x0000000105094ce9 main + 729
21 libdyld.dylib 0x00007fff67dc3319 start + 1
22 libdyld.dylib 0x0000000000000009 start + 2552483057
zsh: abort ./swift [looking at the same symbol it seems] |
I wonder if it's the same issue. I'll try enabling the verifier in lldb. |
Taking this one for now, there might be something I can do here before handing it off to jingham@apple.com (JIRA User) |
Comment by Jim Ingham (JIRA) @dcci: These aren't the symbols I was looking for... I was working on the symbols that swift uses to mark intermodule dependencies for swift libraries (*swift_FORCE_LOAD$*) which are not related to this issue. |
% ./lldb --repl
Welcome to Swift version 5.1-dev (LLVM 200186e28b, Swift bd21fb4e65).
Type :help for assistance.
1> import SwiftUI
2> import Combine
3> @Published var password = ""
error: repl.swift:3:1: error: property wrappers are not yet supported in top-level code
@Published var password = ""
^ This is invalid swift code. It crashed before because it wasn't checked. |
Environment
Xcode 11 beta 3 on macOS 10.14.5
Additional Detail from JIRA
md5: d3ef06ef609e136f0f8f57dd23c5739e
Issue Description:
Code in a playground:
import Foundation
import SwiftUI
import Combine
@published var password = ""
password = "abcd"
Error Message:
error: Couldn't lookup symbols: __lldb_expr_5.password.getter : Swift.String
The text was updated successfully, but these errors were encountered: