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

$STATIC$ fields emitted in nondeterministic order #4172

Closed
gafter opened this issue Jul 28, 2015 · 2 comments
Closed

$STATIC$ fields emitted in nondeterministic order #4172

gafter opened this issue Jul 28, 2015 · 2 comments
Labels
Area-Compilers Bug Concept-Determinism The issue involves our ability to support determinism in binaries and PDBs created at build time. Language-VB Resolution-Not Reproducible The described behavior could not be reproduced by developers Verification Not Required
Milestone

Comments

@gafter
Copy link
Member

gafter commented Jul 28, 2015

The VB compiler promotes static local variables to fields of the enclosing type. However, the order in which variables from different methods appear in the output assembly is not deterministic.

We should modify the compiler to ensure they are produced in deterministic order.

@gafter gafter added Bug Language-VB Area-Compilers Concept-Determinism The issue involves our ability to support determinism in binaries and PDBs created at build time. labels Jul 28, 2015
@gafter gafter self-assigned this Jul 28, 2015
@gafter gafter added this to the 1.1 milestone Jul 28, 2015
@gafter
Copy link
Member Author

gafter commented Jul 28, 2015

It appears all synthesized members (methods, properties, and nested types) are emitted in the order in which they were added to their sets internally, which may be nondeterministic. See https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Emit/CommonPEModuleBuilder.cs#L322-L360 and other similar code.

@gafter
Copy link
Member Author

gafter commented Jul 31, 2015

After further research, the source of this issue was an observed nondeterminism in the VS2010 compiler. We have not seen these issues in Roslyn.

@gafter gafter closed this as completed Jul 31, 2015
@gafter gafter added Resolution-Not Reproducible The described behavior could not be reproduced by developers and removed 3 - Working labels Jul 31, 2015
@gafter gafter removed their assignment Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Concept-Determinism The issue involves our ability to support determinism in binaries and PDBs created at build time. Language-VB Resolution-Not Reproducible The described behavior could not be reproduced by developers Verification Not Required
Projects
None yet
Development

No branches or pull requests

1 participant