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

Fix #4083 - Endpoint receive buffer stack overflow #4089

Merged
merged 2 commits into from Dec 12, 2019
Merged

Fix #4083 - Endpoint receive buffer stack overflow #4089

merged 2 commits into from Dec 12, 2019

Conversation

ghost
Copy link

@ghost ghost commented Dec 11, 2019

The ordering of the 2nd and 3rd parameters for C#'s ConcurrentDictionary.TryUpdate are inverted from Scala's Map.replace.

public bool TryUpdate (TKey key, TValue newValue, TValue comparisonValue); docs

vs

abstract def replace(k: A, oldvalue: B, newvalue: B): Boolean docs

A quick review of the entire Akka.NET code base only shows a few usages of TryUpdate. One in particular appears to have the old and new parameters backwards.

(Scala implementation for reference)
https://github.com/akka/akka/blob/edaea382addc5831ca28beed504d879fcf01cd1a/akka-remote/src/main/scala/akka/remote/Endpoint.scala#L1111-L1114

This appears to be causing #4083

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM - yep, it appears this was a mis-translation due to the C# and Scala APIs being reversed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant