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

Benchmark just stops (Antivirus problem) #364

Closed
KonkLaw opened this issue Feb 19, 2017 · 10 comments
Closed

Benchmark just stops (Antivirus problem) #364

KonkLaw opened this issue Feb 19, 2017 · 10 comments
Labels

Comments

@KonkLaw
Copy link

KonkLaw commented Feb 19, 2017

First of all, thanks for great job.

I've got next problem: sometimes after running benchmark I've been geting this issue:
error
Console benchmark is just stopping with standard system message: "Press any key to continue ...". No exceptions or warnings in console or log file. As I see it doesn't depends on particular test. I really spend a bunch of time trying to find an error on my side. And it seems like I've found out what was wrong.
The thing is, unfortunately, environment where we are running tests is not always depends on us. And I've got one with antivirus which is working on back-back-baground. It simply blocks running test on the halfway. And that's not real problem. Benchmarking with running antivirus is problem of developer. The real problem is that I just see no any errors or warnings at all. Just "Press any key to continue ...". And googling doen't help at all.
I realize that handling antivirus cases may be quite tough call. May be, at least some warning in documentation could help me.

@AndreyAkinshin
Copy link
Member

Hey @KonkLaw, thanks for the report. You are absolutely right, we definitely should print a warning. Any clues how to detect we if have problems with antivirus (btw, may I ask which antivirus do you use)?

@KonkLaw
Copy link
Author

KonkLaw commented Feb 19, 2017

Bitdefender Antivirus Free Edition (updating works)
on Win7 SP1 x64
In some cases antivirus hides gui, but still works (I see it in task manager), so it stops my benchmark with no warnings. If I will run its gui, I will see correspond message ("process is blocked" or like that).

I've prepared small test with bug in my draft repository: https://github.com/KonkLaw/Tests
Also text in log file (bin\Release\BenchmarkDotNet.Artifacts) in faulty cases always is less that output in console.
The interesting fact is that if I run two tests (two methods with attributes, for example in test given above) test ends successfully. But, at least, three methods is enough to get a fault. May be it is connected with log file size.

@AndreyAkinshin AndreyAkinshin changed the title Benchmark just stops Benchmark just stops (Antivirus problem) Feb 26, 2017
@AndreyAkinshin
Copy link
Member

Related issue: #390

@guidmaster
Copy link

Have the same problem. Running in a corp environment means that there is no way to disable AV :(

Getting the error by just running the Getting Started sample.

@adamsitnik
Copy link
Member

Description for people interested in grabbing this issue:

  • We generate, build and run new process for every benchmark
  • Anti Virus is blocking this by default.
  • My suggestion:
    • Detect the situation where our process is immediately killed
    • Print users the warning: Most probably your anti virus has killed benchmarking process. Don't turn off AV, add $BenchmarkCategory to the excludes list
    • Print users the workaround: use InProcessToolchain to avoid new process creation

@eitamal
Copy link

eitamal commented Jun 4, 2017

I had the same issue as in issue #390 , and even though I'm not running in a corporate environment, I was unable to disable my anti-virus and adding the folder to the exclusions list didn't help.

Eventually, I was able to run the benchmark by opening a cmd instance as administrator changing directory to the executable's one and running it from there.

I know this isn't an ideal solution, but maybe it'll help someone else.

@lukasz-pyrzyk
Copy link
Contributor

There is a possibility to list all antivirus software using WMI, however probably it won't work on .NET Core. Need to check it.

What do you think about adding warning about active antivirus to the EnvironmentAnalyzer?

@AndreyAkinshin
Copy link
Member

A warning doesn't solve the problem, but it would be much better than incomprehensible crash. So, PR is welcome.

@lukasz-pyrzyk
Copy link
Contributor

Totally agree, however i don't have enough knowledge about the project so i would like to do it in small steps. Thanks for comment, I will work on the PR

AndreyAkinshin pushed a commit that referenced this issue Aug 1, 2017
* #364 - Detecting antivirus software

* #364 - Printing information about AV only after benchmark failure

* #364 - spaces instead of tab

* #364 - FAQ hint about EnvironmentAnalyser and antivirus detection
@adamsitnik
Copy link
Member

Fixed with #512

alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
* dotnet#364 - Detecting antivirus software

* dotnet#364 - Printing information about AV only after benchmark failure

* dotnet#364 - spaces instead of tab

* dotnet#364 - FAQ hint about EnvironmentAnalyser and antivirus detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants