This forum has been archived. Please start a new discussion on GitHub.

UUID patch for Ice 2.0.0

bernard Jupiter, FL
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:

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.