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

Workarounds for Swift runtime memory corruption #1896

Merged
merged 5 commits into from May 6, 2015

Conversation

@jspahrsummers
Copy link
Member

@jspahrsummers jspahrsummers commented Apr 14, 2015

“Fixes” crashes like these, as reported in Carthage/Carthage#368 (comment).

I basically just addressed these with the brute force approach: run until we crash, and then find another way to express the code there. 😕

/cc @robrix @jckarter

Using elements.generate() or elements.values.generate() in any form
results in crashes.
@jspahrsummers jspahrsummers added this to the 3.0 milestone Apr 14, 2015
@jspahrsummers
Copy link
Member Author

@jspahrsummers jspahrsummers commented Apr 14, 2015

Ugh, now the tests are crashing from heap corruption. 😞

Loading

@robrix
Copy link
Contributor

@robrix robrix commented Apr 14, 2015

I’ve found curried function definitions are prone to runtime crashes. Are we using them fairly widely…?

Loading

@jspahrsummers
Copy link
Member Author

@jspahrsummers jspahrsummers commented Apr 16, 2015

@robrix Yeah, they're essential to the functionality of |>.

Loading

Conflicts:
	ReactiveCocoa/Swift/Atomic.swift
@jspahrsummers
Copy link
Member Author

@jspahrsummers jspahrsummers commented Apr 16, 2015

No matter what I fix here, the crash always shifts around. Definitely some sort of corruption issue, and I'm not sure how to work around it. 😩

Loading

@jspahrsummers jspahrsummers changed the title Workarounds for Swift runtime memory corruption [WIP] Workarounds for Swift runtime memory corruption Apr 16, 2015
@robrix
Copy link
Contributor

@robrix robrix commented Apr 16, 2015

@jspahrsummers Right, but what I mean is, sometimes this crashes:

func foo(x: Int)(_ y: Int) -> Int

where this does not:

func foo(x: Int) -> Int -> Int

This seems particularly common when the function has type constraints.

Loading

@jspahrsummers
Copy link
Member Author

@jspahrsummers jspahrsummers commented Apr 20, 2015

Merging from swift-development fixes test crashes, but now the Carthage crash is back. :finnadie:

Loading

@robrix
Copy link
Contributor

@robrix robrix commented May 3, 2015

Curried function syntax is said to be fixed in Xcode 6.4.

Loading

@jspahrsummers jspahrsummers changed the title [WIP] Workarounds for Swift runtime memory corruption Workarounds for Swift runtime memory corruption May 6, 2015
@jspahrsummers
Copy link
Member Author

@jspahrsummers jspahrsummers commented May 6, 2015

Finally had a chance to update this branch and re-test it on Xcode 6.3.1.

It seems to be now, but that's probably more due to @ikesyo's work on other crashes than anything I changed here. 😄

Loading

@robrix
Copy link
Contributor

@robrix robrix commented May 6, 2015

🎉

Loading

}
}

return GeneratorOf(values.generate())
Copy link
Contributor

@robrix robrix May 6, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me so sad!

Loading

Copy link
Contributor

@robrix robrix May 6, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear: this seems like a very good solution. Just a heartbreaking necessity.

Loading

@robrix
Copy link
Contributor

@robrix robrix commented May 6, 2015

I’m 👍 on all of this.

Loading

robrix added a commit that referenced this issue May 6, 2015
Workarounds for Swift runtime memory corruption
@robrix robrix merged commit a01ab1e into swift-development May 6, 2015
@robrix robrix deleted the memory-corruption-workaround branch May 6, 2015
@robrix robrix self-assigned this May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants