axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Blecken" <>
Subject RE: Carston: please help
Date Fri, 08 Jul 2005 01:18:22 GMT
Hi Mark, Dushanta,

first of all sorry for obviously not testing sufficiently.

On the other hand at some point in time we need to get the
memory leaks stuffed in the stub and not in the client 
program (I had to do this and it was painful).

I ran the AxisBench and had the problems you describe. There
was one problem in Int.cpp which deallocated the xsd__int 
holder right away in the axis client library. Since that 
was inconsistent with other base types I changed that.
After that AxisBench finished (commenting out the manual
delete's), but the StringType was garbled. 

As you point out I suspect the copy section in BenchDataType.cpp
causes the problem.

	// Additional code to find is reference is pointer or pointer to a pointer
	BenchBasicDataType **	pp1 = param->infos.m_Array;

	param->infos.m_Size = array.m_Size;

	if( param->infos.m_Array == NULL)
		pp1 = new BenchBasicDataType*[array.m_Size];
		param->infos.m_Array = pp1;

	BenchBasicDataType *	p1 = (BenchBasicDataType *) array.m_Array;

	for( int iCount1 = 0; iCount1 < array.m_Size; iCount1++)
		pp1[iCount1] = new BenchBasicDataType();
		*(pp1[iCount1]) = p1[iCount1];
	delete [] p1;

The last delete [] p1; will have now destructors which really deallocate
the StringType, instead of the keeping the copy as it was before. 
One question : I'm not quite sure I understand why this copy is needed?

I want to try tomorrow to comment out the delete [] p1; - and see where 
this goes.

I don't have the ComplexLists yet up, but I suspect that this is a similar


-----Original Message-----
From: Carsten Blecken 
Sent: Wednesday, July 06, 2005 7:05 PM
To: Apache AXIS C Developers List
Subject: RE: Carston: please help

Hi Mark,

this is a tough one (but we need the destructors working). 
I'll see how far I get. Thanks for looking at it.


-----Original Message-----
From: Mark Whitlock []
Sent: Wednesday, July 06, 2005 3:05 PM
Subject: Carston: please help

Hi Carston,
The fix you made to on 28/06/05 1.78 has broken a
couple of our tests and I am struggling to fix them. Please could you help
me. I agree with your fix - I think the generated classes should clean up
their storage in their destructor. Unfortunately this breaks the AxisBench
and ComplexLists tests. AxisBench is set up for unit testing - so that you
can run it without a server. Just specify

ant -f test.xml -DmockServer=true

This will run it against a mock server which simply returns the response
message from AxisBench_ServerResponse.expected.

AxisBench fails by corrupting strings and qnames within the
BenchBasicDataType and throwing an exception when storage is cleaned at the
end of the testcase. When I commented out the lines that you added to
BeanParamWriter, AxisBench passed. The problem occurs in deserialization
since it is the output object that is corrrupted. Looking in the trace, I
can see the strings being deserialized correctly by
SoapDeSerializer::getElementAsString, so it must later on that they are
corrupted. I am running on Windows, although I expect the problem will
occur on all platforms.

The similarity between AxisBench and ComplexLists is that they both return
an array of complex types which contain string types that get corrupted.
There is code in Axis_Create_BenchBasicDataType that extends an array by
new'ing a new array, memcpy'ing the old array into the new array and
deleting the old array. I thought that this might be the problem since
~BenchBasicDataType will delete the embedded strings when the old array is
deleted. So I commented out the delete (just to try it) but this did not
fix the problem. My guess is that the problem is in this area.

Do you have any thoughts on what the problem might be?
Any help would be greatly appreciated,
Mark Whitlock

View raw message