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-8285] REPL doesn't like nil with optional unowned/unowned(unsafe) #4365
Comments
Yes, this is clearly a bug. @davezarzycki are you going to work on this or you want us to take a look? |
Comment by Jim Ingham (JIRA) I think this is a general problem with the TOT swift REPL on Linux. OTOH, I have another report of a similar (but not identical) failure in the current TOT linux REPL, OTOH this construct works fine on both the lldb:stable/swift:master branches of lldb and the lldb:upstream-with-swift/swift:master-next branches of lldb. |
For clarity: it seems like there are two bugs here. First, the "Couldn't lookup symbols" noise. And second, the SIGSEGV bug while creating an object with an optional unowned. I'd prefer that this bug be about the latter. Thanks! As to task assignment, the REPL isn't on my critical path and therefore I don't foresee working on this in the short to medium term. Sorry. :-( |
Comment by Jim Ingham (JIRA) But again, neither of these bugs occur on the current TOT swift REPL on macOS. Both expressions run without error and give the expected results. My guess is this is more general (though recently introduced) badness in the Linux Swift REPL. |
Interesting. I rarely test the Linux REPL, but anecdotally speaking, I think it has been broken for a long time. Then again, I never install the built product, and I build/test Swift with the ToT llvm+clang compiler, so maybe I've wandered deep in the weeds. I don't know if this information helps. |
Comment by Jim Ingham (JIRA) There are tests that test basic REPL behavior in the testsuite. We should make sure they are still running on Linux. |
I'm afraid I really can't reproduce this on my Linux machine, David. davide@rad:~/work/build/Ninja-ReleaseAssert/lldb-linux-x86_64/bin$ ./lldb --repl
Welcome to Swift version 4.2-dev (LLVM 748f9878c8, Clang 6c624d9bad, Swift 86c26a9e32). Type :help for assistance.
1> class C { unowned var next : C? }
2> let c = C()
c: C = {
next = nil
} |
FWIW, this is my configuration: uname: uname -a
Linux 4.4.0-45-generic #​66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial To the best of my understanding, you're building with Red hat, which isn't quite a supported (officially) system. Might I ask you to try with Ubuntu? |
I don't have access to an Ubuntu machine. At this point, I'd wager that the issue is not the OS but that I prefer unified builds over the slow "build-script". Let's just close this. Does that work for you? |
Confirmed. The LLDB test suite fails spectacularly with unified builds, but when I try a `build-script` build, only two LLDB tests fail (pull request pending). Let's close this. |
Environment
Red Hat Fedora 28 with top-of-tree clang+llvm+lld as the local compiler.
Additional Detail from JIRA
md5: a18d2d7cf822aa1dc372fa4ad4f2ac14
Issue Description:
Top-of-tree Swift now enables optional types to be used with unowned/unowned(unsafe), but this confuses LLDB:
$ ./bin/swift
Welcome to Swift version 4.2-dev. Type :help for assistance.
1> class C { unowned var next : C? }
error: Couldn't lookup symbols:
swift_allocObject
swift_beginAccess
swift_endAccess
swift_registerTypeMetadataRecords
swift_registerFieldDescriptors
value witness table for Builtin.NativeObject
type metadata accessor for Swift.Optional
swift_deallocClassInstance
swift_unownedRetainStrong
swift_unownedRelease
swift_release
swift_unownedRetain
1> let c = C()
Process 31578 stopped
frame #0: 0x00000000bad0bad0
error: memory read failed for 0xbad0ba00
Target 0: (repl_swift) stopped.
c: C = <extracting data from value failed>
Execution interrupted. Enter code to recover and continue.
Enter LLDB commands to investigate (type :help for assistance.)
2>
The text was updated successfully, but these errors were encountered: