axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie Lyon" ...@it-innovation.soton.ac.uk>
Subject RE: Possible to have two stubs active at the same time?
Date Wed, 12 Sep 2007 09:47:48 GMT
Excellent. Thanks. That's fixed that. However, if I do this, do I have
to free the XML parser manually, or change the options before freeing
the last stub?

Also, a quick query, is there anything special I have to do before
freeing a stub to stop this memory leak?

==610== 317,137 (81,214 direct, 235,923 indirect) bytes in 191 blocks
are definitely lost in loss record 45 of 45
==610==    at 0x4021396: malloc (vg_replace_malloc.c:149)
==610==    by 0x436DD0C: axutil_allocator_malloc_impl (allocator.c:65)
==610==    by 0x40733B8: axis2_arch_reader_create (arch_reader.c:37)
==610==    by 0x4060D46: axis2_conf_engage_module (conf.c:1394)
==610==    by 0x4074FD8: axis2_dep_engine_engage_modules
(dep_engine.c:824)
==610==    by 0x407514B: axis2_dep_engine_load_client (dep_engine.c:748)
==610==    by 0x407C852: axis2_build_client_conf_ctx (conf_init.c:101)
==610==    by 0x4086BDE:
axis2_svc_client_init_transports_from_conf_ctx (svc_client.c:991)
==610==    by 0x4086CB5: axis2_svc_client_create_with_conf_ctx_and_svc
(svc_client.c:266)
==610==    by 0x40871B3: axis2_svc_client_create (svc_client.c:98)
==610==    by 0x408272B:
axis2_stub_create_with_endpoint_ref_and_client_home (stub.c:64)
==610==    by 0x804B668: AxisBaseStub::AxisBaseStub(axutil_env const*,
std::string, std::string) (AxisBaseStub.cpp:18)

Thanks,
Jamie


> -----Original Message-----
> From: Samisa Abeysinghe [mailto:samisa@wso2.com]
> Sent: 12 September 2007 08:19
> To: Apache AXIS C Developers List
> Subject: Re: Possible to have two stubs active at the same time?
> 
> Nandika Jayawardana wrote:
> > Hi Jamie,
> >
> > Try adding the following line to your code before the call to send
> > message. I think it should fix the problem.
> >
> > axis2_options_set_xml_parser_reset (client_options, env,
AXIS2_FALSE);
> 
> Basically, if you do not have the above setting, it tries to free the
> XML parser instance when you free the stub. So when you are using two
> stubs, you get a double free.
> 
> Samisa...
> 
> > Regards
> >
> > Nandika
> >
> > On 9/11/07, *Jamie Lyon* <jl@it-innovation.soton.ac.uk
> > <mailto:jl@it-innovation.soton.ac.uk>> wrote:
> >
> >     Sorry, forgot to mention the error that caused the stack trace.
It
> >     is as follows:
> >
> >     *** glibc detected *** /home/jl/axistest/cpp/examples/example2:
> >     double free or corruption (out): 0x081c60d0 ***
> >
> >     Thanks,
> >     Jamie
> >
> >     ________________________________________
> >     From: Jamie Lyon [mailto:jl@it-innovation.soton.ac.uk
> >     <mailto:jl@it-innovation.soton.ac.uk>]
> >     Sent: 11 September 2007 16:25
> >     To: Apache AXIS C Developers List
> >     Subject: Possible to have two stubs active at the same time?
> >
> >     Hi,
> >
> >     Is it possible to have two 'axis2_stub_t's active at any one
time?
> >     When I try to free the objects I get the stack trace included at
> >     the end of the message.
> >
> >     This is upon freeing the second axis2_stub. If I delete the
first
> >     before creating the second it works perfectly fine, it's only if
> >     they're both created at the same time.
> >
> >     I should also note that this only appears to happen if both
stubs
> >     have sent a message, if either one has only been created, and
not
> >     actually used, both can be freed without any incident.
> >
> >     The general steps are as follows:
> >     1) Create axutil_env_t
> >     2) Create neethi_policy
> >     3) Create stub 1 from axutil_env_t and neethi_policy
> >     4) Create a second neethi_policy
> >     5) Create stub 2 from axutil_env_t and second neethi_policy
(also
> >     tried with a second, separate axutil_env_t, to no avail)
> >     6) Send a message from stub 1
> >     7) Send a message from stub 2
> >     8) Free stub 1
> >     9) Free stub 2 (crash)
> >
> >     If you cannot reproduce this, I will try and write a test case.
> >
> >     Is this a known problem?
> >
> >     Thanks,
> >     Jamie
> >
> >     -----
> >
> >     #0 0xffffe410 in __kernel_vsyscall ()
> >     #1 0xb7c74770 in raise () from /lib/tls/i686/cmov/libc.so.6
> >     #2 0xb7c75ef3 in abort () from /lib/tls/i686/cmov/libc.so.6
> >     #3 0xb7ca9d0b in __fsetlocking () from
/lib/tls/i686/cmov/libc.so.6
> >     #4 0xb7cb18bd in mallopt () from /lib/tls/i686/cmov/libc.so.6
> >     #5 0xb7cb1a44 in free () from /lib/tls/i686/cmov/libc.so.6
> >     #6 0xb7b0045f in xmlCharEncCloseFunc () from
/usr/lib/libxml2.so.2
> >     #7 0xb7b2b97f in xmlFreeParserInputBuffer () from
> >     /usr/lib/libxml2.so.2
> >     #8 0xb7b04858 in xmlFreeInputStream () from
/usr/lib/libxml2.so.2
> >     #9 0xb7b048a8 in xmlFreeParserCtxt () from /usr/lib/libxml2.so.2
> >     #10 0xb7bb052d in xmlFreeTextReader () from
/usr/lib/libxml2.so.2
> >     #11 0xb7f1984d in axis2_libxml2_reader_wrapper_free
> >     (parser=0x81423c8,
> >     env=0x80e81f0) at libxml2_reader_wrapper.c:475
> >     #12 0xb7f18788 in axiom_xml_reader_free (parser=0x81423c8,
> >     env=0x80e81f0)
> >     at ../xml_reader.c:31
> >     #13 0xb7f7976a in axiom_stax_builder_free (om_builder=0x813dc20,
> >     env=0x80e81f0)
> >     at om_stax_builder.c:825
> >     #14 0xb7f82e26 in axiom_soap_builder_free
(soap_builder=0x8142a58,
> >     env=0x80e81f0) at soap_builder.c:177
> >     #15 0xb7f81adf in axiom_soap_envelope_free
(soap_envelope=0x8156160,
> >     env=0x80e81f0) at soap_envelope.c:162
> >     #16 0xb7f528bc in axis2_msg_ctx_free (msg_ctx=0x81409d0,
> >     env=0x80e81f0)
> >     at msg_ctx.c:327
> >     #17 0xb7f52fde in axis2_op_ctx_free (op_ctx=0x814d4a8,
> env=0x80e81f0)
> >     at op_ctx.c:145
> >     #18 0xb7f58956 in axis2_op_client_free (op_client=0x814d470,
> >     env=0x80e81f0)
> >     at op_client.c:582
> >     #19 0xb7f59a48 in axis2_svc_client_free (svc_client=0x80e83d8,
> >     env=0x80e81f0)
> >     at svc_client.c:1164
> >     #20 0xb7f566b2 in axis2_stub_free (stub=0x80e83c8,
env=0x80e81f0)
> >     at stub.c:126 ...
> >
> >
> >
--------------------------------------------------------------------
> -
> >     To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> >     <mailto:axis-c-dev-unsubscribe@ws.apache.org>
> >     For additional commands, e-mail: axis-c-dev-help@ws.apache.org
> >     <mailto:axis-c-dev-help@ws.apache.org>
> >
> >
> >
> >
> > --
> > http://nandikajayawardana.blogspot.com/
> > <http://nandikajayawardana.blogspot.com/>
> > WSO2 Inc: http://www.wso2.com
> 
> 
> --
> Samisa Abeysinghe : WSO2 WSF/C
>
"http://wso2.org/projects/wsf/c?WSO2&nbsp;Web&nbsp;Services&nbsp;Framewo
rk
> /C&nbsp;-
>
&nbsp;Open&nbsp;source&nbsp;C&nbsp;library&nbsp;for&nbsp;providing&nbsp;
an
> d&nbsp;consuming&nbsp;Web&nbsp;services"
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message