Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Clear the init-locals bit for CoreLib to workaround #1279 #13728

Merged
merged 2 commits into from
Sep 1, 2017

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Aug 31, 2017

No description provided.

@jkotas
Copy link
Member Author

jkotas commented Aug 31, 2017

cc @stephentoub @erozenfeld

int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType);

bool* overrides = stackalloc bool[numVirtuals];
new Span<bool>(overrides, numVirtuals).Clear();
Copy link
Member

Choose a reason for hiding this comment

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

I'd previously tried running all of the corefx tests with that hack to disable init locals, and I'd seen maybe three or four tests fail total... I assume this is the fix for those?

Copy link
Member Author

@jkotas jkotas Aug 31, 2017

Choose a reason for hiding this comment

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

Yes, this place in CoreLib used to depend on stackalloced memory to be zero-initialized. I have just found a second one in TraceLoggingEventSource.cs.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks, Jan.

@jkotas
Copy link
Member Author

jkotas commented Aug 31, 2017

fatal error: error in backend: IO failure on output stream.

@jkotas
Copy link
Member Author

jkotas commented Aug 31, 2017

@dotnet-bot test this please

@jkotas
Copy link
Member Author

jkotas commented Aug 31, 2017

@dotnet-bot test Ubuntu16.04 arm Cross Debug Build please

@jkotas
Copy link
Member Author

jkotas commented Sep 1, 2017

@dotnet-bot test Ubuntu x64 Checked Build and Test please

1 similar comment
@jkotas
Copy link
Member Author

jkotas commented Sep 1, 2017

@dotnet-bot test Ubuntu x64 Checked Build and Test please

Copy link
Member

@erozenfeld erozenfeld left a comment

Choose a reason for hiding this comment

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

LGTM

@jkotas jkotas merged commit 707de9c into dotnet:master Sep 1, 2017
@jkotas jkotas deleted the zeroinit-hack branch September 1, 2017 17:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants