GNOME Bugzilla – Bug 738231
libxml2 calls srand(time(0))
Last modified: 2014-10-09 15:17:20 UTC
It does that on the first xmlDictCreate() call. That will of course overwrite my own random seed, which I have set earlier via srand(). It was kind of annoying to debug a bigger framework, to find out why the random seed init did not seem to work anymore on a new Ubuntu version. I think that libxml2 should not call srand() at all and it should leave the random seed initialization to the user.
That was set for security reasons. Initialize libxml2 first then. That's a perfectly legal call to be made from a library. You should not expect that nobody else calls srand(), and the man page nowhere states that using srand multiple tim should be avoided, sorry, but no it's needed Daniel