Re: mod_axis and apache problem: starting apache loads 4 instances of web service

2009-05-21 Thread Alex Bolgarov
On Thu, May 21, 2009 at 10:34 AM, Abdul Sami  wrote:
>
> I have built a web service using axis2/c's latest framework. After
> configuring Mod_Axis with apache, i noticed that it is loading 4 different
> instances of service. How can i control it?

May it be because the Apache launches 4 server processes? (and each
process has to load it's own instance of the shared library that
implements the service?) If this is so, then you probably would be
able to configure how much processes Apache starts, and min. and max.
restrictions on the number of the processes Apache is allowed to run,
in the Apache config.


Thank you,

alex.


Re: Another memory leak in axis2/C - mod_axis2

2008-07-26 Thread Alex Bolgarov
On Sat, Jul 26, 2008 at 10:56 AM, Manjula Peiris <[EMAIL PROTECTED]> wrote:
>
> On Sat, 2008-07-26 at 10:50 -0400, Alex Bolgarov wrote:
>> On Sat, Jul 26, 2008 at 10:46 AM, Subra A Narayanan <[EMAIL PROTECTED]> 
>> wrote:
>> > here you go => https://issues.apache.org/jira/browse/AXIS2C
>>
>> Do I need to have an account there, or what?
>
> Yes you need create an account.

OK, I created an account for myself and  reported the issue "AXIS2C-1242".


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Another memory leak in axis2/C - mod_axis2

2008-07-26 Thread Alex Bolgarov
On Sat, Jul 26, 2008 at 10:46 AM, Subra A Narayanan <[EMAIL PROTECTED]> wrote:
> here you go => https://issues.apache.org/jira/browse/AXIS2C

Do I need to have an account there, or what?


>
>
>
> On Sat, Jul 26, 2008 at 10:37 AM, Alex Bolgarov <[EMAIL PROTECTED]> wrote:
>>
>> On Fri, Jul 25, 2008 at 11:02 PM, Uthaiyashankar <[EMAIL PROTECTED]> wrote:
>> > Hi Alex,
>> >
>> > Thank you for pointing out. Yes, it is a serious memory leak. Can you
>> > create
>> > a jira in [1]. We'll fix it ASAP.
>>
>> How do I create a jira there? I can't find any link or button for
>> reporting issues...
>>
>>
>> Thank you,
>>
>>alex.
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Another memory leak in axis2/C - mod_axis2

2008-07-26 Thread Alex Bolgarov
On Fri, Jul 25, 2008 at 11:02 PM, Uthaiyashankar <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> Thank you for pointing out. Yes, it is a serious memory leak. Can you create
> a jira in [1]. We'll fix it ASAP.

How do I create a jira there? I can't find any link or button for
reporting issues...


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Another memory leak in axis2/C - mod_axis2

2008-07-25 Thread Alex Bolgarov
Hi,

I found another serious memory leak in the mod_axis2.

Using the SVN's version of the Axis2/C, in the file

src/core/transport/http/server/apache2/mod_axis2.c

in the function axis2_handler():

at the very beginning of the function there are two function calls:

apr_allocator_create(&local_allocator)
apr_pool_create_ex(&local_pool, NULL, NULL, local_allocator);

(right after the local variable declarations).

These calls apparently allocate memory that is supposed to be released
by the call

axis2_module_pool_allocator_destroy(allocator);

at the end of the function.

Apache calls axis2_handler() for every request it receives, not only
for the Axis requests. So this function checks if this is request for
the Axis:

if (strcmp(req->handler, "axis2_module"))
{
return DECLINED;
}
...

and returns DECLINED if it it not.

The problem is that this check is done _after_ the calls of
apr_allocator_create() and apr_pool_create_ex(). So in the case the
request is _not_ for Axis, the memory allocated by these functions
will be lost (leaked).

On my machine, I'm developing an Axis service and another Apache
module, completely unrelated to the Axis service. In the Apache config
I'm loading the Axis module mod_axis2 - even when I'm not working on
the Axis service.

Couple of days ago I did a stress-test for this my other module (like,
running 800 client test threads that all are sending requests to the
Apache that runs my module, for sustained period of time) and found
out that the memory in the Apache client processes is exhausting very
quickly. I have spend these couple of days trying to understand where
all this  memory goes :(

Finally, today I removed loading of the mod_axis from the Apache
config - and the memory leaks stopped :)

So I looked at the Axis2/C source code, and found the problem as
described above.

I did an experiment - I moved those two calls of
apr_allocator_create() and apr_pool_create_ex() after the check of "if
(strcmp(req->handler, "axis2_module"))" and re-build the Axis2/C. This
fixed the memory leak.

So here I submit this message instead of the patch, as I'm not sure,
it looks like there are another couple of returns (in case of some
errors) from the axis2_handler() where the memory allocated by those
two calls is not released, so please, would someone who is more
familiar with the code take a look at this?


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Loading mod_axis2.so module into Apache

2008-07-17 Thread Alex Bolgarov
Hi,

Thank you to all who replied.

We managed to make it work either by setting LD_LIBRARY_PATH value to
the lib directory in the axis repository before starting Apache or by
adding path to the lib directory of the repository into the
/etc/ld.so.conf file and running ldconfig.

Using envvars file also probably would work.

Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Loading mod_axis2.so module into Apache

2008-07-16 Thread Alex Bolgarov
Well, our server machine is not supposed to have development tools at
all. So I can't compile the Axis2/C on it.

Then, how it is supposed to work if I use the Axis2C binary distribution?

And it should have nothing to do with environment variables settings
(other then possible LD_LIBRARY_PATH) because Apache can't load the
module at all, because the ldopen() can't find the shared libraries
that this module refers to, and I can't load those shared libraries
manually using LoadFile directive because of the circular reference
problem as I described. So at the moment of failure no Axis2/C code
has executed yet that could have a chance to fix something (like, to
find and load libraries from the location pointed by the AXIS2C_HOME
or by any parameter in the Apache config file. Or am I wrong here?

What I don't understand is why (and how) it works if I run the Apache
server on the machine where I compile the Axis2C. Does the linker,
when it builds the libmod_axis2.so, embeds into this library the
pathes to the other Axis2/C libraries so, when I copy the mod_axis2.so
into the Apache modules directory on the same machine, it finds them
using those embedded pathes?


Thank you,

alex.

On Wed, Jul 16, 2008 at 3:28 PM, lahiru gunathilake <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> I think you have to set AXIS2C_HOME environment variable on your server
> machine. And why are you copying libraries from one machine to another why
> don't you compile Axis2C on you server machine.AFAIK if your first machine
> and the second machine are different,different in the sense first machine is
> dual core and the server machine is core 2 duo or something else you have to
> recompile Axis2C on your server machine and create libmod_axis2.so otherwise
> previously compiled library won't work on the server machine.
>
> Regards
> Lahiru
>
> On Thu, Jul 17, 2008 at 12:03 AM, Alex Bolgarov <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> How do you load a mod_axis2.so module into the Apache when you copy
>> the Axis2/C libraries to some directory - for example, when you are
>> using the binary Axis2/C distribution, or just build Axis2/C from
>> source on one machine (and installed itto some directory) and then
>> copy Axis2/C module and libraries to some directory on some othar
>> machine with Apache server?
>>
>> Well, here is a longer description of the problem:
>>
>> Say I'm using a source distribution. I download the .tar.gz source
>> tarball, untar, configure it with some install directory (--prefix)
>> and build/install it, now I have this install directory with the build
>> by me Axis2/C.
>>
>> I have Apache server running in this machine, so I copy mod_axis2.so
>> into the Apache installation, I update the Apache config to load the
>> module, I define the Axis2/C repository, I develop a web service and
>> run tests against it. All is fine up to this point.
>>
>> Now I want to use the Axis2/C with the Apache server that is running
>> on another machine.
>>
>> I copy everything from the install directory from the build machine
>> into some directory on this other machine with Apache (let's call this
>> directory "/home/alex/axis2c-dist").
>>
>> I rename libmod_axis2.so.0.4.0 to mod_axis2.so and copy it into the
>> Apache's modules directory.
>>
>> Now I change the Apache config file so that it contains the line
>>
>>LoadModule axis2_module modules/mod_axis2.so
>>
>> I try to start Apache:
>>
>>$ apachectl start
>>
>> and see following error:
>>
>> Cannot load /home/alex/httpd/modules/mod_axis2.so into server:
>> libaxis2_engine.so.0: cannot open shared object file: No such file or
>> directory
>>
>> Now, I happen to know about the LoadFile Apache directive :)
>>
>> I add the LoadFile directive for the libaxis2_engine.so so that Apache
>> loads it from the /home/alex/axis2c-dist directory, now the Apache
>> config looks like this:
>>
>>LoadFile /home/alex/axis2c-dist/lib/libaxis2_engine.so.0.4.0
>>LoadModule axis2_module modules/mod_axis2.so
>>
>> I try to start Apache again:
>>
>>$ apachectl start
>>
>> and now see:
>>
>> Cannot load /home/alex/axis2c-dist/lib/libaxis2_engine.so.0.4.0 into
>> server: libneethi.so.0: cannot open shared object file: No such file
>> or directory
>>
>> OK, I add LoadFile directives for the libneethi.so, and so on, when I
>> finally arrive to the following config:
>>
>>LoadFile /home/alex/axis2c-dist/lib/libaxutil.so.0.4.0
>>LoadFile /home/a

Loading mod_axis2.so module into Apache

2008-07-16 Thread Alex Bolgarov
Hi,

How do you load a mod_axis2.so module into the Apache when you copy
the Axis2/C libraries to some directory - for example, when you are
using the binary Axis2/C distribution, or just build Axis2/C from
source on one machine (and installed itto some directory) and then
copy Axis2/C module and libraries to some directory on some othar
machine with Apache server?

Well, here is a longer description of the problem:

Say I'm using a source distribution. I download the .tar.gz source
tarball, untar, configure it with some install directory (--prefix)
and build/install it, now I have this install directory with the build
by me Axis2/C.

I have Apache server running in this machine, so I copy mod_axis2.so
into the Apache installation, I update the Apache config to load the
module, I define the Axis2/C repository, I develop a web service and
run tests against it. All is fine up to this point.

Now I want to use the Axis2/C with the Apache server that is running
on another machine.

I copy everything from the install directory from the build machine
into some directory on this other machine with Apache (let's call this
directory "/home/alex/axis2c-dist").

I rename libmod_axis2.so.0.4.0 to mod_axis2.so and copy it into the
Apache's modules directory.

Now I change the Apache config file so that it contains the line

LoadModule axis2_module modules/mod_axis2.so

I try to start Apache:

$ apachectl start

and see following error:

Cannot load /home/alex/httpd/modules/mod_axis2.so into server:
libaxis2_engine.so.0: cannot open shared object file: No such file or
directory

Now, I happen to know about the LoadFile Apache directive :)

I add the LoadFile directive for the libaxis2_engine.so so that Apache
loads it from the /home/alex/axis2c-dist directory, now the Apache
config looks like this:

LoadFile /home/alex/axis2c-dist/lib/libaxis2_engine.so.0.4.0
LoadModule axis2_module modules/mod_axis2.so

I try to start Apache again:

$ apachectl start

and now see:

Cannot load /home/alex/axis2c-dist/lib/libaxis2_engine.so.0.4.0 into
server: libneethi.so.0: cannot open shared object file: No such file
or directory

OK, I add LoadFile directives for the libneethi.so, and so on, when I
finally arrive to the following config:

LoadFile /home/alex/axis2c-dist/lib/libaxutil.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libguththila.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libaxis2_parser.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libaxis2_axiom.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libneethi.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libaxis2_http_common.so.0.4.0
LoadFile /home/alex/axis2c-dist/lib/libaxis2_engine.so.0.4.0

LoadModule axis2_module modules/mod_axis2.so

But now, after I try to start Apache, I see new error:

Cannot load /home/alex/axis2c-dist/lib/libaxis2_http_common.so.0.4.0
into server: /home/alex/axis2c-dist/lib/libaxis2_http_common.so.0.4.0:
undefined symbol: axis2_handler_invoke

Which means that the libaxis2_engine.so depends on the
libaxis2_http_common.so, and requires it to be loaded by Apache first,
but the libaxis2_http_common.so contains a reference to undefined
symbol "axis2_handler_invoke", that is defined by the
libaxis2_engine.so. (Yes, I used 'nm libaxis2_engine.so | grep
axis2_handler_invoke" to check that this symbol is indeed defined in
this library.)

Circular dependency?

How do I break it?

(note that the same thing happens if I download the binary
distribution, untar it into some directory and copy the mod_axis2 into
the Apache moddules directory. Up to the same point I can use LoadFile
to load Axis2/C libraries, but then again I see this circular
dependency)


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How the 'init' function in the axis2_svc_skeleton_ops_t is supposed to be used?

2008-06-13 Thread Alex Bolgarov
Hi,

The service is supposed to define several functions that Axis calls
during the lifetime of the service (pointers to these functions are
assigned to the members of axis2_svc_skeleton_ops_t structure); one of
these functions is an 'init' function, that is called by Axis when the
service is loaded.

I'm trying to figure out how this 'init' function could be useful. The
parameters that Axis passes to the 'init' function are
axis2_svc_skeleton_t and axutil_env_t. From none of these parameters
the 'init' function can get access to any data that are related to the
service itself: it can't get access to the config parameters that are
defined in the 'services.xml' file, and there is no place where it
could leave some pre-initialized data for the service to use when the
'invoke' function is called.

Before I looked at the 'init' function attentively, I thought that it
might be a good place to create and initialize my other library object
that needs to be initialized with the path to the config file for this
library; and this path could be provided to the service as one of the
parameters in the 'services.xml' file; and I thought that there must
be some way to pass a pointer to this initialized  library object to
the 'invoke' function. But now I see that the 'init' function just
can't do this. (Is not such scenario one of the basic patterns for
initialization of something that later is called back by some
framework?)

So, is the 'init' function suitable only for initialization of a
global or static objects? Or there is some way that I did not find yet
to pass something - just a void pointer, that's all that is really
needed - from the 'init' function to 'invoke' function (and to 'free'
function for disposing)?


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Axic2C 1.4.0: "NULL parameter was passed..." in Apache log

2008-05-08 Thread Alex Bolgarov
> Then I run the 'echo' sample (that is, I build the echo client and
> service samples, deployed the service within the httpd environmet and
> run the client), everything looks OK so far but in the httpd log I see
> following lines (one line per the request: when I run 1000 iterations
> of the echo client, I see 1000 such lines in the apache error log):
>
>[Wed May  7 11:22:32 2008] [error] string.c(47) NULL parameter was
> passed when a non NULL parameter was expected
>

I found a place where this error message originates. It is in function
called axis2_apache2_worker_process_request() (file
src/core/transport/http/server/apache2/apache2_worker.c), when it
tries to create a axutil_string_t from the soap action header. If the
header is not present (the apr_table_get() returns NULL), this NULL is
passed directly to the axutil_string_create() function that prints
then this error message in the apache error log and returns NULL.

I looked at the code to see how the value returned from the
axutil_string_create() here (variable soap_header) is used, it looks
like it is OK to have the value of this variable NULL: in all
subsequent actions, including in the functions
axis2_http_transport_utils_process_http_[*]_request() that the
soap_action is passed as a parameter to, there is a check present if
this value is NULL, and something sensible happens if it it so.

So I changed the code a bit to check if the apr_table_get() returns
here NULL before the axutil_string_create() is called. Then I build
the Axis2C again, and run the service and the client - this time there
are no such error messages in the Apache log file.

If anyone is interested, here is a patch:


diff -ru 
axis2c-src-1.4.0-orig/src/core/transport/http/server/apache2/apache2_worker.c
axis2c-src-1.4.0/src/core/transport/http/server/apache2/apache2_worker.c
--- 
axis2c-src-1.4.0-orig/src/core/transport/http/server/apache2/apache2_worker.c
  2008-03-24 00:39:47.0 -0400
+++ axis2c-src-1.4.0/src/core/transport/http/server/apache2/apache2_worker.c
   2008-05-08 11:12:12.0 -0400
@@ -173,6 +173,7 @@
 axis2_char_t *accept_charset_header_value = NULL;
 axis2_char_t *accept_language_header_value = NULL;
 axis2_char_t *content_language_header_value = NULL;
+axis2_char_t *soap_action_hreader_txt = NULL;

 AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
 AXIS2_PARAM_CHECK(env->error, request, AXIS2_CRITICAL_FAILURE);
@@ -388,10 +389,24 @@
 }
 }

-soap_action = axutil_string_create(env,
-   (axis2_char_t *) apr_table_get(request->
-
headers_in,
-
AXIS2_HTTP_HEADER_SOAP_ACTION));
+
+soap_action = NULL;
+soap_action_hreader_txt =
+(axis2_char_t *) apr_table_get(request->headers_in,
+   AXIS2_HTTP_HEADER_SOAP_ACTION);
+if (soap_action_hreader_txt != NULL)
+{
+soap_action = axutil_string_create(env, soap_action_hreader_txt);
+}
+
+/*
+ * was:
+ * soap_action = axutil_string_create(env,
+ *(axis2_char_t *)
apr_table_get(request->
+ *
   headers_in,
+ *
   AXIS2_HTTP_HEADER_SOAP_ACTION));
+ */
+
 request_body = axutil_stream_create_apache2(env, request);
 if (!request_body)
 {



Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Axic2C 1.4.0: "NULL parameter was passed..." in Apache log

2008-05-07 Thread Alex Bolgarov
Hi,

I have just downloaded and build the latest Axis2C v. 1.4.0, and
deployed the mod_axis2.so into the Apache httpd web server.

Then I run the 'echo' sample (that is, I build the echo client and
service samples, deployed the service within the httpd environmet and
run the client), everything looks OK so far but in the httpd log I see
following lines (one line per the request: when I run 1000 iterations
of the echo client, I see 1000 such lines in the apache error log):

[Wed May  7 11:22:32 2008] [error] string.c(47) NULL parameter was
passed when a non NULL parameter was expected

Looks like this error message originates from the
axutil_string_create() function (file util/src/string.c, line 47), but
I'm not sure from where the axutil_string_create() function is being
called.

When I run the echo service within axis2_http_server environment (not
from the Apache httpd with mod_axis2), there is no such errors in the
[repository]/logs/echo.log file, so this might be related to the
mod_axis2 implementation.

The client receives the correct response, so the error must not be fatal.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis2/C Performance Article

2008-05-03 Thread Alex Bolgarov
I would be even more interested in comparison of Axis2/C and GSOAP toolkits...

Thank you,

alex.


On Sat, May 3, 2008 at 1:10 PM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> jimmy Zhang wrote:
>
> > did u guys also try vtd-xml? I am very interested in your findings on that
> as well
> >
>
>  Not yet, but we want to.
>
>  Samisa...
>
>
>
>
>
> > - Original Message - From: "Samisa Abeysinghe" <[EMAIL PROTECTED]>
> > To: "Apache AXIS C Developers List" <[EMAIL PROTECTED]>; "Apache
> AXIS C User List" 
> > Sent: Saturday, May 03, 2008 2:00 AM
> > Subject: Axis2/C Performance Article
> >
> >
> >
> > > For anyone who is interested: http://wso2.org/library/3532
> > >
> > > Samisa...
> > >
> > > --
> > > Samisa Abeysinghe Director, Engineering; WSO2 Inc.
> > >
> > > http://www.wso2.com/ - "The Open Source SOA Company"
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
>
>  --
>  Samisa Abeysinghe Director, Engineering; WSO2 Inc.
>
>  http://www.wso2.com/ - "The Open Source SOA Company"
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Memory leak in mod_axis2?

2008-04-09 Thread Alex Bolgarov
On Wed, Apr 9, 2008 at 3:36 PM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> In the mean time, please send the valgrind log.

I did send the valgrind log to the list :) - you can even see it in
the marc.info archive, at the bottom of the message:

http://marc.info/?l=axis-c-user&m=120776918704827

Or here is the link from the marc.info to download it as a text file:

http://marc.info/?l=axis-c-user&m=120776918704827&q=p3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Memory leak in mod_axis2?

2008-04-09 Thread Alex Bolgarov
Samisa, thank you; I checked out the SVN trunk version, build it and
run the test again.

On the server side (mod_axis2) there is no more memory leaks: I run
the test with 10 iterations, it took 4 minutes, httpd process
memory usage is stable and is not increasing.

But now there is a memory leak on the client side. I noticed that my
modified echo client (I modified the sample code to run the requests
in a loop) increases the memory usage all the time.

Then I compiled the original, unmodified echo.c sample from the
samples/client/echo directory, and run it through the valgrind. I'm
attaching the valgrind's log file; in a hope that this will help to
fix this. According to the valgrind log, there is a 6K bytes that
valgrind decided are 'definitely lost'.



Thank you,

alex.


On Tue, Apr 8, 2008 at 9:21 AM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> Local pools have been integrated to mod_axis2 in Axis2/C trunk.
>
>  You may run the tests again and see the improved memory footprint.
>
>  Samisa...
>
>
>
>  Samisa Abeysinghe wrote:
>
> > Alex Bolgarov wrote:
> >
> > > On Mon, Mar 31, 2008 at 11:17 PM, Uthaiyashankar <[EMAIL PROTECTED]>
> wrote:
> > >
> > >
> > > >  I doubt whether it is a memory leak. When using mod_axis2, memory
> > > >  management is done by apache apr. Memory is released only when pools
> are
> > > >  destroyed. Memory will not be released when calling AXIS2_FREE.
> > > >  (axis2_module_free is implemented in mod_axis2.c:412 and it is an
> empty
> > > >  method unless the pool associated with is global shared pool).
> > > >
> > > >
> > >
> > > Well, we can of course discuss the meaning of a term 'memory leak',
> > > but what happens here is awfully close to any sensible definition :)
> > >
> > > Thank you for pointing out that the mod_axis2 does not really release
> > > memory by design.
> > >
> >
> > What we are using is APR model of pools. So you cannot say that we are not
> releasing memory by design. We are depending on APR pools to release memory
> by design.
> > We have looked deep into this issue in the past, and proven that the
> request pool is reclaimed by main pool upon request completion.
> >
> >
> > > How do you think what happens if I change the
> > > allocator used by mod_axis2 to use malloc()/free(), not the APR's
> > > apr_pool_...() functions? Will the memory leak go away?.. Actually,
> > > this is exactly what I'm going to do. I have some experience in
> > > developing Apache httpd modules, and I write them in C++ and freely
> > > use new/delete operators, so I know that using a memory allocator
> > > other then APR's pool functions in the httpd process is OK.
> > >
> >
> > If you go and discuss this with httpd or apr list, they will sure tell you
> that this is the wrong way to do that.
> >
> > There are better ways of doing this, like using using local pools, which
> we are going to implement soon.
> >
> > Samisa...
> >
> >
> > > I will
> > > report my findings here, hopefully in a couple of days.
> > >
> > >
> > > Thank you,
> > >
> > >alex.
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>  --
>  Samisa Abeysinghe Software Architect; WSO2 Inc.
>
>  http://www.wso2.com/ - "Oxygenating the Web Service Platform."
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>
==11927== Memcheck, a memory error detector.
==11927== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==11927== Using LibVEX rev 1732, a library for dynamic binary translation.
==11927== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==11927== Using valgrind-3.2.3-Debian, a dynamic binary instrumentation framework.
==11927== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==11927== For more details, rerun with: -v
==11927==
==11927== Invalid read of size 4
==11927==at 0x0427820c: guththila_next_char (guththila_xml_parser.c:1555)
==11927==by 0x04278ad4: guththila_next (guththila_xml_parser.c:790)
==11927==by 0x0407643b: guththila_xml_reader_wrapper_n

Re: Memory leak in mod_axis2?

2008-04-01 Thread Alex Bolgarov
On Mon, Mar 31, 2008 at 11:17 PM, Uthaiyashankar <[EMAIL PROTECTED]> wrote:
>
>  I doubt whether it is a memory leak. When using mod_axis2, memory
>  management is done by apache apr. Memory is released only when pools are
>  destroyed. Memory will not be released when calling AXIS2_FREE.
>  (axis2_module_free is implemented in mod_axis2.c:412 and it is an empty
>  method unless the pool associated with is global shared pool).

Well, we can of course discuss the meaning of a term 'memory leak',
but what happens here is awfully close to any sensible definition :)

Thank you for pointing out that the mod_axis2 does not really release
memory by design. How do you think what happens if I change the
allocator used by mod_axis2 to use malloc()/free(), not the APR's
apr_pool_...() functions? Will the memory leak go away?.. Actually,
this is exactly what I'm going to do. I have some experience in
developing Apache httpd modules, and I write them in C++ and freely
use new/delete operators, so I know that using a memory allocator
other then APR's pool functions in the httpd process is OK. I will
report my findings here, hopefully in a couple of days.


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Error code: 75 :: A read attempt(HTTP) for the reply without sending the request

2008-03-31 Thread Alex Bolgarov
Hi,

Another thing that happened today in my experiments with the Axis2/C
was this error message from the client:

Error code: 75 :: A read attempt(HTTP) for the reply without sending the request

This happens after approx. 28-30 thousand requests were sent by the
client successfully. I'm using modified echo sample client, modified
in that the send-receive call is put into the loop with large (10
currently) number of iterations. So the client does ~30K
requests-response interactions successfully and then this error
happens.

As far as I understand, after searching for this error in the Axis
source code, this error is reported when a client tries to receive the
response but there is no HTTP socket connection opened to the server,
right?

I'm using a mod_axis2 with Apache httpd 2.4.4 as a Axis server.

What is interesting though, is that the debug level that is set up in
the Apache config file for Axis (Axis2LogLevel directive) seems to
have an impact on this.

When the Axis2LogLevel is set to 'debug', which means that the
mod_axis2 generates a huge amount of debug information in the Apache's
error_log, this error does not happen at all - all 100K of
request-response interactions are successful.

Only when I set Axis2LogLevel to 'info' or less (that is, less
information is printed in the error_log file), then this error
happens, stable after ~30K requests.

What might be the reason for this? May be writing of the debug output
slows down the Axis significantly so that no problem occurs, but if
the debug information is not written, then Axis (and httpd where it is
running) overload the computer so that the httpd refuses a connection
after some time?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Memory leak in mod_axis2?

2008-03-31 Thread Alex Bolgarov
On Sat, Mar 29, 2008 at 10:48 PM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> Alex Bolgarov wrote:
>  > Hi again.
>  >
>  > I've just run the echo service sample within the Apache2 httpd server
>  > (with the mod_axis2 module), I used the echo client but put the
>  > send-receive into the loop with 1,000,000 iterations.
>  >
>  > What I observed, was constant increasing of the memory (both resident
>  > and virtual, as the 'top' command shows) in the httpd process: approx.
>  > 1 megabyte every 5 sec. After 20 min. all physical memory on my
>  > computer was used, and it started hitting the swap, so I terminated
>  > the test.
>  >
>  > What is interesting though, when I run the same echo service with a
>  > standalone Axis2/server (axis2_http_server application), there was no
>  > increase of the memory usage by it - the whole 40 min. the test was
>  > running, the memory usage was stable, and the whole 1 million requests
>  > were successful.
>  >
>  > Should we made a conclusion from this that there is a memory leak, and
>  > specifically, a memory leak in the mod_axis2 code?
>  >
>
>  What MPM setting did you use with httpd?

The MPM is 'worker' MPM; if this helps, here is call of the
./configure from the shell script that I use to build the Apache:



CFLAGS="-O0 -g" \
./configure\
 "--prefix=${APACHE_PREFIX}"\
 --with-mpm=worker\
 --enable-so\
 --enable-ssl\
 --enable-info=shared\
 --enable-proxy=shared\
 --enable-proxy-connect=shared\
 --enable-proxy-ftp=shared\
 --enable-proxy-http=shared\
 --enable-proxy-ajp=shared\
 --enable-proxy-balancer=shared\
 --with-included-apr\
 --with-expat=builtin



>
>  Did you set MaxRequstsPerClient setting?

No, MaxRequstsPerClient is set to 0, and yes, I understand that I can
use this to kill old children processes with accumulated memory leaks
and start new fresh ones, but you know, using MaxRequestPerClient is
kind of cheating :) - there should not be memory leaks in the
mod_axis2 in the first place...


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Memory leak in mod_axis2?

2008-03-28 Thread Alex Bolgarov
Hi again.

I've just run the echo service sample within the Apache2 httpd server
(with the mod_axis2 module), I used the echo client but put the
send-receive into the loop with 1,000,000 iterations.

What I observed, was constant increasing of the memory (both resident
and virtual, as the 'top' command shows) in the httpd process: approx.
1 megabyte every 5 sec. After 20 min. all phisical memory on my
computer was used, and it started hitting the swap, so I terminated
the test.

What is interesting though, when I run the same echo service with a
standalone Axis2/server (axis2_http_server application), there was no
increase of the memory usage by it - the whole 40 min. the test was
running, the memory usage was stable, and the whole 1 million requests
were successful.

Should we made a conclusion from this that there is a memory leak, and
specifically, a memory leak in the mod_axis2 code?

I'm using Ubuntu Linux 7.10, Apache httpd 2.2.4 compiled from sources.
Yes, I know, the latest version of Apache2 is 2.2.8, so I'm going to
download and build this version and will try with it again.


Thank you,

alex.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: I don't understand what is going on with memory control in a client.

2008-03-28 Thread Alex Bolgarov
I tried with the echo sample - compiled both service and client from
the source code. All worked OK, without crashes in both cases - when
the request is successful and when the request fails because I did not
start the service. And I run the client through the valgrind, there
are no memory leaks (at least the small leaks that valgrind reports
are not increasing after I put the call of send_receive() into loop
and started increasing number of iterations). So it looks that the
echo sample contains correct sequence of operations.

Should not the (wrong) examples in the online user manual be updated too?


On Wed, Mar 26, 2008 at 11:10 PM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> Try with echo sample.
>
>  Samisa...
>
>
>
>  Alex Bolgarov wrote:
>  > Well, I _am_ using the sample provided by the Axis project - the
>  > client I'm using is the exact code sample from the "Axis2/C Manual" -
>  > the manual that is available here:
>  > http://ws.apache.org/axis2/c/docs/axis2c_manual.html. The sample
>  > client code I'm using is, without any changes, from this page:
>  > http://ws.apache.org/axis2/c/docs/hello/client/hello.c.html (I'm
>  > attaching the file that I was compiling, just in case there are some
>  > differences I could not see, but I've just copied the code from the
>  > web browser window and pasted it into XEmacs editor and saved as a
>  > 'my_client.c' file)
>  >
>  > And, as you can see in the sample client code, this sample _releases_
>  > a payload memory that is passes to the send_receive operation:
>  >
>  > if (payload)
>  > {
>  > axiom_node_free_tree(payload, env);
>  > payload = NULL;
>  > }
>  >
>  > Is the sample wrong? I will take a look at the samples from the source
>  > distribution, may be they don't release the payload?
>  >
>  > Anyway, when the service _is_ running and the client receives the
>  > response, why attempt to release the payload tree by the client (which
>  > this sample client does) does not cause the crash? If the Axis took
>  > ownership for the payload tree, it should have deleted it already, and
>  > attempt to delete if in the client code would have caused a crash.
>  > Something is not right here...
>  >
>  >
>  > Thank you,
>  >
>  > alex.
>  >
>  >
>  >
>  > On Wed, Mar 26, 2008 at 10:30 AM, Samisa Abeysinghe <[EMAIL PROTECTED]> 
> wrote:
>  >
>  >> In short, the AXIOM that you create and pass to service client
>  >>  send_receive operation would be taken control of by service client. So,
>  >>  you do not have to free that, even though you will be creating it. Same
>  >>  with the returned response payload. You can use it, but you do not have
>  >>  ownership of that. All that you have to delete is the service client
>  >>  instance.
>  >>
>  >>  If you can send in your client code, we can have a look.
>  >>
>  >>  Also, the samples follow the convention that I explained above, so if
>  >>  you follow the samples, you can solve the problems.
>  >>
>  >>  Samisa...
>  >>
>  >>
>  >>
>  >>  Alex Bolgarov wrote:
>  >>  > Hi,
>  >>  >
>  >>  > I don't understand what's going on inside the Axis2/C client. My test
>  >>  > client crashes. I looked at the Axis source code and did some
>  >>  > debugging (mostly, I've added a lots of AXIS2_LOG_DEBUG(...) to the
>  >>  > Axis source code and recompiled - I have a fast enough computer, and
>  >>  > this way you can receive repeating results, something that hard to get
>  >>  > with a debugger), and run a client code with valgrind.
>  >>  >
>  >>  > I think there might be some mix up in the the
>  >>  > axis2_op_client_add_msg_ctx() function, which causes the memory that
>  >>  > is not supposed to be freed by the Axis library (specifically, the
>  >>  > payload data that is allocated by the client application before it
>  >>  > calls the axis2_svc_client_send_receive()). Then, when the
>  >>  > axis2_svc_client_send_receive() returns to my client code, the client
>  >>  > tries to free the payload it allocated, at which moment the client
>  >>  > crashes - either silently, or with the glibc reporting "double free or
>  >>  > corruption".
>  >>  >
>  >>  > Now that I've got your attention, here are the details (sorry, this is
>  >>  > a long m

Re: I don't understand what is going on with memory control in a client.

2008-03-26 Thread Alex Bolgarov
Well, I _am_ using the sample provided by the Axis project - the
client I'm using is the exact code sample from the "Axis2/C Manual" -
the manual that is available here:
http://ws.apache.org/axis2/c/docs/axis2c_manual.html. The sample
client code I'm using is, without any changes, from this page:
http://ws.apache.org/axis2/c/docs/hello/client/hello.c.html (I'm
attaching the file that I was compiling, just in case there are some
differences I could not see, but I've just copied the code from the
web browser window and pasted it into XEmacs editor and saved as a
'my_client.c' file)

And, as you can see in the sample client code, this sample _releases_
a payload memory that is passes to the send_receive operation:

if (payload)
{
axiom_node_free_tree(payload, env);
payload = NULL;
}

Is the sample wrong? I will take a look at the samples from the source
distribution, may be they don't release the payload?

Anyway, when the service _is_ running and the client receives the
response, why attempt to release the payload tree by the client (which
this sample client does) does not cause the crash? If the Axis took
ownership for the payload tree, it should have deleted it already, and
attempt to delete if in the client code would have caused a crash.
Something is not right here...


Thank you,

alex.



On Wed, Mar 26, 2008 at 10:30 AM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> In short, the AXIOM that you create and pass to service client
>  send_receive operation would be taken control of by service client. So,
>  you do not have to free that, even though you will be creating it. Same
>  with the returned response payload. You can use it, but you do not have
>  ownership of that. All that you have to delete is the service client
>  instance.
>
>  If you can send in your client code, we can have a look.
>
>  Also, the samples follow the convention that I explained above, so if
>  you follow the samples, you can solve the problems.
>
>  Samisa...
>
>
>
>  Alex Bolgarov wrote:
>  > Hi,
>  >
>  > I don't understand what's going on inside the Axis2/C client. My test
>  > client crashes. I looked at the Axis source code and did some
>  > debugging (mostly, I've added a lots of AXIS2_LOG_DEBUG(...) to the
>  > Axis source code and recompiled - I have a fast enough computer, and
>  > this way you can receive repeating results, something that hard to get
>  > with a debugger), and run a client code with valgrind.
>  >
>  > I think there might be some mix up in the the
>  > axis2_op_client_add_msg_ctx() function, which causes the memory that
>  > is not supposed to be freed by the Axis library (specifically, the
>  > payload data that is allocated by the client application before it
>  > calls the axis2_svc_client_send_receive()). Then, when the
>  > axis2_svc_client_send_receive() returns to my client code, the client
>  > tries to free the payload it allocated, at which moment the client
>  > crashes - either silently, or with the glibc reporting "double free or
>  > corruption".
>  >
>  > Now that I've got your attention, here are the details (sorry, this is
>  > a long message):
>  >
>  > First, I'm using Ubuntu 7.10, and I downloaded and compiled sources of
>  > Axis2/C 1.3.0.
>  >
>  > I compiled a SOAP service - virtually unchanged code of the example
>  > from the user guide, but the service looks to be OK, there is a
>  > problem with the client.
>  >
>  > I compiled a SOAP client - absolutely unchanged code of the client
>  > from the user guide
>  > (http://ws.apache.org/axis2/c/docs/hello/client/hello.c.html).
>  >
>  > When I'm starting the Axis server (for example, stand-alone
>  > axis2_http_server application), the client works OK, it sends
>  > something to the service and receives some response. No crashes.
>  >
>  > But if I start the client application _without_ starting a server
>  > (that is, I expect some kind of timeout or some error about inability
>  > to conect to the server), the client application crashes.
>  >
>  > Here is what I found:
>  >
>  > The axis2_svc_client_send_receive() calls
>  > axis2_svc_client_send_receive_with_op_qname() function that implements
>  > the sending and receiving of the SOAP messages. If there is an error
>  > in the low-level sending/receiving of the messages (which really
>  > happens in my case, because I did not start the SOAP server for this
>  > test), the res_msg_ctx variable will be NULL, and in the conditional
>  > statement in the lines 864-872 of the file axis2_svc_client.c is
>

I don't understand what is going on with memory control in a client.

2008-03-26 Thread Alex Bolgarov
Hi,

I don't understand what's going on inside the Axis2/C client. My test
client crashes. I looked at the Axis source code and did some
debugging (mostly, I've added a lots of AXIS2_LOG_DEBUG(...) to the
Axis source code and recompiled - I have a fast enough computer, and
this way you can receive repeating results, something that hard to get
with a debugger), and run a client code with valgrind.

I think there might be some mix up in the the
axis2_op_client_add_msg_ctx() function, which causes the memory that
is not supposed to be freed by the Axis library (specifically, the
payload data that is allocated by the client application before it
calls the axis2_svc_client_send_receive()). Then, when the
axis2_svc_client_send_receive() returns to my client code, the client
tries to free the payload it allocated, at which moment the client
crashes - either silently, or with the glibc reporting "double free or
corruption".

Now that I've got your attention, here are the details (sorry, this is
a long message):

First, I'm using Ubuntu 7.10, and I downloaded and compiled sources of
Axis2/C 1.3.0.

I compiled a SOAP service - virtually unchanged code of the example
from the user guide, but the service looks to be OK, there is a
problem with the client.

I compiled a SOAP client - absolutely unchanged code of the client
from the user guide
(http://ws.apache.org/axis2/c/docs/hello/client/hello.c.html).

When I'm starting the Axis server (for example, stand-alone
axis2_http_server application), the client works OK, it sends
something to the service and receives some response. No crashes.

But if I start the client application _without_ starting a server
(that is, I expect some kind of timeout or some error about inability
to conect to the server), the client application crashes.

Here is what I found:

The axis2_svc_client_send_receive() calls
axis2_svc_client_send_receive_with_op_qname() function that implements
the sending and receiving of the SOAP messages. If there is an error
in the low-level sending/receiving of the messages (which really
happens in my case, because I did not start the SOAP server for this
test), the res_msg_ctx variable will be NULL, and in the conditional
statement in the lines 864-872 of the file axis2_svc_client.c is
executed the 'else' alternative, which calls the
axis2_op_client_add_msg_ctx() function, passing the res_msg_ctx value
(which is NULL) to it.

In the axis2_op_client_add_msg_ctx() function, right before the 'if'
statement in the lines 274-296 (file axis_op_client.c):

if (out_msg_ctx && !mc)

 value of the out_msg_ctx is not NULL, and value of the mc is not NULL
(I checked this using the debug logging), so the body of this
statement is executed. In this body, right before the 'if' statement
on the line 290:

if (axutil_strcmp(dump_value, AXIS2_VALUE_TRUE))

the value of the dump_value is NULL (again checked by the debug
logging), and the axutil_strcmp() returns -1 (which is interpreted as
a 'true' boolean value), and thus the body of the statement, including
the call (line 292)

axis2_msg_ctx_free(out_msg_ctx, env);

is executed.

The out_msg_ctx here points to the same message context object that
was created in the axis2_svc_client_send_receive_with_op_qname()
function, before sending the SOAP request - I saw using the debug
logging that the pointer value returned by the axis2_msg_ctx_create()
call in the axis2_svc_client_send_receive_with_op_qname() (line 834)
is the same as the value of the pointer out_msg_ctx here.

But this message context object contains a soap_envelop object that,
in turn, contains the payload object (tree of the object model nodes)
that my client application allocated before calling the
axis2_svc_client_send_receive() (specifically, this soap_envelop is
filled with the payload in the call
axis2_svc_client_fill_soap_envelope() (line 838, function
axis2_svc_client_send_receive_with_op_qname(), file
axis2_svc_client.c). So, returning back to the the
axis2_op_client_add_msg_ctx() function, this payload object (tree)
gets freed here. Then, later, when my client application tries to free
the payload object after the axis2_svc_client_send_receive() returns
to it, the application crashes, because this memory is already freed.


So, finally, my questions:

What strategy the client application that calls
axis2_svc_client_send_receive() should use regarding
allocating/freeing memory? From the current implementation of Axis2/C,
it looks like a) if the response was received successfully, the client
application should free the payload, but b) if there was a
communication error, the Axis library will free the payload itself. Is
this correct?

Is this a 'by design' feature of the Axis2/C or is this a bug and (in
theory) there should be more sane rules regarding memory control?
(And, is there somewhere published the memory management rules for the
Axis2/C?)


Second thing I've noticed when browsing the code of the
axis2_svc_client_send_receive_with_op_qname()

Re: Axis2/C, C++ and 'undefined symbol: __gxx_personality_v0'

2008-03-20 Thread Alex Bolgarov
Hi Manjula,

Yes, you are right. I removed setting LD_PRELOAD from my script that
starts the axis server, the test still runs OK.

And yes, I have seen the mention in the Axis2/C FAQ about using
'extern "C"'. I just have to suggest that the FAQ mention using
'extern "C"' specifically with axis2_get_instance() and
axis2_remove_instance() functions - initially I have added it to all
functions in the sample code but these two :)


Thank you,

alex.


On Thu, Mar 20, 2008 at 12:10 AM, Manjula Peiris <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
>  I think extern C alone should solve the problem. Because recently I did
>  the same thing and it worked for me. Can you try only with extern C
>  solution ?
>
>  Thanks,
>  -Manjula.
>
>
>
>
>  On Wed, 2008-03-19 at 13:36 -0400, Alex Bolgarov wrote:
>  > OK, I used LD_PRELAOD env. variable to preload the libstdc++.so when
>  > starting the axis2_http_server, like this:
>  >
>  > LD_PRELOAD=/usr/lib/libstdc++.so.6 ./axis2_http_server -r ${AXIS2C_HOME} 
> -l 6 &
>  >
>  > and now my test runs successfully: the client sends a request, I see
>  > in the axis log tracing of function calls that I added to every
>  > function in my service, and then the client receives a response.
>  >
>  > I'm not sure that a solution with LD_PRELOAD is a good one, does any
>  > one have an opinion?
>  >
>  > Anyway, in production all this is going to run as a Apache httpd
>  > module, and we already know how to load libstdc++.so into the httpd,
>  > so I'm going now to build the mod_axis and try to run the test again,
>  > now with httpd :)
>  >
>  >
>  > >  But, amazingly I never got, undefined symbol: __gxx_personality_v0.
>  > >
>  > >  Instead my server seg_faulted and crashed.
>  >
>  > Senaka, after I did something (I don't remember exactly what, I have
>  > done a lot of experimenting this morning) I also stopped getting
>  > undefined __gxx_personality_v0 and the server just started crashing
>  > (SIGSEGV); and when I run gdb on the core file, I also saw the that
>  > the crash was occurring in the AXIS2_SVC_SKELETON_INIT().
>  >
>  > But then, after some more experimenting, I added 'extern "C"' to the
>  > functions axis2_get_instance() and axis2_remove_instance() in my test
>  > service, and the test run successfully. Well, at least this is what I
>  > think fixed this crash :).
>  >
>  > So, two things so far: a) preload the libstdc++.so, and b) use 'extern
>  > "C"' on the functions that the Axis calls directly (that is, loads by
>  > name?)
>  >
>  >
>  > Thank you,
>  >
>  > alex.
>  >
>  >
>  > On Wed, Mar 19, 2008 at 10:44 AM, Senaka Fernando <[EMAIL PROTECTED]> 
> wrote:
>  > > Hi Alex,
>  > >
>  > >  I tried Axis2/C with a C++ client and it works fine. However, when it
>  > >  comes to server side, the message receiver can't invoke the
>  > >  AXIS2_SVC_SKELETON_INIT(), probably because it was built in C instead of
>  > >  C++. Thus, I guess that you will have to rebuild axis2/C using g++ in 
> the
>  > >  first place.
>  > >
>  > >  But, amazingly I never got, undefined symbol: __gxx_personality_v0.
>  > >
>  > >  Instead my server seg_faulted and crashed.
>  > >
>  > >  Will work on this and let you know if I get through.
>  > >
>  > >  Regards,
>  > >  Senaka
>  > >
>  > >
>  > >
>  > >  > I've tried with two versions: first, I downloaded and compiled latest
>  > >  > released Axisc/2 v. 1.3.0 from the http://ws.apache.org/axis2/c; after
>  > >  > seeing this error, I downloaded a "WSO2 Web Services Framework for
>  > >  > C++" from the http://wso2.org/projects/wsf/cpp, where, I hoped, given
>  > >  > that the name includes "for C++", the C++ problems would be solved.
>  > >  > This release, as I understand, includes Acis2/C version 1.2. The same
>  > >  > error (with the same text returned by  dlerror(), after I added
>  > >  > logging of this) happens in both cases.
>  > >
>  > >  >
>  > >  >
>  > >  > Thank you,
>  > >  >
>  > >  > alex.
>  > >  >
>  > >  >
>  > >  > On Tue, Mar 18, 2008 at 10:36 PM, Manjula Peiris <[EMAIL PROTECTED]> 
> wrote:
>  > >  >> Hi Bolgarov,
>  > >  >>
>  > 

Re: Axis2/C, C++ and 'undefined symbol: __gxx_personality_v0'

2008-03-19 Thread Alex Bolgarov
OK, I used LD_PRELAOD env. variable to preload the libstdc++.so when
starting the axis2_http_server, like this:

LD_PRELOAD=/usr/lib/libstdc++.so.6 ./axis2_http_server -r ${AXIS2C_HOME} -l 6 &

and now my test runs successfully: the client sends a request, I see
in the axis log tracing of function calls that I added to every
function in my service, and then the client receives a response.

I'm not sure that a solution with LD_PRELOAD is a good one, does any
one have an opinion?

Anyway, in production all this is going to run as a Apache httpd
module, and we already know how to load libstdc++.so into the httpd,
so I'm going now to build the mod_axis and try to run the test again,
now with httpd :)


>  But, amazingly I never got, undefined symbol: __gxx_personality_v0.
>
>  Instead my server seg_faulted and crashed.

Senaka, after I did something (I don't remember exactly what, I have
done a lot of experimenting this morning) I also stopped getting
undefined __gxx_personality_v0 and the server just started crashing
(SIGSEGV); and when I run gdb on the core file, I also saw the that
the crash was occurring in the AXIS2_SVC_SKELETON_INIT().

But then, after some more experimenting, I added 'extern "C"' to the
functions axis2_get_instance() and axis2_remove_instance() in my test
service, and the test run successfully. Well, at least this is what I
think fixed this crash :).

So, two things so far: a) preload the libstdc++.so, and b) use 'extern
"C"' on the functions that the Axis calls directly (that is, loads by
name?)


Thank you,

alex.


On Wed, Mar 19, 2008 at 10:44 AM, Senaka Fernando <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
>  I tried Axis2/C with a C++ client and it works fine. However, when it
>  comes to server side, the message receiver can't invoke the
>  AXIS2_SVC_SKELETON_INIT(), probably because it was built in C instead of
>  C++. Thus, I guess that you will have to rebuild axis2/C using g++ in the
>  first place.
>
>  But, amazingly I never got, undefined symbol: __gxx_personality_v0.
>
>  Instead my server seg_faulted and crashed.
>
>  Will work on this and let you know if I get through.
>
>  Regards,
>  Senaka
>
>
>
>  > I've tried with two versions: first, I downloaded and compiled latest
>  > released Axisc/2 v. 1.3.0 from the http://ws.apache.org/axis2/c; after
>  > seeing this error, I downloaded a "WSO2 Web Services Framework for
>  > C++" from the http://wso2.org/projects/wsf/cpp, where, I hoped, given
>  > that the name includes "for C++", the C++ problems would be solved.
>  > This release, as I understand, includes Acis2/C version 1.2. The same
>  > error (with the same text returned by  dlerror(), after I added
>  > logging of this) happens in both cases.
>
>  >
>  >
>  > Thank you,
>  >
>  > alex.
>  >
>  >
>  > On Tue, Mar 18, 2008 at 10:36 PM, Manjula Peiris <[EMAIL PROTECTED]> wrote:
>  >> Hi Bolgarov,
>  >>
>  >>  What is the Axis2/C version you are using?
>  >>
>  >>
>  >>
>  >>
>  >>  On Tue, 2008-03-18 at 17:17 -0400, Alex Bolgarov wrote:
>  >>  > Hi,
>  >>  >
>  >>  > I'm trying to write a SOAP service using Axis2/C framework. I need
>  >> the
>  >>  > service to be written in a C++ language, so as a first step I took an
>  >>  > 'echo service' example from the Axis distribution, renamed it to .cpp
>  >>  > file  and compiled/linked it with 'g++' compiler. No compile errors
>  >>  > reported, the resulting .so library I copied to the services
>  >>  > directory, together with the corresponding services.xml file.
>  >>  >
>  >>  > I compiled a sample client that tries to send something to my new
>  >> service.
>  >>  >
>  >>  > Than I strarted an 'axis2_http_server' application and run the
>  >> client,
>  >>  > which failed with a SOAP error message about failure to load a dll.
>  >>  >
>  >>  > I found in the Axis2/C source code the place where it loads the .so
>  >>  > file (axutil_class_loader_load_lib() in file 'class_loader.c'), and
>  >>  > added debug log message that reports into the log the exact text of
>  >> an
>  >>  > error as it is returned by dlerror() function, not just a message
>  >> that
>  >>  > if failed to load a library, like this (after line 156 of the file
>  >>  > 'class_loader.c'):
>  >>  >
>  >>  > if (!dl_handler)
>  >>  > {

Re: Axis2/C, C++ and 'undefined symbol: __gxx_personality_v0'

2008-03-19 Thread Alex Bolgarov
I've tried with two versions: first, I downloaded and compiled latest
released Axisc/2 v. 1.3.0 from the http://ws.apache.org/axis2/c; after
seeing this error, I downloaded a "WSO2 Web Services Framework for
C++" from the http://wso2.org/projects/wsf/cpp, where, I hoped, given
that the name includes "for C++", the C++ problems would be solved.
This release, as I understand, includes Acis2/C version 1.2. The same
error (with the same text returned by  dlerror(), after I added
logging of this) happens in both cases.


Thank you,

alex.


On Tue, Mar 18, 2008 at 10:36 PM, Manjula Peiris <[EMAIL PROTECTED]> wrote:
> Hi Bolgarov,
>
>  What is the Axis2/C version you are using?
>
>
>
>
>  On Tue, 2008-03-18 at 17:17 -0400, Alex Bolgarov wrote:
>  > Hi,
>  >
>  > I'm trying to write a SOAP service using Axis2/C framework. I need the
>  > service to be written in a C++ language, so as a first step I took an
>  > 'echo service' example from the Axis distribution, renamed it to .cpp
>  > file  and compiled/linked it with 'g++' compiler. No compile errors
>  > reported, the resulting .so library I copied to the services
>  > directory, together with the corresponding services.xml file.
>  >
>  > I compiled a sample client that tries to send something to my new service.
>  >
>  > Than I strarted an 'axis2_http_server' application and run the client,
>  > which failed with a SOAP error message about failure to load a dll.
>  >
>  > I found in the Axis2/C source code the place where it loads the .so
>  > file (axutil_class_loader_load_lib() in file 'class_loader.c'), and
>  > added debug log message that reports into the log the exact text of an
>  > error as it is returned by dlerror() function, not just a message that
>  > if failed to load a library, like this (after line 156 of the file
>  > 'class_loader.c'):
>  >
>  > if (!dl_handler)
>  > {
>  > AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
>  > "AXIS2_PLATFORM_LOADLIB error: [%s]",
>  > AXIS2_PLATFORM_LOADLIB_ERROR);
>  >
>  >...
>  >...
>  >...
>  >
>  > after recompiling the Axis and running the test again, I see in the
>  > log following message:
>  >
>  >  class_loader.c(159) AXIS2_PLATFORM_LOADLIB error:
>  > [/home/alexb/wsfcpp-repo/services/my_service/libmy_service.so:
>  > undefined symbol: __gxx_personality_v0]
>  >
>  > I understand that the real problem is that the axis2_http_server
>  > application is not compiled/linked with the g++ support libraries.
>  > Several years ago I had similar problem when writing a C++ module for
>  > Apache's httpd server, but there the solution was to use an httpd's
>  > directive 'LoadFile' to load the g++ runtime library into the httpd
>  > environment before loading my C++ module with the LoadModule
>  > directive.
>  >
>  > So the question is, does anyone knows how to make the
>  > axis2_http_server to load the g++ runtime library before it loads a
>  > C++ .so service library?
>  >
>  > For the record, I'm doing all this on the Ubuntu 7.10, and here is a
>  > result of running 'g++ --version:
>  >
>  > $ g++ --version
>  > g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
>  >
>  > -
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>
>
>  -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Axis2/C, C++ and 'undefined symbol: __gxx_personality_v0'

2008-03-18 Thread Alex Bolgarov
Hi,

I'm trying to write a SOAP service using Axis2/C framework. I need the
service to be written in a C++ language, so as a first step I took an
'echo service' example from the Axis distribution, renamed it to .cpp
file  and compiled/linked it with 'g++' compiler. No compile errors
reported, the resulting .so library I copied to the services
directory, together with the corresponding services.xml file.

I compiled a sample client that tries to send something to my new service.

Than I strarted an 'axis2_http_server' application and run the client,
which failed with a SOAP error message about failure to load a dll.

I found in the Axis2/C source code the place where it loads the .so
file (axutil_class_loader_load_lib() in file 'class_loader.c'), and
added debug log message that reports into the log the exact text of an
error as it is returned by dlerror() function, not just a message that
if failed to load a library, like this (after line 156 of the file
'class_loader.c'):

if (!dl_handler)
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"AXIS2_PLATFORM_LOADLIB error: [%s]",
AXIS2_PLATFORM_LOADLIB_ERROR);

   ...
   ...
   ...

after recompiling the Axis and running the test again, I see in the
log following message:

 class_loader.c(159) AXIS2_PLATFORM_LOADLIB error:
[/home/alexb/wsfcpp-repo/services/my_service/libmy_service.so:
undefined symbol: __gxx_personality_v0]

I understand that the real problem is that the axis2_http_server
application is not compiled/linked with the g++ support libraries.
Several years ago I had similar problem when writing a C++ module for
Apache's httpd server, but there the solution was to use an httpd's
directive 'LoadFile' to load the g++ runtime library into the httpd
environment before loading my C++ module with the LoadModule
directive.

So the question is, does anyone knows how to make the
axis2_http_server to load the g++ runtime library before it loads a
C++ .so service library?

For the record, I'm doing all this on the Ubuntu 7.10, and here is a
result of running 'g++ --version:

$ g++ --version
g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]