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

Fix UB warning on OSX #842

Merged
merged 6 commits into from
Jan 9, 2023
Merged

Fix UB warning on OSX #842

merged 6 commits into from
Jan 9, 2023

Conversation

Thomas1664
Copy link
Contributor

@Thomas1664 Thomas1664 commented Dec 27, 2022

Related: microsoft/vcpkg#28582 I suspect this is because we have to use mutexes on OSX because their version of popen isn't threat safe.

Fixes /Users/runner/work/1/s/src/vcpkg/dependencies.cpp:715:47: runtime error: load of value <unknown>, which is not a valid value for type 'vcpkg::UnsupportedPortAction'

Enums are treated as their underlying type (bool in this case) which is not default initialized. Warning is the default value of the enum (supposing the compiler is kind enough to zero initialize it), i.e. false.

@Thomas1664
Copy link
Contributor Author

Confirmed my initial guess: cmd_execute_and_capture_output_parallel takes on OSX 2x longer than on Linux (86 ms on Linux vs. 159 ms on OSX). Unfortunately, we have to keep the mutex (see #695) until OSX fixes their implementation of popen. I didn't report the issue to Apple because I don't know how.

@Thomas1664 Thomas1664 changed the title Investigate slow binary caching performance on OSX Fix UB warning on OSX Jan 5, 2023
@Thomas1664 Thomas1664 marked this pull request as ready for review January 5, 2023 13:34
@BillyONeal BillyONeal merged commit a13a8de into microsoft:main Jan 9, 2023
@BillyONeal
Copy link
Member

Thanks!

@Thomas1664 Thomas1664 deleted the osx-bs-slow branch January 11, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants