Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 25, 2021

Backport of #58023 to release/6.0

/cc @lambdageek @uweigand

Customer Impact

Discovered while running ASP.NET Core tests on the S390x port. Kestrel assumes that custom attribute values are reference-equal to string.Empty, not some other empty string value.

Testing

Manual testing and CI

Risk

Very low - code would have to rely on Mono's custom attribute implementation to return fresh string objects to be affected.

@ghost
Copy link

ghost commented Aug 25, 2021

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #58023 to release/6.0

/cc @lambdageek @uweigand

Customer Impact

Testing

Risk

Author: github-actions[bot]
Assignees: -
Labels:

area-VM-meta-mono

Milestone: -

@lambdageek lambdageek added the Servicing-consider Issue for next servicing release review label Aug 25, 2021
@danmoseley
Copy link
Member

Is a unit test infeasible?

And not a new string object that happens to be `""`

Adds a testcase for #58023
@lambdageek
Copy link
Member

lambdageek commented Aug 26, 2021

Added a test. Also in #58197 for main

@lambdageek lambdageek requested a review from marek-safar August 27, 2021 16:25
*out_obj = (MonoObject*)mono_string_new_wtf8_len_checked (p, slen, error);
// Always use string.Empty for empty strings
if (slen == 0)
*out_obj = (MonoObject*)mono_string_empty_internal (mono_domain_get ());
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: wouldn't mono_string_empty_wrapper be better?

Copy link
Member

Choose a reason for hiding this comment

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

that one is marked MONO_RT_EXTERNAL_ONLY so cannot be used in runtime code.

@marek-safar marek-safar removed the Servicing-consider Issue for next servicing release review label Aug 27, 2021
@marek-safar marek-safar merged commit a021027 into release/6.0 Aug 27, 2021
@marek-safar marek-safar deleted the backport/pr-58023-to-release/6.0 branch August 27, 2021 16:47
@ghost ghost locked as resolved and limited conversation to collaborators Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants