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

JIT: some jumps based on uninitialized values detected by valgrind #46961

Closed
BruceForstall opened this issue Jan 14, 2021 · 0 comments · Fixed by #46965
Closed

JIT: some jumps based on uninitialized values detected by valgrind #46961

BruceForstall opened this issue Jan 14, 2021 · 0 comments · Fixed by #46965
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@BruceForstall
Copy link
Member

From @tmds, #46905

I ran valgrind on dotnet hello world, and it pointed out a few jumps based on uninitialized values.

  1. LinearScan::buildIntervals() (src/coreclr/jit/lsrabuild.cpp:2320)

if (firstColdLoc == MaxLocation)

It looks like firstColdLoc is only initialized in DEBUG. Probably it should be also set to MaxLocation in release?

#ifdef DEBUG
maxNodeLocation = 0;
firstColdLoc = MaxLocation;

  1. FindConstReturnBlock (src/coreclr/jit/flowgraph.cpp:9189)

if (returnConstants[i] == constVal)

returnConstants[i] is not initialized. I don't know what the best place is to initialize it.

  1. CodeGen::instGen(instruction) (src/coreclr/jit/instr.cpp:200)

if (ins == INS_lock && GetEmitter()->emitNextNop == 0)

emitNextNop initialization is tied to PSEUDORANDOM_NOP_INSERTION, so this check should probably #ifdef PSEUDORANDOM_NOP_INSERTION?

@BruceForstall BruceForstall added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 14, 2021
@BruceForstall BruceForstall added this to the 6.0.0 milestone Jan 14, 2021
@BruceForstall BruceForstall self-assigned this Jan 14, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jan 14, 2021
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label Jan 14, 2021
BruceForstall added a commit to BruceForstall/runtime that referenced this issue Jan 14, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jan 14, 2021
BruceForstall added a commit that referenced this issue Jan 15, 2021
* Fix uses of uninitialized data

Fixes #46961

* Fix typo

* Formatting
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jan 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant