Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1539

Initialization/finalization of libxml2 in wrong place

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.0
    • 1.7.0
    • core/clientapi, xml/parser
    • None
    • Windows XP SP2

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            halewijng Halewijn Geerts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: