This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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?

Parents
  • 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.

Reply
  • 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.

Children