runtime: Process.MainModule.FileName incorrect with kernel 5.0.0-27-generic (causing MSBuild to be broken)
See https://github.com/dotnet/core/issues/3312 and https://github.com/dotnet/core/issues/3309 .
There are various reports of Process.GetCurrentProcess().MainModule.FileName
returning an incorrect value when running .NET Core inside a container on Ubuntu 19.04 using kernel 5.0.0-27-generic. Reverting back to kernel 5.0.0-25-generic fixes this issue.
The same issue also reproduces on the Azure variant of Ubuntu, with kernel version 5.0.0-1018.
The simplest steps to repro that I know of are in https://github.com/dotnet/core/issues/3309 .
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 35 (23 by maintainers)
Commits related to this issue
- Issue debugging .NET apps in latest kernel version. See this: https://github.com/dotnet/corefx/issues/40850 — committed to pauldotknopf/darch-recipes by pauldotknopf 5 years ago
- Minimal repro for https://github.com/dotnet/corefx/issues/40850 — committed to rainersigwald/didactic-fortnight by rainersigwald 5 years ago
OK, I opened https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1843018 . I hope that’s the right location to report Ubuntu kernel bugs. If anyone knows about a better way of contacting the Ubuntu team, let me know 😃.
We read this from the
/proc/<pid>/maps
file. Using kernel 5.0.0-27-generic on Ubuntu 18.04 in a container, every pathname is/
instead of the mapped file path.5.0.0-25-generic (working):
5.0.0-27-generic (broken):
To those having the mentioned error under their azure vm running Ubuntu: Kernel
5.0.0-1018-azure
is affected as well.5.0.0-1016-azure
works.I enabled the grub timeout following this guide, used the serial console in the azure portal to select the working kernel from the boot menu, and then uninstalled the bad kernel version by calling
apt purge linux-image-5.0.0-1018-azure
andapt purge linux-headers-5.0.0-1018-azure
.The new Linux Kernel 5.0.0-31 on Ubuntu 18.04.3 LTS with HWE enabled fixes the bug for me.
@danmosemsft, @MichaelSimons: Just so you know, I believe this is still an issue on Azure Ubuntu VMs.
For anyone who has the same issue running Docker builds on Azure Hosted Linux agents, switching to Ubuntu 16.04 fixes the issue. ubuntu:latest has this issue in our case since today.
I’ve escalated internally to the folks who own the GitHub Actions images, but don’t yet have anything concrete to share.
I am getting this on @github actions! Building my docker images is now broken using github actions 😕
Im also seeing this issue on
5.0.0-1020-azure
on a Ubuntu 18.04-LTS VM created today so its not fixed yet.Does this mean that this would be broken in all azure VMs created with that image?
No ETA as of yet, but:
5.0.0-1022
, which is currentlyproposed
(still in testing; not recommended for production systems)If someone finds a later version does work, that would be good to share here.
I updated my Ubuntu host (18.04.3 LTS) to kernel version 5.2.17 and now it works!
With these instructions it was very easy! https://www.omgubuntu.co.uk/2017/02/ukuu-easy-way-to-install-mainline-kernel-ubuntu
Google pointed me here after I teared my hairs out when trying to figure out why my GitHub Actions broken. 😦
changed my dockerimage.yml to
runs-on: ubuntu-16.04
temporary solved the problem.Those hitting this issue, please note that the 5.0.0-27-generic kernel (the current Ubuntu kernel) contains a couple of security fixes, see https://usn.ubuntu.com/4114-1/ and https://usn.ubuntu.com/4115-1/. You may want consider that when reverting your kernel.
PS: There’s a “Does this bug affect you?” link at the top of the page (green text, below the but title) that those who are interested can use to upvote this issue in Launchpad.