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

[release/3.0] pal_console: add missing mutex_unlock (#40160)#40191

Merged
danmoseley merged 1 commit intodotnet:release/3.0from
stephentoub:port40160
Aug 9, 2019
Merged

[release/3.0] pal_console: add missing mutex_unlock (#40160)#40191
danmoseley merged 1 commit intodotnet:release/3.0from
stephentoub:port40160

Conversation

@stephentoub
Copy link
Copy Markdown
Member

Port #40160 to release/3.0.
Fixes https://github.com/dotnet/corefx/issues/40137
cc: @danmosemsft, @tmds

Description

Processes on Unix end up sharing a terminal. We have a heuristic which assumes that if a parent process is interacting with the terminal, any child processes it launches won't. As such, when we do Process.Start on Unix, we check if the parent process is currently doing a read (e.g. Console.ReadLine()), and if it is, we avoid doing some configuration of the terminal as part of launching the child. That check is performed under a lock, and we neglect to release that lock when we find it's doing a read.

Customer Impact

Certain patterns would simply hang forever, trying to take a lock that will never be released.

Regression?

Yes, introduced in 3.0 as part of #35621.

Risk

Minimal. It's obvious from a scoped code review that the previous code was wrong.

@stephentoub stephentoub added this to the 3.0 milestone Aug 9, 2019
@danmoseley
Copy link
Copy Markdown
Member

tactics approved, merge when green

@tmds
Copy link
Copy Markdown
Member

tmds commented Aug 9, 2019

Thank you @stephentoub

@danmoseley danmoseley merged commit f7d0a1c into dotnet:release/3.0 Aug 9, 2019
@stephentoub stephentoub deleted the port40160 branch October 23, 2019 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants