Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9298] Crash with IOU and Existentials #51769

Closed
palimondo mannequin opened this issue Nov 19, 2018 · 7 comments
Closed

[SR-9298] Crash with IOU and Existentials #51769

palimondo mannequin opened this issue Nov 19, 2018 · 7 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution

Comments

@palimondo
Copy link
Mannequin

palimondo mannequin commented Nov 19, 2018

Previous ID SR-9298
Radar None
Original Reporter @palimondo
Type Bug
Status Closed
Resolution Invalid
Environment

swift master

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, RunTimeCrash
Assignee @aschwaighofer
Priority Medium

md5: becc24754abb11e0ec60755f3f8eca1c

Issue Description:

In the ExistentialPerformance.swift from Swift Benchmark Suite, I'm seeing a runtime crash when releasing IOU Existential. This issue does not occur when I've copied the code into minimal test-case. It appears to be somehow specific to SBS. The code to reproduce the issue is in PR #20666.

The scenario where the bug occurs is described in the comment. To reproduce, clone the PR and uncomment the body in `grabArray` function.

@belkadan
Copy link
Contributor

cc @slavapestov, @mikeash, @eeckstein

@slavapestov
Copy link
Member

IUO does not have a runtime representation so it should be possible to reproduce the issue with a plain Optional.

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented Feb 1, 2019

@slavapestov As I said in the description, this issue wasn't reproducible outside of Swift Benchmarking Suite, even when I have copied the code unchanged. It's a stretch to say it should be reproducible with Optional… Can somebody have a look at this? (I'm hesitant to finish the PR with unresolved issues around benchmark setup overhead this bug is causing.)

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented Feb 7, 2019

This bug is still reproducible by uncommenting the alternative grabArray in the PR #20666 which has been rebased on latest master.

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented Feb 13, 2019

PR #20666 has been merged (the benchmarks were refactored, but remain skipped from the pre-commit performance testing), so it should now be possible for everybody to reproduce this bug on master by uncommenting the alternative versions of grabArray.

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented Feb 13, 2019

cc aschwaighofer@apple.com (JIRA User), @eeckstein

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented May 3, 2019

Ehm. I apologize, am an idiot… there is no bug here. This is crashing on a second sample, when the grabbed array is indeed set to nil, ergo the crash when dereferencing the Optional.

The proper way to get rid of the setup overhead in those benchmarks is to copy the fresh array on each iteration, which also fixes the different amount of work these tests were doing between first and subsequent iterations.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software run-time crash Bug → crash: Swift code crashed during execution
Projects
None yet
Development

No branches or pull requests

3 participants