Can't delete .exec coverage report files

775 views
Skip to first unread message

ashe.r...@gmail.com

unread,
Aug 8, 2018, 7:17:56 AM8/8/18
to JaCoCo and EclEmma Users
Hi,

Seeing an issue when I'm running jacoco tests through maven.

I run a build, which generates coverage reports - .exec files

When I run mvn clean it fails as it can't delete the generated .exec files. When I look at the .exec file, I can see the owner of the .exec has changed and I don't have access to delete the file anymore.

If I reboot my pc, the .exec file is now accessible again and I can delete it.

Same issue was reported here:
https://issues.jenkins-ci.org/browse/JENKINS-28636

but there doesn't seem to be a solution reported.

Thanks.

Evgeny Mandrikov

unread,
Aug 8, 2018, 8:14:37 AM8/8/18
to JaCoCo and EclEmma Users
Hi,


On Wednesday, August 8, 2018 at 1:17:56 PM UTC+2, Richard Ashe wrote:
Hi,

Seeing an issue when I'm running jacoco tests through maven.

I run a build, which generates coverage reports  - .exec files

When I run mvn clean it fails as it can't delete the generated .exec files. When I look at the .exec file, I can see the owner of the .exec has changed and I don't have access to delete the file anymore.


JaCoCo has no code that explicitly manipulates with owner of created/updated files.
 

If I reboot my pc, the .exec file is now accessible again and I can delete it.


It is strange that reboot affects owner of a file - I'm wondering whether term "owner" is used correctly or you mean something else?

The only thing that JaCoCo agent does - is a standard Java-way of locking file using https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#lock()  to prevent concurrent writes to the same file from different processes.
and so far we are not aware of any problems with this.
Is it possible that your build does not terminate all started JVMs? or does not terminate them gracefully?
Why it is the same? "owner" is not mentioned at all.
Similarly to the resolution status "Cannot Reproduce" of this Jenkins-ticket - how to reproduce this? Which operating system you use? Which file system? Which JVM? Example of build?

Richard Ashe

unread,
Aug 8, 2018, 10:46:38 AM8/8/18
to JaCoCo and EclEmma Users
Hi Evgeny,


On Wednesday, August 8, 2018 at 1:14:37 PM UTC+1, Evgeny Mandrikov wrote:
Hi,

On Wednesday, August 8, 2018 at 1:17:56 PM UTC+2, Richard Ashe wrote:
Hi,

Seeing an issue when I'm running jacoco tests through maven.

I run a build, which generates coverage reports  - .exec files

When I run mvn clean it fails as it can't delete the generated .exec files. When I look at the .exec file, I can see the owner of the .exec has changed and I don't have access to delete the file anymore.


JaCoCo has no code that explicitly manipulates with owner of created/updated files.
 

If I reboot my pc, the .exec file is now accessible again and I can delete it.


It is strange that reboot affects owner of a file - I'm wondering whether term "owner" is used correctly or you mean something else?

No - if I try to view the .exec file permissions and owner, I get an error message saying that only the owner of the file can view these details. Even if I use an admin account, I still can't delete the file as I am no longer the owner. After a reboot, I can delete and access as normal and owner has reverted to me.

The only thing that JaCoCo agent does - is a standard Java-way of locking file using https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#lock()  to prevent concurrent writes to the same file from different processes.
and so far we are not aware of any problems with this.
Is it possible that your build does not terminate all started JVMs? or does not terminate them gracefully?

 

Same issue was reported here:
https://issues.jenkins-ci.org/browse/JENKINS-28636


Why it is the same? "owner" is not mentioned at all.
Its the same result. Jenkins is doing the same thing as maven - i.e. running jacoco and the same file is getting locked down.
 
Similarly to the resolution status "Cannot Reproduce" of this Jenkins-ticket - how to reproduce this? Which operating system you use? Which file system? Which JVM? Example of build?
Its reproducible using maven 3.3.9 on a windows 7 PC. Run a maven clean install which calls jacoco which generates jacoco-ut.exe files. When the build completes, run it again. This time, the clean fails as mvn can;t delete the jacoco-ut.exec file as its locked down. Reboot, run again and this time it works fine. Run the build again and it locks down again.

Marc Hoffmann

unread,
Aug 8, 2018, 11:41:55 AM8/8/18
to jac...@googlegroups.com
Hi,

under what user do you run the process which the JaCoCo agent is attached to? Is it maybe running as a windows service?

Can you provide some more information about the permissions? Who is the owner after creation? Who becomes the owner after reboot?

Some Google hits suggest that this behaviour can be caused by virus scanners.

Regards,
-marc


-- 
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/31b43c5a-80ae-4467-a03d-e5d96e02c521%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Ashe

unread,
Aug 9, 2018, 3:32:20 AM8/9/18
to JaCoCo and EclEmma Users
Hi,

Its run on the command line using a mvn clean install command running with me as the user (local account) 

All files created should have me as the owner, but the .exec files are locked down and I can't determine their owner, even if I switch to using an admin account. 

After reboot I become the owner of the .exec files again.

Thanks,
Richard.

Evgeny Mandrikov

unread,
Aug 9, 2018, 12:29:37 PM8/9/18
to JaCoCo and EclEmma Users
I just downloaded Windows 7 VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
installed JDK 8u181, Maven 3.3.9
and executed "mvn clean install" on the attached simple project
what produced "target/jacoco.exec" - it has correct owner and can be deleted:

win.png


No idea what else we can do.

Questions that you ignored:
Is it possible that some processes hold access to exec-file after execution of Maven?
Antivirus?

Also according to searches in Google by words "owner can't delete windows 7", also seriously doubt that problem is specific to or in JaCoCo.


Regards,
Evgeny
example.zip

Marc Hoffmann

unread,
Aug 9, 2018, 12:42:21 PM8/9/18
to jac...@googlegroups.com
I talked to a colleage today about this issue. This seems to be the typical behavour of virus scanners (or a virus ;).

Can you try to run the test with the scanner disabled or uninstalled?

Regards,
-marc

On 9. Aug 2018, at 18:29, Evgeny Mandrikov <mand...@gmail.com> wrote:

I just downloaded Windows 7 VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
installed JDK 8u181, Maven 3.3.9
and executed "mvn clean install" on the attached simple project
what produced "target/jacoco.exec" - it has correct owner and can be deleted:


For more options, visit https://groups.google.com/d/optout.
<example.zip>
<win.png>

Richard Ashe

unread,
Aug 9, 2018, 3:24:25 PM8/9/18
to jac...@googlegroups.com
Thanks Marc. I’ll try to disable the virus scanner and/or rename the files to use a different extension other than .exec. If it is a virus scanner then it may have a problem with the creation of files that look like .exe files.

Richard Ashe

unread,
Aug 10, 2018, 10:53:37 AM8/10/18
to JaCoCo and EclEmma Users
I renamed each of the coverage report files to .txt instead of .exec and ran the builds again. Same result, so its not down to the generated files having an executable like extension (.exec).

I'm working with our admin to try and get the virus scanner disabled next.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.
<example.zip>
<win.png>

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages