Skip to content

Crash when recording issue with empty comment #1107

@mbrandonw

Description

@mbrandonw

Description

It is possible to record an issue in such a way that causes the test suite to crash.

Reproduction

Create a new SPM package with tests and add the following to the test file:

import Testing
@Test func foo() {
  Issue.record("")
}
% swift test
Building for debugging...
[1/1] Write swift-version--1D5B3FA68580FA98.txt
Build complete! (0.16s)
Test Suite 'All tests' started at 2025-05-07 10:23:40.385.
Test Suite 'All tests' passed at 2025-05-07 10:23:40.386.
	 Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
􀟈  Test run started.
􀄵  Testing Library Version: 124
􀄵  Target Platform: arm64e-apple-macos14.0
􀟈  Test foo() started.
error: Exited with unexpected signal code 5

Expected behavior

An issue should be recorded with an empty comment.

Environment

swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Darwin 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6000 arm64

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🪲 Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions