Git Product home page Git Product logo

Comments (10)

dan-zheng avatar dan-zheng commented on May 5, 2024 1

Thanks for the detail, I'm able to replicate your error!
I couldn't replicate it before because I ran both lines at once, instead of each line individually.

This is a certainly a bug, not sure what the cause is though. Other team members might have a better idea.

from swift.

dan-zheng avatar dan-zheng commented on May 5, 2024

Are you running on Ubuntu 16.04 or 14.04?
I wasn't able to reproduce this on either platform. I tested both the 04-26 and 05-03 pre-built packages.

from swift.

lkhphuc avatar lkhphuc commented on May 5, 2024

It's Ubuntu 16.04.4 LTS. If I compile a simple program with String Interpolation, it finishes without any executable.
I ran this docker container https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/ru0g4A29D8c and the kernel also keep running forever.

from swift.

dan-zheng avatar dan-zheng commented on May 5, 2024

Can you share the exact program you're compiling and the command you're using? Are you using a pre-built package, and if so which version?

from swift.

lkhphuc avatar lkhphuc commented on May 5, 2024

Oh my bad, the comipler for String Interpolaton actually works, only the REPL crashes.

from swift.

dan-zheng avatar dan-zheng commented on May 5, 2024

I'm assuming you're using the package from 04-26, based on the /home/danielzheng path in the error message.

I'm not able to replicate your bug on Ubuntu 16.04.4 LTS:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	16.04
Codename:	xenial

$ usr/bin/swift
Welcome to Swift version 4.2-dev (LLVM 04bdb56f3d, Clang b44dbbdf44). Type :help for assistance.
  1> let amount = 3
  2. let count = "I have \(amount) apples."
amount: Int = 3
count: String = "I have 3 apples."

Can you please share as much info as possible about how you're invoking the REPL? It's difficult to debug otherwise.

from swift.

lkhphuc avatar lkhphuc commented on May 5, 2024

I downloaded the newer built 05-03 and extract and run from it.
Then I invoke the REPL the usual way as described in Usage.md:

usr/bin/swift -Iusr/lib/swift/clang/include
Welcome to Swift version 4.2-dev (LLVM 04bdb56f3d, Clang b44dbbdf44, Swift 2347c83692). Type :help for assistance.
  1> let amount = 3
amount: Int = 3
  2> let count = "I have \(amount) apples"
lldb: /home/swift-build/llvm/lib/IR/Value.cpp:404: void llvm::Value::doRAUW(llvm::Value *, bool): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
Stack dump:
0.      Running pass 'Function Pass Manager' on module 'lldb_module'.
1.      Running pass 'Swift ARC contraction' on function '@"$SSS19stringInterpolationS2Sd_tcfCTf4gd_n"'
[1]    13640 abort (core dumped)  usr/bin/swift -Iusr/lib/swift/clang/include

It's still crashes when I only run usr/bin/swift without the -I flag.

from swift.

dan-zheng avatar dan-zheng commented on May 5, 2024

I tried to test if this is a bug from upstream.

Our last merge from upstream was on 03-12.
Unfortunately, the oldest Ubuntu 16.04 snapshot currently available from https://swift.org/download is from 03-25: https://swift.org/builds/development/ubuntu1604/swift-DEVELOPMENT-SNAPSHOT-2018-03-25-a/swift-DEVELOPMENT-SNAPSHOT-2018-03-25-a-ubuntu16.04.tar.gz.

I tried running it and ran into a different crash:

$ curl https://swift.org/builds/development/ubuntu1604/swift-DEVELOPMENT-SNAPSHOT-2018-03-25-a/swift-DEVELOPMENT-SNAPSHOT-2018-03-25-a-ubuntu16.04.tar.gz -o 03-25.tar.gz
# various output
$ tar xzf 03-25.tar.gz
$ swift-DEVELOPMENT-SNAPSHOT-2018-03-25-a-ubuntu16.04/usr/bin/swift
Welcome to Swift version 4.2-dev (LLVM 95345677bd, Clang 8320c34f23, Swift 82ea1dcd39). Type :help for assistance.
  1> let amount = 3
amount: Int = 3
  2> let count = "I have \(amount) apples"
count: String = {
  _guts = {
    _object = {
      _object = <extracting data from value failed>

    }
    _otherBits = <extracting data from value failed>

  }
}
error: Couldn't lookup symbols:
  Swift.String.init(stringInterpolation: Swift.String...) -> Swift.String
  protocol witness table for Swift.String : Swift.TextOutputStreamable in Swift
  Swift._allocateUninitializedArray<A>(Builtin.Word) -> (Swift.Array<A>, Builtin.RawPointer)
  type metadata for Swift.Int
  Swift.String.init<A where A: Swift.CustomStringConvertible>(stringInterpolationSegment: A) -> Swift.String
  type metadata for Swift.String
  swift_release
  swift_retain
  Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String
  protocol witness table for Swift.Int : Swift.CustomStringConvertible in Swift
  protocol witness table for Swift.String : Swift.CustomStringConvertible in Swift
  Swift.String.init<A where A: Swift.CustomStringConvertible, A: Swift.TextOutputStreamable>(stringInterpolationSegment: A) -> Swift.String

It's possible that the string interpolation bug will get magically fixed when we merge from upstream. It's also possible that the bug occurs because we hard-coded the REPL to run with optimizations (-O), when normally it runs with -Onone.

from swift.

rxwei avatar rxwei commented on May 5, 2024

@dan-zheng Also move this one?

from swift.

dan-zheng avatar dan-zheng commented on May 5, 2024

Moved to SR-7756.

from swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.