OpenCppCoverage icon indicating copy to clipboard operation
OpenCppCoverage copied to clipboard

Regression "Error: exists: " in 0.9.8

Open amai2012 opened this issue 5 years ago • 9 comments

Before reporting a bug

Please make sure you check the FAQ: https://github.com/OpenCppCoverage/OpenCppCoverage/wiki/FAQ especially if the coverage report is empty.

If your program was compiled with optimized build (release), make sure you use --optimized_build.

Describe the bug Failure during run

[2019-06-27 09:43:56] [error] Error: exists: Das Gerät ist nicht bereit.

: "f:\dd\public\sdk\inc\winnt.h"

Sorry, the message contains a german text, something like "The device is not ready/available"

To Reproduce Happens all my binaries which are created using Visual Studio 2012 SP4/5, x64, non-opztimized debug build.

Upload the log file LastCoverageResults.log. see above

Expected behavior No error :-)

Desktop (please complete the following information):

  • Version of OpenCppCoverage: 0.9.8
  • Architecture (x86/ x64): x64
  • Windows version: Windows Server 2008 R2

Additional context I cannot reproduce that issue on my Windows 10 machines.

amai2012 avatar Jun 27 '19 08:06 amai2012

Hello,

Can you provide LastCoverageResults.log file?

OpenCppCoverage

OpenCppCoverage avatar Jul 02 '19 06:07 OpenCppCoverage

This happens also with other Visual Studio versions under Windows 10 (I tested VS2015 and VS2019 in debug build x64 and x86).

The error seems to be that 0.9.8 tries to open the non-existing f:\dd path which comes from including the standard library. 0.9.7 simply reported that it didn't find the file in the html output.

You can work around this issue by e.g. using the --sources command line switch/setting.

parsd avatar Feb 14 '20 10:02 parsd

Hello,

Thank you for providing more information on this issue.

When running OpenCppCoverage on a VS2015 project, I am able to have in my log: [debug] Filename: f:\dd\externalapis\windows\8.1\sdk\inc\winnt.h is selected because it matches selected pattern: *, but I do not have the drive f: on my computer. I have other examples like [debug] Filename: d:\agent\_work\6\s\src\ExternalAPIs\UnifiedCRT\inc\string.h is selected because it matches selected pattern: * where the drive d: exists but not the agent folder. => In both cases, OpenCppCoverage runs fine.

OpenCppCoverage 0.9.8 uses std::filesystem whereas OpenCppCoverage 0.9.7 uses boost::filesystem so the issue may be related to this change.

Do you have a drive f:? Does it have special rights? Can you provide the file LastCoverageResults.log, ideally when running with --verbose flag?

OpenCppCoverage

OpenCppCoverage avatar Feb 16 '20 21:02 OpenCppCoverage

Hello,

interestingly I didn't see the issue this morning with VS2019, but still with the VS2015 build chain. So my setup is that I only have VS2019 installed with the VS2015 build tools. I also use cmake 3.16.4. And yes: I have an F drive: a DVD drive without a disk. This would explain the "device not ready" message.

I used the following main.cpp for testing:

#include <iostream>

int main()
{
  std::cout << "Hello World\n";
}

and the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.0)
project(hello)

add_executable(hello main.cpp)

The steps to reproduce:

  1. have a powershell session open in the folder with the two files above
  2. mkdir build
  3. cd build
  4. cmake -G "Visual Studio 16 2019" -T "v140" ..
  5. cd ..
  6. cmake --build .\build\ --config Debug
  7. OpenCppCoverage.exe --verbose -- .\build\Debug\hello.exe

The log file: LastCoverageResults.log

I hope that helps. This sure is a curious bug 😉

parsd avatar Feb 17 '20 08:02 parsd

Hello @parsd ,

Thank a lot for your investigation! I reproduced the issue and I will fix it for the next release (std::filesystem::exists throws exception when checking a path pointing to a removable device without volume).

Indeed this is a curious bug 😉

OpenCppCoverage

OpenCppCoverage avatar Feb 23 '20 21:02 OpenCppCoverage

@OpenCppCoverage: and thank you for all your work you are investing here!

parsd avatar Feb 29 '20 20:02 parsd

I am facing the same issue [error] Error: exists: The device is not ready.: "d:\agent\_work\4\s\src\vctools\delayimp\dloadsup.h" while trying to use the OpenCppCoverage extention in VS 2019. Can someone help me with this ?

tanvi-surana avatar May 08 '20 08:05 tanvi-surana

I am facing the same issue [error] Error: exists: The device is not ready.: "d:\agent\_work\4\s\src\vctools\delayimp\dloadsup.h" while trying to use the OpenCppCoverage extention in VS 2019. Can someone help me with this ?

Can the latest version of OpenCppCoverage be made available for VS 2019 ?

tanvi-surana avatar May 08 '20 08:05 tanvi-surana

Fixed in OpenCppCoverage 0.9.9.0.

OpenCppCoverage avatar May 31 '20 19:05 OpenCppCoverage