axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <sam...@wso2.com>
Subject Re: malloc, realloc, free and readdir failing
Date Fri, 06 Jul 2007 02:46:50 GMT
If you are using multiple service clients in the same program in 
threads, you may have to disable the resetting on the libxml2 parser, 
whenever you free the service client.

You can do this by using the method axis2_options_set_xml_parser_reset 
and set that to AXIS2_FALSE.

HTH

Thanks,
Samisa...

Stefano Pettini wrote:
> Hi,
>
> I've just subscribed this mailing list since I really need your help 
> to better understand how to use Axis2/C in a multi-thread environment.
>
> I only use the client side, and server side services are disabled in 
> axis2.xml.
>
> I think there must be something I ignore about memory management and 
> threading support.
>
> My web service client runs fine in a single-thread helloworld, but 
> crashes ALL THE TIME if I run a multi-thread software. In particular, 
> I believe I'm using Axis2's environments, allocator, and error 
> structures in an incorrect way, that's why I'm asking for more info. 
> Just to know the correct way of using _create, _free, AXIS2_FREE an so 
> on, if solves my problem.
>
> Is it right to create an environment in each thread? Or should I 
> create a single environment and then create svc_clients in each 
> thread? Or create everything in the root thread and then invoke the 
> svc_clients from different threads?
>
> I really did a lot of test: shared / not shared error_t structures, a 
> custom allocator with functions protected by a shared mutex, single 
> environment, many environments, but the results are always the same: 
> continuous random crashes in different points. After studying the 
> problem for 2 days, I've discovered malloc, realloc and free, of both 
> the custom and default allocator, sometimes fail returning null. So I 
> have null pointer exceptions everywhere randomly!
>
> And I'm not doing anything special! I've setup 3 svc_clients in each 
> thread, 10 threads, without executing anything else, without even 
> calling the services! I can't imagine what happens if I execute the 
> send_receive!
>
> I really don't know what to think. I defined a custom allocator, 
> shared among all the environments, with functions protected by a 
> mutex. malloc/free crashes were solved, but now I have readdir and 
> other function crashing all the time (crashing means int 3, user 
> exception and heap corruption), continuously and randomly.
>
> Libxml2 is initialized by the main thread, as specified in libxml2's 
> documentation about multi-threading support.
>
> I'm working with Win2003 x86, VC6 and the multi-thread debug dll C 
> runtime MSVCRTD.dll.
> I run on a Core2 Duo, maybe it's too much multi-threading :-)
>
> Thanks a lot if you can help me or suggest what to do next.
>
> I have tons of info since I've studied Axis2 source very deeply.
> If you want to know something more, just ask.
>
> Cheers,
> Stefano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


-- 
Samisa Abeysinghe : http://www.wso2.org/ (WSO2 Oxygen Tank - Web Services Developers' Portal)


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


Mime
View raw message