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

[release/3.1] Port fix for JIT silent bad code #27972

Merged
merged 2 commits into from
Jan 14, 2020

Conversation

AndyAyersMS
Copy link
Member

@AndyAyersMS AndyAyersMS commented Dec 14, 2019

Release/3.1 port of dotnet/runtime#797.
Fixes dotnet/runtime#764

The jit might incorrectly order a read from a struct field with an operation
that modifies the field, so that the read returns the wrong value.

Customer Impact

Silent bad code; program behaves incorrectly.

Regression?

Yes, introduced during the development 3.0 cycle. 2.x behaves correctly.

Testing

Verified the user's test case now passes; no diffs seen in any existing framework
or test code.

Risk

Low: the jit is now spilling the eval stack entries to temps in cases where it
did not before; this should be conservatively safe.

cc @BruceForstall


If we're appending an assignment whose LHS is is a location within a local
struct, we need to spill all references to that struct from the eval stack.

Update the existing logic for this to handle the case where the LHS is a field
of a local struct, and the field is updated by unusual means (here, initobj).

Fixes dotnet/runtime#764.

Release/3.1 port of dotnet/runtime#797.
Fixes dotnet/runtime#764

The jit might incorrectly order a read from a struct field with an operation
that modifies the field, so that the read returns the wrong value.

Silent bad code; program behaves incorrectly.

Yes, introduced in the 3.0 cycle.

Verified the user's test case now passes; no diffs seen in any existing framework
or test code.

**Low**: the jit is now spilling the eval stack entries to temps in cases where it
did not before; this should be conservatively safe.

cc: @Brucefo

____

If we're appending an assignment whose LHS is is a location within a local
struct, we need to spill all references to that struct from the eval stack.

Update the existing logic for this to handle the case where the LHS is a field
of a local struct, and the field is updated by unusual means (here, `initobj`).

Fixes dotnet/runtime#764.
@AndyAyersMS
Copy link
Member Author

Ah, wrong cc... cc @BruceForstall

@AndyAyersMS
Copy link
Member Author

Arm32 failure seems unrelated:

    JIT/Regression/JitBlue/GitHub_24159/GitHub_24159/GitHub_24159.sh [FAIL]
      Inconsistency detected by ld.so: dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!

@janvorli
Copy link
Member

The arm32 failure was seen in the past: https://github.com/dotnet/coreclr/issues/21504

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Dec 16, 2019
@jeffschwMSFT jeffschwMSFT added this to the 3.1.x milestone Dec 16, 2019
@jamshedd jamshedd added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 7, 2020
@jamshedd
Copy link
Member

jamshedd commented Jan 7, 2020

Approved for Feb.

@vivmishra vivmishra modified the milestones: 3.1.x, 3.1.3 Jan 9, 2020
@vivmishra
Copy link

Moved to Mar as per Tactics. Will need to be explicitly approved for Feb, if required.

@jeffschwMSFT jeffschwMSFT modified the milestones: 3.1.3, 3.1.2 Jan 14, 2020
@jeffschwMSFT
Copy link
Member

Approved for Feb

@Anipik Anipik merged commit 2f99ca8 into dotnet:release/3.1 Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants