Home Patches

UUID patch for Ice 2.0.0

bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
On all platforms except Windows, IceUtil::generateUUID() uses /dev/urandom to generate UUIDs.

Unfortunately concurrent reads to /dev/urandom on Linux (at least up to 2.6.9smp) can return the same value. I posted a test-case on the linux-kernel mailing list that you could use to check /dev/urandom on your OS:
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0411.3/0875.html
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0412.0/1541.html

This bug will be fixed in the next 2.6 release; however until everybody upgrades to a kernel with the fix (which won't be soon) a work-around in IceUtil::generateUUID() is necessary.

You can apply the attached patch on a 2.0.0 distribution as follows:
$ gunzip patch.gz
$ cd $ICE_HOME
$ patch -p0 <~/patch

It changes the generateUUID() implementation, and improves the UUID test.
On Windows, generateUUID() is using the Windows-provided UUID generator, so you don't need this patch.

Cheers,
Bernard

Comments

Sign In or Register to comment.