axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pankaj Kharwal <>
Subject Issues with axiom_node_create_from_buffer() API
Date Mon, 21 Nov 2011 18:17:23 GMT
Hi All,

I am using AXIS2C 1.6.0 on Linux platform. The root node of my application contains '\n' and
'\r\n' characters and AXIS2C does not seem to handle them very well. Since my application
gets invoked using a number of different clients, it is not possible to restrict these patterns
at client side. So, I thought of first formatting the root node by removing  these strings
and then parsing using AXIOM. I perform the following sequence of events:

a.       Copy rootNode into bufNode1 (which is of type axis2_char_t *):

strcpy(bufNode1, axiom_node_to_string( _rootNode, env ));

At this stage, bufNode1 contains "<mea:MasterOffer>\n         <mea:offerId>12</mea:offerId>\n

b.      Then, I format the bufNode1 to remove '\n' and '\r\n' and bufNode1 now looks like:
 "<mea:MasterOffer>         <mea:offerId>12</mea:offerId>      </mea:MasterOffer>".
Note that the spaces between nodes still remain intact.

c.       After this, I call the API to create the node:

_MasterOffer = axiom_node_create_from_buffer (env, bufNode1); (_MasterOffer is of type axiom_node_t*)

Now the problem is that this function always fails with the following GDB trace:

Run till exit from #0  axiom_node_create_from_buffer (env=, buffer="<mea:MasterOffer>
        <mea:offerId>12</mea:offerId>      </mea:MasterOffer>")
    at om_node.c:98
*** glibc detected *** /usr/pkes/axis/bin/axis2_http_server: malloc(): memory corruption:
0x00000000006cbdc0 ***
======= Backtrace: =========

axiom_node_create_from_buffer internally calls axiom_xml_reader_create_for_memory which calls
 axutil_allocator_malloc_impl. At axutil_allocator_malloc_impl, it fails at 'return malloc(size)'
(allocator.c :Line 74).

I am not able to figure out the cause for this. Any help/guidance shall be much appreciated.

Thanks and Regards,
Pankaj Kharwal
Stockholm, Sweden

This email has been scanned by the Symantec Email service.
For more information please visit
View raw message