Keil Logo

Sharing violation

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
Alexey Trifonov
Posted
22-Oct-2018 15:11 GMT
Toolset
ARM
New! Sharing violation

Hello,

I am currently using a µvision V5.26.2.0 and sometimes I can't save source file ( h , cpp ).

When it happened the pop ups window showing this message:

"Encountered a sharing violation while accessing {Path to me source file}"

The only one way that can change this behavior is to restart the µvision IDE.

Can I do something else?

Author
Andrew Neil
Posted
22-Oct-2018 15:18 GMT
Toolset
None
New! RE: Sharing violation

So is the file on a shared or networked drive?

Are you trying to access the file simultaneously from other application(s)?

Do you have backup and/or antivirus software running?

Author
Alexey Trifonov
Posted
22-Oct-2018 16:06 GMT
Toolset
None
New! RE: Sharing violation

The project is located on local disk and only µvision IDE accessing the files.

Yes, There is a antivirus software running but it has been running with previous version of

µvision IDE, before I have updated it.

The previous version has worked without pop up windows.

Author
Julian Gerber
Posted
24-Oct-2018 09:33 GMT
Toolset
None
New! RE: Sharing violation

I'm experiencing the same problem with uVision, v5.26.2.0. Also have the files on my local disk, not on my dropbox folder, am not running one drive - only thing that might be accessing it is antivirus (eset NOD32). Once the problem happens, it is impossible to save that file until the IDE is restarted.

Author
Rowland W
Posted
25-Oct-2018 10:55 GMT
Toolset
None
New! RE: Sharing violation

I'm having the same issue, and again using Version 5.26.2.0

I have now activated the "File & Project Handling" setting to Auto save and create a backup files (.BAK). All this is in the Edit/Configuration/...

I'm hoping that the backup file will help..... I have yet to determine if this is the case.

Is this a recognised bug with uVersion / arm?

Regards, R.

Author
K N
Posted
25-Oct-2018 17:30 GMT
Toolset
None
New! RE: Sharing violation

I have the same problem with my header file using MDK 5.26.2.0.
Unless SOMEBODY submit the service ticket with active maintenance service, Keil (Arm) will not consider these issues seriously.
(I tried to talk with their chatbot but they do not take any action.)

Author
Kevin From Support
Posted
25-Oct-2018 20:27 GMT
Toolset
None
New! RE: Sharing violation

Hello Rowland,

I have seen some random reports of a similar issue coming in, but we still can't reproduce it. Every instance seems to be slightly different setup.

We assume that the PC is running some other processes in the background e.g. Virus Scanner, Windows Indexing Service, Software Version Control Systems, Onedrive. etc. - that may be causing a conflict.

If you could duplicate this issue in an acceptable time frame, we would be happy if you could make some tests with the Process Monitor from Sysinternals/Microsoft. You could add a filter to a folder where your header files are located (Filter: Path contains .... then Include). You could then start the recording, work with uVision and as soon as the problem shows up, you stop the recording and note the header file name which was reported in the error message. Then you could store the recording, create a support ticket and send it to us.

Author
rowland w
Posted
29-Oct-2018 13:18 GMT
Toolset
None
New! RE: Sharing violation

Kevin,

I have managed to capture the Sharing Violation error and had Sysinterals running.

So, I have a couple of files that may be of interest....

I've managed to compress one of the files to 12Mb, which I may be able to email...

Regards,

Rowland

Author
rowland w
Posted
31-Oct-2018 10:16 GMT
Toolset
None
New! RE: Sharing violation

Dear Kevin From Support,

Do you want these SysInternals log files?

Regards,

Rowland

Author
Adam Lins
Posted
6-Nov-2018 23:43 GMT
Toolset
ARM
New! RE: Sharing violation

I've seen these sharing violations since upgrading to uVision 5.26.2. I'm running a Windows 10 machine with Trend Micro antivirus, which is managed centrally.

I ran Process Monitor. It seems to show a sharing violation between uv4.exe and tmbmsrv.exe.

3:23:27.3855127 PM   UV4.exe       2832   QueryNetworkOpenInformationFile   C:\Users\u100137\path\to\file.h   SUCCESS             CreationTime: 10/10/2018 8:39:57 AM, LastAccessTime: 10/11/2018 12:38:53 PM, LastWriteTime: 11/6/2018 12:33:02 PM, ChangeTime: 11/6/2018 12:33:02 PM, AllocationSize: 32768, EndOfFile: 31682, FileAttributes: A
3:23:27.3855278 PM   UV4.exe       2832   CloseFile                         C:\Users\u100137\path\to\file.h   SUCCESS
3:23:27.3857638 PM   UV4.exe       2832   CreateFile                        C:\Users\u100137\path\to\file.h   SHARING VIOLATION   Desired Access: Generic Write, Read Attributes, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: None, AllocationSize: n/a
3:23:27.3860568 PM   TMBMSRV.exe   6288   CreateFile                        C:\Users\u100137\path\to\file.h   SUCCESS             Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
3:23:27.3860897 PM   TMBMSRV.exe   6288   QueryNetworkOpenInformationFile   C:\Users\u100137\path\to\file.h   SUCCESS             CreationTime: 10/10/2018 8:39:57 AM, LastAccessTime: 10/11/2018 12:38:53 PM, LastWriteTime: 11/6/2018 12:33:02 PM, ChangeTime: 11/6/2018 12:33:02 PM, AllocationSize: 32768, EndOfFile: 31682, FileAttributes: A
3:23:27.3861051 PM   TMBMSRV.exe   6288   CloseFile                         C:\Users\u100137\path\to\file.h   SUCCESS
Author
Rowland w
Posted
7-Nov-2018 10:43 GMT
Toolset
ARM
New! RE: Sharing violation

Adam,

Have you managed to disable: tmbmsrv.exe and prove that the sharing issue is resolved?

I have Trend Micro antivirus, which is managed centrally too.

Regards,

Rowland

Author
Adam Lins
Posted
7-Nov-2018 17:11 GMT
Toolset
ARM
New! RE: Sharing violation

I don't have the ability to disable TrendMicro, even for a short period. I tried killing it from Task Manager and that didn't work. I could try one of the SysInternals tools to really zap it. I suspect it would respawn pretty quickly.

From some of the other comments in this thread, Keil is aware and has a support ticket open. I'm hoping for a fix soon. I think I can always fall back to editing outside Keil, and build/debug in Keil while I wait for the fix.

Author
Ron Wedge
Posted
25-Oct-2018 20:20 GMT
Toolset
ARM
New! RE: Sharing violation

Hello Alexey,

I am trying to get a feel for your environment.

I assume this is Windows10 OS, and that your Keil tools are installed in the c:\keil_v5\ folder

- Are you using the latest version of windows 10?
- Are you sharing the computer with another user? Could they be logged into the same machine?
- Are you using Microsoft System Center Endpoint Protection aka Windows Defender as your anti-virus tool?

It would be good to know what is locking the file. There are 3 methods I've tried, and sometimes one uncovers something the others don't/

* Use the built-in Resource Monitor: https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-
windows

* Use Powershell: https://gallery.technet.microsoft.com/How-to-find-out-which-c0d4e60e
(to open powershell https://www.isunshare.com/windows-10/5-ways-to-open-windows-powershell-in-windows-10.html)

* Use Process Explorer: https://blogs.technet.microsoft.com/markrussinovich/2005/04/24/the-case-of-the-mysterious-locked-file/

... Once you figure out who is locking the file (probably an antivirus program) you can take steps to stop it, like in https://support.microsoft.com/en-us/help/4028485/windows-10-add-an-exclusion-to-windows-security

=====

In the Keil µVision IDE, under "Edit-> Configuration", on the "Editor" tab, on the middle-right of the dialog, under "File and Project Handling" do you have any check boxes set? You can read about these settings here:

http://www.keil.com/support/man/docs/uv4/uv4_dg_editsettings.htm

Maybe a setting there is causing issues.

Author
Alexey Trifonov
Posted
26-Oct-2018 10:38 GMT
Toolset
ARM
New! RE: Sharing violation

Hello Ron,

Thank you for your assistance.

1. The "File and Project Handling" section is unchecked. ( as a default )
2. I am using a Windows 7 Enterprise version.
3. The Keil is installed in the C:\Keil_v5.
4. The source code is on drive D: ( Local drive , shrink partition ).
5. This is a Laptop and only I log in.
6. I am not using the "Microsoft System Center Endpoint Protection".
7. The anti-virus is Trend Micro.

This issue is an internal bug I guess so.

The reason why I am thinking so,

There is only one way to improve this behavior and is to restart an application ( Keil ).

I will try to understand the sequence of my usage that leads an issue.

Author
Andrew Neil
Posted
26-Oct-2018 11:01 GMT
Toolset
ARM
New! RE: This issue is an internal bug I guess so

Just more guessing, but:

* That the file gets locked may be nothing to do with Keil;

* That uVision does not recover after it's happened possibly (probably?) is to do with Keil.

Author
Alexey Trifonov
Posted
26-Oct-2018 11:33 GMT
Toolset
ARM
New! RE: This issue is an internal bug I guess so

And maybe one important thought, when it is locked in a Keil and I can't save the file.

I can do it in a standard editor, edit, save and the Keil allows to import changes event it has locked.

Author
Westonsupermare Pier
Posted
26-Oct-2018 21:38 GMT
Toolset
ARM
New! RE: This issue is an internal bug I guess so

Observed this here today, the IDE is holding the share, closing the project is not sufficient to clear this. Closing the tool down and restarting, and loading the project then worked.

File is not shared on a network, file is not open for view/mapped in any other application.

Got a resource leak here guys...

Author
Westonsupermare Pier
Posted
26-Oct-2018 21:48 GMT
Toolset
ARM
New! RE: This issue is an internal bug I guess so

Some additional info if it helps

uV 5.26 pre install
Win7 64-bit, QC Xeon, 16 GB RAM

Occurred after enabling browse information and rebuilding, a couple of build cycles ago, bit slow otherwise.

File in question will cause very large change in dependency tree, perhaps background syntax checking of all files in project and library. stm32l4xx_hal_conf.h

Doing a quick edit, and rebuild.

Author
Werner Meier
Posted
29-Oct-2018 05:05 GMT
Toolset
ARM
New! RE: Sharing violation

Same sharing problem with me. Only observed it since about 1 month. In one environment at work, local folder is observed by GitHub, on other environment it's on a dropbox folder. (I used to work on dropbox folders for about 2 years, never happened)
Only *.h files seem to be affected. The IDE shows the latest edited version but trying to save it, pops this message. I can copy the content, create a new file, save it,then restart IDE. Otherwise all editing is lost.

Author
Werner Meier
Posted
7-Nov-2018 13:29 GMT
Toolset
ARM
New! RE: Sharing violation

for about a week I did not have the issue anymore..
Vague Theory: Micro Soft patch started sharing problem, now with another patch it disappeared?

Author
Werner Meier
Posted
7-Nov-2018 15:29 GMT
Toolset
ARM
New! RE: Sharing violation

ups, happened again.. so vague theory is false :)

Author
artnect
Posted
29-Oct-2018 19:54 GMT
Toolset
ARM
New! RE: Sharing violation

have you tried opening uvision as admin ?

click on uvision exe file and ---> properties -->compatibility----> run this program as administrator

Author
Jeff Cesnik
Posted
30-Oct-2018 16:45 GMT
Toolset
ARM
New! RE: Sharing violation

Experiencing the same issue. Windows 10, uVision 5.26.2.0, only .h files affected. Running as admin seems to fix it, at least I haven't experienced it again (yet)...

Author
Rowland W
Posted
30-Oct-2018 16:58 GMT
Toolset
ARM
New! RE: Sharing violation

Same situation, I have tried running under Admin, but this did not solve the problem.

Regards, R.

Author
Westonsupermare Pier
Posted
31-Oct-2018 00:29 GMT
Toolset
ARM
New! RE: Sharing violation

Restarting the application makes it go away, because Windows closes all handles owned by the application/task as it tears it down.

The issue is the app fails to CloseHandle() on the file, likely a Mapped View, and owned by the Pager, perhaps a premature exit of a function which might otherwise have closed it.

Don't think Admin makes much difference in this, as it's effectively owned by the Kernel.

Would agree it is mostly likely to be seen in .H due to the dependency changes those would make.

Other theory is task doing dependency checking wins race condition with task saving file.

Author
Carsten Groen
Posted
7-Nov-2018 13:59 GMT
Toolset
ARM
New! RE: Sharing violation

I have reported this to support. They are working on it (they already had a case opened with the problem). I will get a notice from them once they figure this out
I can also confirm that running in admin has no change. I have also just changed my development PC a week ago, the problem also occurs on this fresh installation (all files/projects are local disk, no SVN etc etc)

Author
Rowland w
Posted
7-Nov-2018 14:03 GMT
Toolset
ARM
New! RE: Sharing violation

Afternoon Carsten,

Do you have Trend Micro antivirus installed and tmbmsrv.exe running?

Regards,

Rowland

Author
Carsten Groen
Posted
7-Nov-2018 14:07 GMT
Toolset
ARM
New! RE: Sharing violation

Rowland,
nope, none of them. In fact, the workstation right now is just a basic Win10 installation, nothing fancy (yet)

Author
Westonsupermare Pier
Posted
7-Nov-2018 21:42 GMT
Toolset
ARM
New! RE: Sharing violation

I'm not using Tread Micro, this is a self-induced resource leak, or race condition.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.