https://bz.apache.org/bugzilla/show_bug.cgi?id=62277

--- Comment #35 from Rainer Jung <[email protected]> ---
And old OpenSolaris code forked e.g. at

https://searchcode.com/codesearch/view/5482758/

indicates, that the 32 bit ftok consist of the lower 8 bits of the id, 12 bits
from the device id and another 12 bits from the ino. So if the files are on the
same file system, the 12 bit device id will not differentiate and we are left
with the lower 8 bit from the id and lower 12 bits from the ino.

Unfortunately when checking the generated ftok numbers, I get the "shmget: File
exists" much more frequent, than I see a real ftok collision! Your collission
check does not trigger, but casting the key to an int sometimes shows
duplicates, but less frequent than the shmget EEXIST error.

I couldn't find anything about shmget() pecularities, but about the ftok() impl
on Solaris one can find:


... ftok() returing a non-unique key is happening very frequently in solaris 10 
update 10.  We have our code working on solaris and other UX OS. We never had
this issue even before on solaris. but as soon as we updated to solaris 10
update10 we 
are seeing this issue. And it happens quite frequently. update 10 seems to make
the symptoms worse. ...

Regards,

Rainer

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to