Crash when previewing TSPL doc locally

docc crashes when trying to preview TSPL doc locally with the following error

Input: /home/xxxx/Desktop/swift-book/TSPL.docc
Template: /home/xxxx/Development/swift/usr/share/docc/render

💣 Program crashed: Illegal instruction at 0x000055c67291b1b6

Thread 0 "docc" crashed:

0 DefaultDiagnosticConsoleFormatter.highlightSource(sourceLine:lineNumber:range:) + 342 in docc at /home/build-user/swift-docc/Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsoleWriter.swift:450:41

OS

xxxx 6.3.0-kali1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.3.7-1kali1 (2023-06-29) x86_64 GNU/Linux

Swift

Swift version 5.9-dev (LLVM df22cff92bb6f9d, Swift fdf50a99df2d1b0)
Target: x86_64-unknown-linux-gnu

Steps to reproduce

  • git clone https://github.com/apple/swift-book
  • cd ./swift-book
  • docc preview TSPL.docc

Thanks for filing a GitHub issue for this. For anyone following along, this looks like a duplicate of another issue. Passing --ide-console-output as one of the flags to docc convert should let you work around this.