Skip to content
This repository was 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
jkotas merged 2 commits into
dotnet:masterfrom
jkotas:zeroinit-hack
Sep 1, 2017
Merged

Clear the init-locals bit for CoreLib to workaround #1279#13728
jkotas merged 2 commits into
dotnet:masterfrom
jkotas:zeroinit-hack

Conversation

@jkotas
Copy link
Copy Markdown
Member

@jkotas jkotas commented Aug 31, 2017

No description provided.

@jkotas
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

jkotas commented Aug 31, 2017

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

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Aug 31, 2017

@dotnet-bot test this please

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Aug 31, 2017

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

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Sep 1, 2017

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

1 similar comment
@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Sep 1, 2017

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

Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

4 participants