Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.7.0
    • 1.7.0
    • xml/om
    • None
    • AIX 6.1 xlc_r

    Description

      context->attribute not free in axiom_xpath_free_context.

      env->dummy_root

      "
      /HACK: xpath impl requires a dummy root node in order to process properly./
      axiom_node_t * dummy_root;
      dummy_root = axiom_node_create(env);
      axiom_node_add_child(dummy_root, env, root_node);

      context = AXIS2_MALLOC(env->allocator,
      sizeof(axiom_xpath_context_t));

      "

      should also be free.

      attached patch file.

      Attachments

        1. xpath.c.patch
          0.6 kB
          Jean-Marc Lamond
        2. Corrected xpath.c.patch
          0.4 kB
          Jean-Marc Lamond

        Issue Links

          Activity

            Patch for xpath.c

            jmlamond Jean-Marc Lamond added a comment - Patch for xpath.c
            alexmantaut Alex Mantaut added a comment -

            Hi Jean-Marc:

            I've tried your patch, and when I run axiom/test/xpath/test_xpath with valgrind I get the a memory error that wasn't there previously (not a leak):

            ==17910== Invalid free() / delete / delete[] / realloc()
            ==17910== at 0x4028D3D: free (vg_replace_malloc.c:446)
            ==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116)
            ==17910== by 0x40B6EFD: axiom_xpath_free_context (xpath.c:405)
            ==17910== by 0x8048ECC: main (test_xpath.c:119)
            ==17910== Address 0x4295e60 is 0 bytes inside a block of size 40 free'd
            ==17910== at 0x4028D3D: free (vg_replace_malloc.c:446)
            ==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116)
            ==17910== by 0x4083DB1: axiom_node_free_detached_subtree (om_node.c:198)
            ==17910== by 0x40B6E95: axiom_xpath_free_context (xpath.c:384)
            ==17910== by 0x8048ECC: main (test_xpath.c:119)

            Also I looked into the code and the only calls to axiom_xpath_free_context() are in this test, are you having leaks while using it?

            alexmantaut Alex Mantaut added a comment - Hi Jean-Marc: I've tried your patch, and when I run axiom/test/xpath/test_xpath with valgrind I get the a memory error that wasn't there previously (not a leak): ==17910== Invalid free() / delete / delete[] / realloc() ==17910== at 0x4028D3D: free (vg_replace_malloc.c:446) ==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116) ==17910== by 0x40B6EFD: axiom_xpath_free_context (xpath.c:405) ==17910== by 0x8048ECC: main (test_xpath.c:119) ==17910== Address 0x4295e60 is 0 bytes inside a block of size 40 free'd ==17910== at 0x4028D3D: free (vg_replace_malloc.c:446) ==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116) ==17910== by 0x4083DB1: axiom_node_free_detached_subtree (om_node.c:198) ==17910== by 0x40B6E95: axiom_xpath_free_context (xpath.c:384) ==17910== by 0x8048ECC: main (test_xpath.c:119) Also I looked into the code and the only calls to axiom_xpath_free_context() are in this test, are you having leaks while using it?

            Hi Alex,
            I have wrote an axis2c client gateway program for a legacy system.
            I basicaly use cientapi for http/https native rest call, no soap. I use libxml2 because of decoding problem with the local one. I also implement xpath query (so far about 300 per invocation.
            I have so far apply most latest patches, and so far, I still have few memory leak in transport, but acceptable for a 10 000 times loop from the legacy caller.
            I have so far digg out up to axiom_xpath_evaluate_streaming and corresponding axiom_xpath_free_result. Here is quite bad. A lot of memory is not release...
            JM
            Jean-Marc

            jmlamond Jean-Marc Lamond added a comment - Hi Alex, I have wrote an axis2c client gateway program for a legacy system. I basicaly use cientapi for http/https native rest call, no soap. I use libxml2 because of decoding problem with the local one. I also implement xpath query (so far about 300 per invocation. I have so far apply most latest patches, and so far, I still have few memory leak in transport, but acceptable for a 10 000 times loop from the legacy caller. I have so far digg out up to axiom_xpath_evaluate_streaming and corresponding axiom_xpath_free_result. Here is quite bad. A lot of memory is not release... JM Jean-Marc
            billblough Bill Blough added a comment -

            Already applied in changes from xpath patch included in AXIS2C-1669

            billblough Bill Blough added a comment - Already applied in changes from xpath patch included in AXIS2C-1669

            People

              Unassigned Unassigned
              jmlamond Jean-Marc Lamond
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: