-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Description
Previous ID | SR-14372 |
Radar | rdar://problem/75627186 |
Original Reporter | Valérian (JIRA User) |
Type | Bug |
Attachment: Download
Environment
swift latest docker image:
root@docker-desktop:/src# swift --version
Swift version 5.3.3 (swift-5.3.3-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: a86a96cdee395a784a4e78a4985a17ef
Issue Description:
When using with the subdirectory parameter:
Bundle.module.url(forResource: "test", withExtension: "json", subdirectory: "Resources")
under Linux, it will crash with the following fatal error:
Fatal error: Constant strings cannot be deallocated: file Foundation/NSCFString.swift, line 119
You can easily reproduce with the attached project.
docker run --rm --privileged --interactive --tty \
--volume "$(pwd):/src" \
--workdir "/src" \
swift:latest
root@docker-desktop:/src# swift test
[13/13] Linking swift-linux-crash-resourcesPackageTests.xctest
Test Suite 'All tests' started at 2021-03-19 13:18:00.903
Test Suite 'debug.xctest' started at 2021-03-19 13:18:00.904
Test Suite 'swift_linux_crash_resourcesTests' started at 2021-03-19 13:18:00.904
Test Case 'swift_linux_crash_resourcesTests.testExample' started at 2021-03-19 13:18:00.905
Fatal error: Constant strings cannot be deallocated: file Foundation/NSCFString.swift, line 119
Exited with signal code 4
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.