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

lldb (5.4): const: Assertion `false && "Unhandled node kind"' failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
    • Environment:

      5.4-RELEASE without asserts

      Description

      Repro:

      git clone https://github.com/apple/swift-nio
      cd swift-nio && git reset c51907f551c6b2e4366b5ccbe8c0509b0b061026
      swift build --build-tests
      lldb --batch -o 'break set -f ByteBuffer-core.swift -l 85' -o run -o 'frame variable' -- .build/debug/swift-nioPackageTests.xctest
      

      Result:

      root@1c23930c77ef:/tmp/swift-nio# lldb --batch -o 'break set -f ByteBuffer-core.swift -l 85' -o run -o 'frame variable' -- /tmp/swift-nio/.build/debug/swift-nioPackageTests.xctest
      (lldb) target create "/tmp/swift-nio/.build/debug/swift-nioPackageTests.xctest"
      Current executable set to '/tmp/swift-nio/.build/debug/swift-nioPackageTests.xctest' (x86_64).
      (lldb) break set -f ByteBuffer-core.swift -l 85
      Breakpoint 1: where = swift-nioPackageTests.xctest`NIO.ByteBufferAllocator.init(hookedMalloc: @convention(c) (Swift.Int) -> Swift.Optional<Swift.UnsafeMutableRawPointer>, hookedRealloc: @convention(c) (Swift.Optional<Swift.UnsafeMutableRawPointer>, Swift.Int) -> Swift.Optional<Swift.UnsafeMutableRawPointer>, hookedFree: @convention(c) (Swift.Optional<Swift.UnsafeMutableRawPointer>) -> (), hookedMemcpy: @convention(c) (Swift.UnsafeMutableRawPointer, Swift.UnsafeRawPointer, Swift.Int) -> ()) -> NIO.ByteBufferAllocator + 71 at ByteBuffer-core.swift:85:19, address = 0x0000000000129377
      (lldb) run
      Process 17302 stopped
      * thread #1, name = 'swift-nioPackag', stop reason = breakpoint 1.1
          frame #0: 0x000055555567d377 swift-nioPackageTests.xctest`ByteBufferAllocator.init(hookedMalloc=0x000055555567d230 swift-nioPackageTests.xctest`@objc closure #1 (Swift.Int) -> Swift.Optional<Swift.UnsafeMutableRawPointer> in NIO.ByteBufferAllocator.init() -> NIO.ByteBufferAllocator at <compiler-generated>, hookedRealloc=0x000055555567d280 swift-nioPackageTests.xctest`@objc closure #2 (Swift.Optional<Swift.UnsafeMutableRawPointer>, Swift.Int) -> Swift.Optional<Swift.UnsafeMutableRawPointer> in NIO.ByteBufferAllocator.init() -> NIO.ByteBufferAllocator at <compiler-generated>, hookedFree=0x000055555567d2c0 swift-nioPackageTests.xctest`@objc closure #3 (Swift.Optional<Swift.UnsafeMutableRawPointer>) -> () in NIO.ByteBufferAllocator.init() -> NIO.ByteBufferAllocator at <compiler-generated>, hookedMemcpy=0x000055555567d320 swift-nioPackageTests.xctest`@objc closure #4 (Swift.UnsafeMutableRawPointer, Swift.UnsafeRawPointer, Swift.Int) -> () in NIO.ByteBufferAllocator.init() -> NIO.ByteBufferAllocator at <compiler-generated>) at ByteBuffer-core.swift:85:19
         82  	                  hookedMemcpy: @escaping @convention(c) (UnsafeMutableRawPointer, UnsafeRawPointer, size_t) -> Void) {
         83  	        self.malloc = hookedMalloc
         84  	        self.realloc = hookedRealloc
      -> 85  	        self.free = hookedFree
         86  	        self.memcpy = hookedMemcpy
         87  	    }
         88  	
      Target 0: (swift-nioPackageTests.xctest) stopped.
      
      Process 17302 launched: '/tmp/swift-nio/.build/debug/swift-nioPackageTests.xctest' (x86_64)
      (lldb) frame variable
      lldb: /home/build-user/llvm-project/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp:2988: auto lldb_private::TypeSystemSwiftTypeRef::DumpTypeValue(lldb::opaque_compiler_type_t, lldb_private::Stream *, lldb::Format, const lldb_private::DataExtractor &, lldb::offset_t, size_t, uint32_t, uint32_t, lldb_private::ExecutionContextScope *, bool)::(anonymous class)::operator()() const: Assertion `false && "Unhandled node kind"' failed.
      PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
      Stack dump:
      0.	Program arguments: lldb --batch -o break set -f ByteBuffer-core.swift -l 85 -o run -o frame variable -- /tmp/swift-nio/.build/debug/swift-nioPackageTests.xctest 
      lldb[0x421024]
      lldb[0x41f0ce]
      lldb[0x4214b5]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f2d2cb853c0]
      /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f2d22fc618b]
      /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f2d22fa5859]
      /lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f2d22fa5729]
      /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f2d22fb6f36]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0x141c318)[0x7f2d2491c318]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf8f26a)[0x7f2d2448f26a]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf0c22d)[0x7f2d2440c22d]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xed9ec1)[0x7f2d243d9ec1]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0x12399c3)[0x7f2d247399c3]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xefddcc)[0x7f2d243fddcc]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xefbd09)[0x7f2d243fbd09]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xef8fd9)[0x7f2d243f8fd9]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xef8cb9)[0x7f2d243f8cb9]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xef311f)[0x7f2d243f311f]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xed61a8)[0x7f2d243d61a8]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xef7aab)[0x7f2d243f7aab]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf10d7e)[0x7f2d24410d7e]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf10261)[0x7f2d24410261]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xedfb03)[0x7f2d243dfb03]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0x156c15f)[0x7f2d24a6c15f]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf61477)[0x7f2d24461477]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf574ac)[0x7f2d244574ac]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf5adec)[0x7f2d2445adec]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xea2456)[0x7f2d243a2456]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xe86834)[0x7f2d24386834]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(+0xf5c52d)[0x7f2d2445c52d]
      /tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10(_ZN4lldb10SBDebugger21RunCommandInterpreterERKNS_30SBCommandInterpreterRunOptionsE+0xcd)[0x7f2d2404a85d]
      lldb[0x40a70a]
      lldb[0x40c7af]
      /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f2d22fa70b3]
      lldb[0x40716e]
      ********************
      Crash reproducer for lldb version 10.0.0
      Swift version 5.4 (swift-5.4-RELEASE)
      
      Reproducer written to '/tmp/reproducer-daa782'
      
      Before attaching the reproducer to a bug report:
       - Look at the directory to ensure you're willing to share its content.
       - Make sure the reproducer works by replaying the reproducer.
      
      Replay the reproducer with the following command:
      lldb -replay /tmp/reproducer-daa782
      ********************
      Aborted
      

      Re-ran this

      lldb --batch -o 'log enable lldb types -f /tmp/types.log' -o 'break set -f ByteBuffer-core.swift -l 85' -o run -o 'frame variable' -- .build/debug/swift-nioPackageTests.xctest
      

      the produced /tmp/types.log is attached.

        Attachments

        1. types.log
          238 kB
        2. types-after-hack.log
          26 kB

          Activity

            People

            Assignee:
            augusto2112 Augusto Noronha
            Reporter:
            jw Johannes Weiss
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: