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

BenchmarkDotNet Access Denied Error on WSL2 when Writing to '/mnt/c/DumpStack.log.tmp' #2436

Closed
MeulenG opened this issue Sep 25, 2023 · 10 comments
Assignees
Milestone

Comments

@MeulenG
Copy link

MeulenG commented Sep 25, 2023

When running benchmarks using BenchmarkDotNet on WSL2, I encountered an "Access Denied" error. This error prevents the benchmark from completing successfully. The error is:
Generate Exception: Access to the path '/mnt/c/DumpStack.log.tmp' is denied.

Additional information:

  • Running on Ubuntu 22.04.3 LTS(Jammy Jellyfish) via WSL2.
  • Using BenchmarkDotNet v0.13.8.
  • .NET SDK version 7.0.111.
  • Encountered a warning about running the benchmarks in a DEBUG configuration, but the main concern is the access denied error.`

Logs/output:
err
My understanding is that WSL2 doesn't have permissions to read the Dump Stack logging. Is it possible to make it work on WSL2?

@AndreyAkinshin
Copy link
Member

@MeulenG thanks for the report! Unfortunately, I wasn't able to reproduce the issue. Could you please install BenchmarkDotNet 0.13.9-nightly.20231003.76 from https://www.myget.org/F/benchmarkdotnet/api/v3/index.json , reproduce the problem, and share the new log? (this version reports full stacktrace for this exception).


Related: https://stackoverflow.com/questions/73291475/unable-to-use-benchmarkdotnet-on-wsl2-access-to-the-path-mnt-c-dumpstack-log

@MeulenG
Copy link
Author

MeulenG commented Oct 14, 2023

Hi,

Thank you for your answer! Following your instructions, I've installed version 0.13.9-nightly.20231003.76 from https://www.myget.org/F/benchmarkdotnet/api/v3/index.json as you instructed!

After updating my project, I re-ran my benchmarks and encountered the following output:
logsoutput

I hope this helps, and do tell me if I need to provide more information!

@AndreyAkinshin
Copy link
Member

@MeulenG thanks for the update!

One more question: do you have a solution file (*.sln) that contains your project or do you have a standalone project without a solution?

@AndreyAkinshin AndreyAkinshin self-assigned this Oct 16, 2023
@AndreyAkinshin AndreyAkinshin added this to the v0.13.10 milestone Oct 16, 2023
@AndreyAkinshin
Copy link
Member

@MeulenG I hope that I have fixed the issue. Could you please check if 0.13.10-nightly.20231016.88 works for you?

@MeulenG
Copy link
Author

MeulenG commented Oct 18, 2023

@AndreyAkinshin I have installed the 0.13.10-nightly.20231016.88 version, and I do get one more warning/error? Although, I'm not quite sure if that's a fault on my end? Here is the logs:
loggy
But other than this, it runs and does produce the benchmarks!

@adamsitnik
Copy link
Member

BDN tries to set the process priority to high, when it fails (on Linux it requires to run as root) it prints an error. You can simply ignore it or run as root

@AndreyAkinshin
Copy link
Member

@adamsitnik what do you think about changing this error to a warning? Motivation:

  1. This doesn't prevent benchmarks from running.
  2. This is a typical and expected situation.
  3. A red line in logs starting with "Failed" looks too confusing and frustrating

@MeulenG
Copy link
Author

MeulenG commented Oct 18, 2023

@adamsitnik @AndreyAkinshin Awesome! It works like a charm now. Thanks for all the assistance!

@adamsitnik
Copy link
Member

what do you think about changing this error to a warning?

It's good idea. Moreover we could print it just once, not for every benchmark.

@AndreyAkinshin
Copy link
Member

@adamsitnik I started with adjusting the message severity: e170684

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

No branches or pull requests

3 participants