You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by ax...@ws.apache.org on 2004/08/30 07:09:29 UTC
[jira] Created: (AXISCPP-143) Deserialiser method returns without doing anyting for somplex types with simple content
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXISCPP-143
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXISCPP-143
Summary: Deserialiser method returns without doing anyting for somplex types with simple content
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis-C++
Components:
Serialization/Deserialization
WSDL processing
Fix Fors:
1.3 Beta
Assignee:
Reporter: Samisa Abeysinghe
Created: Sun, 29 Aug 2004 10:09 PM
Updated: Sun, 29 Aug 2004 10:09 PM
Environment: All platforms
Description:
When we have the following XSD:
<xsd:complexType name="name">
<xsd:simpleContent>
<xsd:extension base="string">
<xsd:attribute ref="xml:lang" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
The generated code looks:
int Axis_DeSerialize_name(name* param, IWrapperSoapDeSerializer* pIWSDZ)
{
return AXIS_SUCCESS;
}
e.g. For UDDI WSDL (inquire_v2.wsdl) I get the server response:
<?xml version="1.0" encoding="UTF-8" ?><SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><tModelDetail generic="2.0" xmlns="urn:uddi-org:api_v2" operator="www.ibm.com/services/uddi" truncated="false"><tModel tModelKey="UUID:39B8F710-F088-11D6-8F10-000629DC0A7B" operator="www.ibm.com/services/uddi" authorizedName="100000EPEE"><name>TEST</name></tModel></tModelDetail></SOAP:Body></SOAP:Envelope>
However when I try to access the name from stub I get an empty strng:
code:
if(result.m_Array[i].name_Ref)
printf("name = %s\n", result.m_Array[i].name_Ref->name_value);
output:
name =
But the above given response has a valid name.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Closed: (AXISCPP-143) Deserialiser method returns without doing anyting for complex types with simple content
Posted by ax...@ws.apache.org.
Message:
The following issue has been closed.
Resolver: Susantha Kumara
Date: Tue, 5 Oct 2004 11:41 PM
Fixed
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXISCPP-143
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXISCPP-143
Summary: Deserialiser method returns without doing anyting for complex types with simple content
Type: Bug
Status: Closed
Priority: Major
Resolution: FIXED
Project: Axis-C++
Components:
Serialization/Deserialization
WSDL processing
Fix Fors:
current (nightly)
Assignee:
Reporter: Samisa Abeysinghe
Created: Sun, 29 Aug 2004 10:09 PM
Updated: Tue, 5 Oct 2004 11:41 PM
Environment: All platforms
Description:
When we have the following XSD:
<xsd:complexType name="name">
<xsd:simpleContent>
<xsd:extension base="string">
<xsd:attribute ref="xml:lang" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
The generated code looks:
int Axis_DeSerialize_name(name* param, IWrapperSoapDeSerializer* pIWSDZ)
{
return AXIS_SUCCESS;
}
e.g. For UDDI WSDL (inquire_v2.wsdl) I get the server response:
<?xml version="1.0" encoding="UTF-8" ?><SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><tModelDetail generic="2.0" xmlns="urn:uddi-org:api_v2" operator="www.ibm.com/services/uddi" truncated="false"><tModel tModelKey="UUID:39B8F710-F088-11D6-8F10-000629DC0A7B" operator="www.ibm.com/services/uddi" authorizedName="100000EPEE"><name>TEST</name></tModel></tModelDetail></SOAP:Body></SOAP:Envelope>
However when I try to access the name from stub I get an empty strng:
code:
if(result.m_Array[i].name_Ref)
printf("name = %s\n", result.m_Array[i].name_Ref->name_value);
output:
name =
But the above given response has a valid name.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
Re: Memory cleaning of generated C++ array code
Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
+1!
Sanjiva.
----- Original Message -----
From: "Samisa Abeysinghe" <sa...@yahoo.com>
To: "Apache AXIS C Developers List" <ax...@ws.apache.org>
Sent: Thursday, September 02, 2004 11:12 AM
Subject: Memory cleaning of generated C++ array code
> Hi All,
> In case of Arrays, I noticed that the WSDL2WS tool is generating a
struct.
>
> e.g.
> typedef struct SOAPStruct_ArrayTag
> {
> SOAPStruct* m_Array;
> int m_Size;
> } SOAPStruct_Array;
>
>
> The trouble here is that in case of returned values/parameters the user
has to delete the m_Array
> mamber explicitly.
>
> I think a more cleaner way would be to use a class here and use a
destructor to clean memory.
> (I mean for C++ code)
>
> Is there any specific reason to use struct here in C++ code?
> Is it OK if I try to change this to a class?
>
> Thanks,
> Samisa...
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
>
Re: SoapDeSerializer::getHeader - Memory leaks from BasicNode allocation?
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Anybody got any clue on this please???
Samisa...
--- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> One more question:
>
> 4. Why malloc? Why not new?
>
> Samisa...
>
> --- Samisa Abeysinghe <sa...@yahoo.com> wrote:
>
> > Hi All,
> > It looks to me that the following in src/soap/SoapDeSerializer.cpp (line 237) causes
> memory
> > leaks
> >
> > BasicNode** pNodeList = (BasicNode**) malloc(sizeof(BasicNode*) * 10);
> >
> > I have few questions.
> >
> > 1. Why do we have 10 hardcoded here?
> > 2. Where do we free the memory that is malloced here?
> > 3. As I understand we are trying to read the SOAP headers here and call handlers. (Am I
> > correct?)
> > Are the HeaderBlock destructor expected to free the memory allocated in above statement? (If
> yes
> > would all 10 elements be deallocated? - Even if it deallocates all 10, I do not think it is
> > correct to deallocate individual elements from a chunk of 10 that we have allocated using
> single
> > malloc)
> >
> > Please help to calrify the doubts.
> >
> > Thanks,
> > Samisa...
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > New and Improved Yahoo! Mail - 100MB free storage!
> > http://promotions.yahoo.com/new_mail
> >
>
>
>
>
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
>
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush
Re: SoapDeSerializer::getHeader - Memory leaks from BasicNode allocation?
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
One more question:
4. Why malloc? Why not new?
Samisa...
--- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> Hi All,
> It looks to me that the following in src/soap/SoapDeSerializer.cpp (line 237) causes memory
> leaks
>
> BasicNode** pNodeList = (BasicNode**) malloc(sizeof(BasicNode*) * 10);
>
> I have few questions.
>
> 1. Why do we have 10 hardcoded here?
> 2. Where do we free the memory that is malloced here?
> 3. As I understand we are trying to read the SOAP headers here and call handlers. (Am I
> correct?)
> Are the HeaderBlock destructor expected to free the memory allocated in above statement? (If yes
> would all 10 elements be deallocated? - Even if it deallocates all 10, I do not think it is
> correct to deallocate individual elements from a chunk of 10 that we have allocated using single
> malloc)
>
> Please help to calrify the doubts.
>
> Thanks,
> Samisa...
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush
SoapDeSerializer::getHeader - Memory leaks from BasicNode allocation?
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi All,
It looks to me that the following in src/soap/SoapDeSerializer.cpp (line 237) causes memory
leaks
BasicNode** pNodeList = (BasicNode**) malloc(sizeof(BasicNode*) * 10);
I have few questions.
1. Why do we have 10 hardcoded here?
2. Where do we free the memory that is malloced here?
3. As I understand we are trying to read the SOAP headers here and call handlers. (Am I correct?)
Are the HeaderBlock destructor expected to free the memory allocated in above statement? (If yes
would all 10 elements be deallocated? - Even if it deallocates all 10, I do not think it is
correct to deallocate individual elements from a chunk of 10 that we have allocated using single
malloc)
Please help to calrify the doubts.
Thanks,
Samisa...
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
Re: Memory leaks in client samples
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi All,
I managed to fix the base sample (samples/client/interoptests/base) for memory leaks. Now I
get 0 definite memory leaks.
But there are few problems.
1. With valgrind tool I get too many 'possibly lost' and 'still reachable' leaks
2. I get many 'Mismatched free() / delete / delete []'. This, I believe is due to the fact that I
try to use delete, but the serializer has used malloc to allocate memory. As a C++ progremer I do
not want to use free in my client code. However I have to if I want to make sure 100% memory clean
up. This is s *serious* problem we have to address in the C++ engine.
Moving forward we have to agree to a policy where we make the engine pure C++ and provide
wrapper functions for C code to free memory. I would like the engine to use new/delete so that I
could leverage constructors/destructors.
3. I have only updated the base sample so far. We need to do the same for other samples.
Thanks,
Samisa...
--- Samisa Abeysinghe <sa...@yahoo.com> wrote:
> Hi All,
> There are *too many* memory leaks in the client samples we have provided.
>
> We have set a *very bad* egsample to those users who try to write their own code based on
> the
> samples given.
> I tried to clean the doclitbase client sample lat evening and gave up because I had to fix
> too
> many things and I got tired :-(
>
> However, I think we have to clean up these to provide a clean set of samples and also to
> demonstrate how to use the generated code in the correct manner. I could fix couple of them.
> Please help do this asap. I found memory leaks in handler sample (client) as well.
>
> I did not test the server side. It is worth having a look at the server samples as well.
> (How
> can we test so files (or dlls) for memory leaks?
>
> If we do a class for arryas (see previous mail) we could solve half the problem I guess.
> Thanks,
> Samisa...
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
>
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush
Memory leaks in client samples
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi All,
There are *too many* memory leaks in the client samples we have provided.
We have set a *very bad* egsample to those users who try to write their own code based on the
samples given.
I tried to clean the doclitbase client sample lat evening and gave up because I had to fix too
many things and I got tired :-(
However, I think we have to clean up these to provide a clean set of samples and also to
demonstrate how to use the generated code in the correct manner. I could fix couple of them.
Please help do this asap. I found memory leaks in handler sample (client) as well.
I did not test the server side. It is worth having a look at the server samples as well. (How
can we test so files (or dlls) for memory leaks?
If we do a class for arryas (see previous mail) we could solve half the problem I guess.
Thanks,
Samisa...
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
Memory cleaning of generated C++ array code
Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi All,
In case of Arrays, I noticed that the WSDL2WS tool is generating a struct.
e.g.
typedef struct SOAPStruct_ArrayTag
{
SOAPStruct* m_Array;
int m_Size;
} SOAPStruct_Array;
The trouble here is that in case of returned values/parameters the user has to delete the m_Array
mamber explicitly.
I think a more cleaner way would be to use a class here and use a destructor to clean memory.
(I mean for C++ code)
Is there any specific reason to use struct here in C++ code?
Is it OK if I try to change this to a class?
Thanks,
Samisa...
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
[jira] Updated: (AXISCPP-143) Deserialiser method returns without doing anyting for complex types with simple content
Posted by ax...@ws.apache.org.
The following issue has been updated:
Updater: Samisa Abeysinghe (mailto:samisa_abeysinghe@yahoo.com)
Date: Wed, 1 Sep 2004 1:31 AM
Changes:
summary changed from Deserialiser method returns without doing anyting for somplex types with simple content to Deserialiser method returns without doing anyting for complex types with simple content
---------------------------------------------------------------------
For a full history of the issue, see:
http://issues.apache.org/jira/browse/AXISCPP-143?page=history
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXISCPP-143
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXISCPP-143
Summary: Deserialiser method returns without doing anyting for complex types with simple content
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis-C++
Components:
Serialization/Deserialization
WSDL processing
Fix Fors:
1.3 Beta
Assignee:
Reporter: Samisa Abeysinghe
Created: Sun, 29 Aug 2004 10:09 PM
Updated: Wed, 1 Sep 2004 1:31 AM
Environment: All platforms
Description:
When we have the following XSD:
<xsd:complexType name="name">
<xsd:simpleContent>
<xsd:extension base="string">
<xsd:attribute ref="xml:lang" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
The generated code looks:
int Axis_DeSerialize_name(name* param, IWrapperSoapDeSerializer* pIWSDZ)
{
return AXIS_SUCCESS;
}
e.g. For UDDI WSDL (inquire_v2.wsdl) I get the server response:
<?xml version="1.0" encoding="UTF-8" ?><SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><tModelDetail generic="2.0" xmlns="urn:uddi-org:api_v2" operator="www.ibm.com/services/uddi" truncated="false"><tModel tModelKey="UUID:39B8F710-F088-11D6-8F10-000629DC0A7B" operator="www.ibm.com/services/uddi" authorizedName="100000EPEE"><name>TEST</name></tModel></tModelDetail></SOAP:Body></SOAP:Envelope>
However when I try to access the name from stub I get an empty strng:
code:
if(result.m_Array[i].name_Ref)
printf("name = %s\n", result.m_Array[i].name_Ref->name_value);
output:
name =
But the above given response has a valid name.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira