Initialization/finalization of libxml2 in wrong place
-----------------------------------------------------

                 Key: AXIS2C-1539
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1539
             Project: Axis2-C
          Issue Type: Bug
          Components: core/clientapi, xml/parser
    Affects Versions: 1.6.0
         Environment: Windows XP SP2
            Reporter: Halewijn Geerts


Initialization of libxml2 is done in axis2_op_client_create and finalization in 
axis2_op_client_free. So if you have generated stub code, this initializing 
will be done for each stub operation, and finalizes when stub is freed. If 
another part of the application uses libxml2, then that code can crash, because 
libxml2 is already freed by axis2/c

Documentation of libxml2 says that xmlInitParser should only be called once and 
preferably from the main thread. xmlInitParser can not be called from 2 threads 
at the same time. Also after calling xmlCleanupParser, no calls to libxml2 may 
be done anymore, also not from a different thread.

To Reproduce crash on Windows: 
Initialize libxml2 in main thread, create client stub in background thread and 
call one of its operations, afterwards free the stub. If you now do a call to 
libxml2 in the main thread, your application will crash.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to