Boost logo

Boost :

Subject: Re: [boost] [interprocess] SHARING_VIOLATION due to antivirus
From: Henrik Sundberg (storangen_at_[hidden])
Date: 2009-08-19 01:40:15

On Wed, Aug 19, 2009 at 6:56 AM, OvermindDL1<overminddl1_at_[hidden]> wrote:
> On Tue, Aug 18, 2009 at 1:09 PM, Lars Hagstrom<lars_at_[hidden]> wrote:
>> I've discovered that there is some unfortunate interaction of
>> boost::interprocess and at least one antivirus product (ESET Nod32). The
>> problem manifests on some installations, and the symptom is that an
>> interprocess_exception with a native error code of 32
>> (ERROR_SHARING_VIOLATION) occurs when a named_semaphore (or other named
>> objects) are opened (well, I've only seen it when opening, but depending on
>> the AV product I guess it may happen when creating as well).
>> Googling a bit on this I found, which
>> suggests that AV products take exclusive locks on files just as a file is
>> being opened, which sometimes upsets calls to CreateFile. What they suggest
>> is doing retries when a sharing violation occurs.

> To me, that sounds like a bug in the AV product, since with the code
> you are only doing what you are supposed to be doing.  If the AV
> itself is acting like a virus and causes bugs like that, it is their
> fault.

Microsoft is quite clear in the article: "When you open a file, you
must always handle a sharing violation in a graceful manner so that
you do not affect the user of the system or cause the system to


Boost list run by bdawes at, gregod at, cpdaniel at, john at