Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Conversation

@rfht
Copy link

@rfht rfht commented Jun 7, 2019

This is a backwards compatibility fix that I propose. Issue identified when trying to run Terraria and throwing the ArgumentException.

Ironically, the function is still called ThrowOrIgnoreBadComparer, but now it only throws.

This patch allows disabling the error on bad comparer implementation by setting the environment variable MONO_IGNORE_BAD_COMPARER. This fixes the error with Terraria, as well as Blueberry Garden on my testing.

The following diff adds a corresponding entry to the man page (as a gist here because it is for code in mono/mono repo): https://gist.github.com/rfht/9c65f7afc8f3ff1a44a8057809dbf1f7

Are there downsides to allowing this simple switch for legacy mono4 applications that used to get by with a bad comparer that I may not have considered?

@rfht
Copy link
Author

rfht commented Jun 7, 2019

Originally brought up with dotnet/corefx who said this should rather be proposed here: https://github.com/dotnet/corefx/issues/38006

@marek-safar
Copy link
Member

I am surprised to see this on Mono only. .NET Framework has same behaviour for 4.5+ version unless Terraria explicitly opt outs which would be very strange because this is programmers issue which could manifest in unexpected results when ignored.

@rfht
Copy link
Author

rfht commented Sep 24, 2019

Any chance for this to go into mono/corert? It is just a switch to allow the potentially problematic behavior for backwards compatibility. There's at least one other game (Blueberry Garden) that exhibits the same error as Terraria, so this would add an option for some backwards compatibility with older code. The man page entry can also clearly state that this should only be used in exceptions.

dotnet/corefx doesn't seem to think it's meaningful to integrate this into .NET:

The compatibility quirk for .NET Framework target framework does not make sense in .NET Core (ie CoreCLR or CoreRT) because of the target framework is never .NET Framework in .NET Core.
(from https://github.com/dotnet/corefx/issues/38006#issuecomment-497338403)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants