question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 6 Preview 5 for Linux was built with PGO enabled, causing it to litter default.profraw files

See original GitHub issue

On Ubuntu 20.04, using .NET 6 Preview 5 (or Preview 6) is causing default.profraw files to appear all over my project and bogus “LLVM Profile Error” messages to print to my console wherever I run dotnet commands. I don’t normally run .NET Previews on Linux, but I assume this is not expected.

This seems to be occurring because the preview release of the SDK has PGO enabled via Clang’s -fcs-profile-generate option. Ideally this would not be the case for the published preview builds.


I unfortunately cannot inspect the actual contents of the profiles using llvm-profdata show due to a version mismatch. (Manually reading the file’s header in a hex editor suggests they’re from something built with LLVM 9 or older.) However I can infer it’s caused by the .NET Preview because they don’t appear if I disable previews in global.json:

image

In case it matters, I installed the .NET preview using these instructions. Let me know if you need any further details from me!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
agockecommented, Jul 22, 2021

@Redfoggg If you use the tar.gz files instead of the deb/RPMs, those should contain the proper preview binaries.

1reaction
agockecommented, Jul 21, 2021

Found it: this is actually in the runtime build. It looks like packaging debs and rpms is at a separate post-step in publishing.

https://github.com/dotnet/runtime/blob/f399076cb971fcfdab397d8b3786f321acb4b4d5/eng/pipelines/installer/jobs/base-job.yml#L429

The PGO builds disable building the installers, but these steps come along after and crack open the zip file created from earlier. Since this step is included in the PGO build, it’s packaging up the PGO bits and publishing with the exact same name as the non-PGO bits.

When they get published, this creates a race condition where whoever publishes first wins.

Simple fix is to disable this step for PGO, but I’d like to also find some way to prevent the PGO build from building extra things by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing .NET 6 Preview 5
NET SDK feature that enables us to add support for new application types — like mobile and WebAssembly — without increasing the size...
Read more >
Clang++ PGO: empty .profraw - c++
Solved. The problem was that the profiles are generated only in case of a normal exit (return or exit), while in my code...
Read more >
Announcing .NET 8 Preview 6
We're delighted to let you know about the latest features and improvements coming with .NET 8 Preview 6! This release is a continuation...
Read more >
.NET 6 is Here! The Features that will blow your mind
Profile-guided optimization (PGO) is one of the most important capabilities for the vast majority of development platforms that exist today.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found