Skip to content

Assertion failure in FilePath.lexicallyNormalized() #283

@jglogan

Description

@jglogan
% swift --version
Apple Swift version 6.2 (swift-6.2-RELEASE)
Target: arm64-apple-macosx26.0
Build config: +assertions

Using swift-system 1.6.3, attached file contains minimal reproducer.

Test code:

import SystemPackage
import Testing

@Test func pathNormalize() throws {
    let path = FilePath("dir/../../../etc/pwned")
    #expect(path.lexicallyNormalized() == "../../etc/pwned")
}
% swift test
[1/1] Planning build
Building for debugging...
[1/1] Write swift-version--2028C2505FF3CBA9.txt
Build complete! (0.13s)
Test Suite 'All tests' started at 2026-01-11 13:48:30.341.
Test Suite 'All tests' passed at 2026-01-11 13:48:30.342.
	 Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
􀟈  Test run started.
􀄵  Testing Library Version: 6.2 (3fdabe5392108d8)
􀄵  Target Platform: arm64-apple-macosx
􀟈  Test pathNormalize() started.
SystemPackage/FilePathParsing.swift:231: Assertion failed
error: Exited with unexpected signal code 5

20260111-lexicalnormalize-bug.tgz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions