Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14186

swiftc doesn't work under qemu-x86-64 emulation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:
      None

      Description

      When running the swift:5.3 docker image which is only available for x86-64 on the M1 Docker for Mac, swiftc crashes immediately.

      Run docker on an M1 Mac as

      docker run -it --rm --privileged  --platform linux/amd64 swift:5.3
      

      then in the container, run swiftc

      root@28b80e055bda:/# swiftc
      Stack dump:
      0.	Program arguments: /usr/bin/swiftc 
      1.	Swift version 5.3.3 (swift-5.3.3-RELEASE)
      /usr/bin/swiftc[0x51fa1c4]
      /usr/bin/swiftc[0x51f7dbe]
      /usr/bin/swiftc[0x51fa49c]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x4000a45980]
      /usr/bin/swiftc[0x192e333]
      /usr/bin/swiftc[0x192735f]
      /usr/bin/swiftc[0x4e9956]
      /usr/bin/swiftc[0x4e8ce8]
      /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x4002247bf7]
      /usr/bin/swiftc[0x4e888a]
      qemu: uncaught target signal 4 (Illegal instruction) - core dumped
      Illegal instruction
      

      symbolised, this roughly is

      root@ea74002d281c:/# swiftc 2>&1 | cut -d '[' -f2 | addr2line -e /usr/bin/swiftc -f -p -a | c++filt
      0x0000000000000000: ?? ??:0
      0x0000000000000000: ?? ??:0
      0x0000000000000001: ?? ??:0
      0x00000000051fa1c4: PrintStackTraceSignalHandler(void*) at Signals.cpp:?
      0x00000000051f7dbe: llvm::sys::RunSignalHandlers() at ??:?
      0x00000000051fa49c: SignalHandler(int) at Signals.cpp:?
      0x0000004000a45980: ?? ??:0
      0x000000000192e333: std::vector<swift::DiagnosticState::Behavior, std::allocator<swift::DiagnosticState::Behavior> >::_M_fill_insert(__gnu_cxx::__normal_iterator<swift::DiagnosticState::Behavior*, std::vector<swift::DiagnosticState::Behavior, std::allocator<swift::DiagnosticState::Behavior> > >, unsigned long, swift::DiagnosticState::Behavior const&) at ??:?
      0x000000000192735f: swift::DiagnosticState::DiagnosticState() at ??:?
      0x00000000004e9956: run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) at driver.cpp:?
      0x00000000004e8ce8: main at ??:?
      0x0000004002247bf7: ?? ??:0
      0x00000000004e888a: _start at ??:?
      0x0000000000000000: ?? ??:0
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jw Johannes Weiss
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: