dynamobi/dynamobi — Issue #490: [FNL-18] PseudoUuid is broken for non-libuuid systems
Author: dynamobi-build
Created: 2011-12-30 03:29:28+00:00
State: open
Labels: Common, FNL

[reporter="johnk", created="Tue, 14 Feb 2006 15:48:00 -0500 (GMT-05:00)"]
PseudoUuid's fallback mode if libuuid (rather uuid/uuid.h) is not found at initBuild time is to call rand() to generate new UUIDs. This effectively generates the same UUID sequence after each restart, as srand() is not called anywhere from within Fennel. (Not calling srand() first is the same as calling srand(1)).

Calling srand(time(NULL)) in a library like Fennel seems rude.

(Calling rand() w/o thread protection is also a bit iffy too.)

Perhaps the fallback mode should be removed, and it should simply throw an exception -- allowing fennel to be built, but UUID-dependent features (if any?) will fail. This suggestion may be nonsense.