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

Projects
None yet
2 participants
@jspahrsummers
Member

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

jspahrsummers added some commits Apr 14, 2015

Long-winded workaround to avoid dictionary generator
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 jspahrsummers referenced this pull request Apr 14, 2015

Merged

Upgrade dependencies #368

4 of 4 tasks complete
@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Apr 14, 2015

Member

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

Member

jspahrsummers commented Apr 14, 2015

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

@robrix

This comment has been minimized.

Show comment
Hide comment
@robrix

robrix Apr 14, 2015

Contributor

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

Contributor

robrix commented Apr 14, 2015

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

@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Apr 16, 2015

Member

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

Member

jspahrsummers commented Apr 16, 2015

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

Merge branch 'swift-development' into memory-corruption-workaround
Conflicts:
	ReactiveCocoa/Swift/Atomic.swift
@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Apr 16, 2015

Member

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. 😩

Member

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. 😩

@jspahrsummers jspahrsummers changed the title from Workarounds for Swift runtime memory corruption to [WIP] Workarounds for Swift runtime memory corruption Apr 16, 2015

@robrix

This comment has been minimized.

Show comment
Hide comment
@robrix

robrix Apr 16, 2015

Contributor

@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.

Contributor

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.

@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers Apr 20, 2015

Member

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

Member

jspahrsummers commented Apr 20, 2015

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

@robrix

This comment has been minimized.

Show comment
Hide comment
@robrix

robrix May 3, 2015

Contributor

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

Contributor

robrix commented May 3, 2015

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

@jspahrsummers jspahrsummers changed the title from [WIP] Workarounds for Swift runtime memory corruption to Workarounds for Swift runtime memory corruption May 6, 2015

@jspahrsummers

This comment has been minimized.

Show comment
Hide comment
@jspahrsummers

jspahrsummers May 6, 2015

Member

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. 😄

Member

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. 😄

@robrix

This comment has been minimized.

Show comment
Hide comment
@robrix

robrix May 6, 2015

Contributor

🎉

Contributor

robrix commented May 6, 2015

🎉

}
}
return GeneratorOf(values.generate())

This comment has been minimized.

@robrix

robrix May 6, 2015

Contributor

This makes me so sad!

@robrix

robrix May 6, 2015

Contributor

This makes me so sad!

This comment has been minimized.

@robrix

robrix May 6, 2015

Contributor

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

@robrix

robrix May 6, 2015

Contributor

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

@robrix

This comment has been minimized.

Show comment
Hide comment
@robrix

robrix May 6, 2015

Contributor

I’m 👍 on all of this.

Contributor

robrix commented May 6, 2015

I’m 👍 on all of this.

robrix added a commit that referenced this pull request May 6, 2015

Merge pull request #1896 from ReactiveCocoa/memory-corruption-workaround
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