[xmlsec] Init Shutdown episode 2

steve mackley stvmackley at yahoo.com
Wed Mar 16 08:08:37 PST 2005

If latter on I'll try to use xmlsec in my program, I  
will probably call the xmlsec_init and xmlsec_shutdown
several time. In fact I initalise a process and then
fork it, but in some case, I may need to init,
release, init the lib.

For these reason I did the following test :
 for(i=0; i<100; i++) {
  if(init_xmlsec() != 0) {
      fprintf(stderr,"Init failed\n");
    } else {
      fprintf(stderr,"Init Succeed\n");
    if(shutdown_xmlsec() != 0) {
      fprintf(stderr,"Shutdown failed\n");
    } else {
      fprintf(stderr,"Shutdown Succeed\n");

These functions have the code copied from 

After one successfull round (1 init, 1shutdown) that's
crach, here after my log.
Start Test
Init Succeed
Shutdown Succeed
Init Succeed
*** glibc detected *** double free or corruption
(fasttop): 0x08339288 ***
Aborted (core dumped)

Is it a bad pratice to init and shutdown several time
the lib. I do know that a little bit ....

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the xmlsec mailing list