Subject: [boost] [interprocess] SHARING_VIOLATION due to antivirus
From: Lars Hagstrom (lars_at_[hidden])
Date: 2009-08-18 15:09:07


Hi,

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 http://support.microsoft.com/kb/316609,
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.

I'm not really saying that this is a boost.interprocess bug, but at
least for me it would be handy if it was a little bit more tolerant
towards AV products.

I've managed (after quite a lot of hard work) to get a test environment
where I can reproduce this quite easily, so I'm more than willing to
help out with testing.

Cheers
Lars