axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pankaj Kharwal <Pankaj.Khar...@kf.se>
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
     </mea:MasterOffer>"

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: =========
/lib64/libc.so.6[0x3639c730fe]
/lib64/libc.so.6(__libc_malloc+0x6e)[0x3639c74e2e]
/usr/pkes/axis/lib/libaxis2_parser.so.0[0x2aaaaace2e31]
/usr/pkes/axis/lib/libaxis2_parser.so.0(axiom_xml_reader_create_for_memory+0x50)[0x2aaaaace2f20]
/usr/pkes/axis/lib/libaxis2_axiom.so.0(axiom_node_create_from_buffer+0x40)[0x2aaaaaac1160]
..//services/Offer/libOfferService.so(axis2_skel_OfferService_Offer+0x19d)[0x2aaaac002329]
..//services/Offer/libOfferService.so(axis2_svc_skel_OfferService_invoke+0x132)[0x2aaaac0029b7]
/usr/pkes/axis/lib/libaxis2_engine.so.0[0x2aaaab3745da]
/usr/pkes/axis/lib/libaxis2_engine.so.0[0x2aaaab374121]
/usr/pkes/axis/lib/libaxis2_engine.so.0(axis2_engine_receive+0x399)[0x2aaaab36ab89]
/usr/pkes/axis/lib/libaxis2_http_common.so.0(axis2_http_transport_utils_process_http_post_request+0x692)[0x2aaaab13b4b2]
/usr/pkes/axis/lib/libaxis2_http_common.so.0(axis2_http_worker_process_request+0x1d90)[0x2aaaab138190]
/usr/pkes/axis/lib/libaxis2_http_receiver.so.0(axis2_svr_thread_worker_func+0x9e)[0x2aaaab7cb2ee]

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 Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
Mime
View raw message