Skip to content

[SR-10649] Existential specializer causes leaks #53049

Open
@eeckstein

Description

@eeckstein
Previous ID SR-10649
Radar rdar://problem/50595630
Original Reporter @eeckstein
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @atrick
Priority Medium

md5: 30c18f8f73d5ed5581bb3f22a1b75165

Issue Description:

To reproduce:

  1. Build swift + the benchmarks with leak detection enabled:

utils/build-script --compiler-vendor=apple --skip-ios --skip-tvos --skip-watchos --skip-test-osx --swift-runtime-enable-leak-checker --build-subdir=buildbot_incremental_leaks_RA_R --release --assertions --swift-stdlib-enable-assertions=false

  1. in the swift build directory invoke the leak runner script:

build/buildbot_incremental_leaks_RA_R/swift-macosx-x86_64$ ./bin/Benchmark_RuntimeLeaksRunner

It reports some FAILs.

To run a single benchmark individually (select one of the fails), for example:

build/buildbot_incremental_leaks_RA_R/swift-macosx-x86_64$ ./bin/Benchmark_Onone --num-samples=2 435

It outputs a json with the number of leaked objects: swift_count and objc_count. The numbers must be 0 or equivalent in the last 2 runs. For example, this is a good output:

#,TEST,SAMPLES,MIN(μs),MAX(μs),MEAN(μs),SD(μs),MEDIAN(μs)
{"name":"JSONPerfDecode", "swift_count": 0, "objc_count": 4, "swift_objects": [], "objc_objects": ["__NSPlaceholderArray","__NSPlaceholderDictionary","NSPlaceholderString","NSPlaceholderNumber"]}
{"name":"JSONPerfDecode", "swift_count": 0, "objc_count": 4, "swift_objects": [], "objc_objects": ["__NSPlaceholderArray","__NSPlaceholderDictionary","NSPlaceholderString","NSPlaceholderNumber"]}
{"name":"JSONPerfDecode", "swift_count": 0, "objc_count": 4, "swift_objects": [], "objc_objects": ["__NSPlaceholderArray","__NSPlaceholderDictionary","NSPlaceholderString","NSPlaceholderNumber"]}
435,JSONPerfDecode,2,302,306,304,3,302

A bad output lists all the leaked objects (can be very long).

This leak was triggered by enabling the existential specializer: #19820

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions