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 "Michael Xiong (JIRA)" <ax...@ws.apache.org> on 2006/04/25 09:48:05 UTC

[jira] Created: (AXISCPP-967) WSDL2WS generate wrong code: no check for param->any1 will cause core dump

WSDL2WS generate wrong code: no check for param->any1 will cause core dump
--------------------------------------------------------------------------

         Key: AXISCPP-967
         URL: http://issues.apache.org/jira/browse/AXISCPP-967
     Project: Axis-C++
        Type: Bug

  Components: WSDL processing - RPC  
    Versions:  1.6 Beta    
 Environment: Platform:
        Linux fedora 3.0
Axis version:
        Server-side Axis C++ 1.6Beta
XML Parser Lib:
xersesc 2.6
WSDL2ws tool by using axis java 1.3
Client-side version Axis java 1.3
Http Server Version:
Apache 2.0.53
Tomcat 2.0.58
    Reporter: Michael Xiong


 [Error Statement]:
I have used AxisCPP1.6Beta version to generate TestDataInfo.cpp and Respond.cpp as the below:
TestDataInfo.cpp:
int Axis_Serialize_JobInfo(JobInfo* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
... ...
        pSZ->serializeAnyObject(param->any1);
... ...
}

and Respond.cpp:
int Axis_Serialize_Respond(Respond* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
... ...
        pSZ->serializeAnyObject(param->any1);
... ...
}

>From the generated code, param->any1 is really an AnyType* pointer.
In some case, param->any1 will be NULL, but since there has no check for it before use, there will cause my generated server component  core dump.

[solution]:
I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 682~694 in writeSerializeGlobalMethod method that belongs to BeanParamWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
            if (attribs[i].isAnyType())
            {
                anyCounter += 1;
//<mxiong debug 2006/4/25                
               writer.write("\tif (param->" + attribs[i].getParamName() + Integer.toString(anyCounter) + " != NULL)\n\t{\n");
//>mxiong debug 2006/4/25
            	writer.write("\t\tpSZ->serializeAnyObject(param->any" + Integer.toString(anyCounter) +");\n");
//<mxiong debug 2006/4/25
               writer.write("\t}\n");
 //>mxiong debug 2006/4/25
            }

So I think it maybe a bug, could you like to check it ?

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (AXISCPP-967) WSDL2WS generate wrong code: no check for param->any1 will cause core dump

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-967?page=all ]

nadir amra reassigned AXISCPP-967:
----------------------------------

    Assignee: nadir amra

> WSDL2WS generate wrong code: no check for param->any1 will cause core dump
> --------------------------------------------------------------------------
>
>                 Key: AXISCPP-967
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-967
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: WSDL processing - RPC
>    Affects Versions:  1.6 Beta
>         Environment: Platform:
>         Linux fedora 3.0
> Axis version:
>         Server-side Axis C++ 1.6Beta
> XML Parser Lib:
> xersesc 2.6
> WSDL2ws tool by using axis java 1.3
> Client-side version Axis java 1.3
> Http Server Version:
> Apache 2.0.53
> Tomcat 2.0.58
>            Reporter: Michael Xiong
>         Assigned To: nadir amra
>
>  [Error Statement]:
> I have used AxisCPP1.6Beta version to generate TestDataInfo.cpp and Respond.cpp as the below:
> TestDataInfo.cpp:
> int Axis_Serialize_JobInfo(JobInfo* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> and Respond.cpp:
> int Axis_Serialize_Respond(Respond* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> From the generated code, param->any1 is really an AnyType* pointer.
> In some case, param->any1 will be NULL, but since there has no check for it before use, there will cause my generated server component  core dump.
> [solution]:
> I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 682~694 in writeSerializeGlobalMethod method that belongs to BeanParamWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
>             if (attribs[i].isAnyType())
>             {
>                 anyCounter += 1;
> //<mxiong debug 2006/4/25                
>                writer.write("\tif (param->" + attribs[i].getParamName() + Integer.toString(anyCounter) + " != NULL)\n\t{\n");
> //>mxiong debug 2006/4/25
>             	writer.write("\t\tpSZ->serializeAnyObject(param->any" + Integer.toString(anyCounter) +");\n");
> //<mxiong debug 2006/4/25
>                writer.write("\t}\n");
>  //>mxiong debug 2006/4/25
>             }
> So I think it maybe a bug, could you like to check it ?

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (AXISCPP-967) WSDL2WS generate wrong code: no check for param->any1 will cause core dump

Posted by "Michael Xiong (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-967?page=comments#action_12437994 ] 
            
Michael Xiong commented on AXISCPP-967:
---------------------------------------

Dear all,

Environment:
Tomcat 2.0.58 should be -->
Tomcat 5.0.28

Could someboday help me to update the "Environment:" info ?

Thanks a lot !
Michael Xiong

> WSDL2WS generate wrong code: no check for param->any1 will cause core dump
> --------------------------------------------------------------------------
>
>                 Key: AXISCPP-967
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-967
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: WSDL processing - RPC
>    Affects Versions:  1.6 Beta
>         Environment: Platform:
>         Linux fedora 3.0
> Axis version:
>         Server-side Axis C++ 1.6Beta
> XML Parser Lib:
> xersesc 2.6
> WSDL2ws tool by using axis java 1.3
> Client-side version Axis java 1.3
> Http Server Version:
> Apache 2.0.53
> Tomcat 2.0.58
>            Reporter: Michael Xiong
>
>  [Error Statement]:
> I have used AxisCPP1.6Beta version to generate TestDataInfo.cpp and Respond.cpp as the below:
> TestDataInfo.cpp:
> int Axis_Serialize_JobInfo(JobInfo* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> and Respond.cpp:
> int Axis_Serialize_Respond(Respond* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> From the generated code, param->any1 is really an AnyType* pointer.
> In some case, param->any1 will be NULL, but since there has no check for it before use, there will cause my generated server component  core dump.
> [solution]:
> I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 682~694 in writeSerializeGlobalMethod method that belongs to BeanParamWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
>             if (attribs[i].isAnyType())
>             {
>                 anyCounter += 1;
> //<mxiong debug 2006/4/25                
>                writer.write("\tif (param->" + attribs[i].getParamName() + Integer.toString(anyCounter) + " != NULL)\n\t{\n");
> //>mxiong debug 2006/4/25
>             	writer.write("\t\tpSZ->serializeAnyObject(param->any" + Integer.toString(anyCounter) +");\n");
> //<mxiong debug 2006/4/25
>                writer.write("\t}\n");
>  //>mxiong debug 2006/4/25
>             }
> So I think it maybe a bug, could you like to check it ?

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (AXISCPP-967) WSDL2WS generate wrong code: no check for param->any1 will cause core dump

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXISCPP-967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra resolved AXISCPP-967.
--------------------------------

       Resolution: Fixed
    Fix Version/s: current (nightly)

Added following check:

                if (attribs[i].isOptional())
                    writer.write("\tif (param->any" + Integer.toString(anyCounter) + " != NULL)\n");

Will wait to close until a test case is created.

> WSDL2WS generate wrong code: no check for param->any1 will cause core dump
> --------------------------------------------------------------------------
>
>                 Key: AXISCPP-967
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-967
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: WSDL processing - RPC
>    Affects Versions:  1.6 Beta
>         Environment: Platform:
>         Linux fedora 3.0
> Axis version:
>         Server-side Axis C++ 1.6Beta
> XML Parser Lib:
> xersesc 2.6
> WSDL2ws tool by using axis java 1.3
> Client-side version Axis java 1.3
> Http Server Version:
> Apache 2.0.53
> Tomcat 2.0.58
>            Reporter: Michael Xiong
>         Assigned To: nadir amra
>             Fix For: current (nightly)
>
>
>  [Error Statement]:
> I have used AxisCPP1.6Beta version to generate TestDataInfo.cpp and Respond.cpp as the below:
> TestDataInfo.cpp:
> int Axis_Serialize_JobInfo(JobInfo* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> and Respond.cpp:
> int Axis_Serialize_Respond(Respond* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
> {
> ... ...
>         pSZ->serializeAnyObject(param->any1);
> ... ...
> }
> From the generated code, param->any1 is really an AnyType* pointer.
> In some case, param->any1 will be NULL, but since there has no check for it before use, there will cause my generated server component  core dump.
> [solution]:
> I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 682~694 in writeSerializeGlobalMethod method that belongs to BeanParamWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
>             if (attribs[i].isAnyType())
>             {
>                 anyCounter += 1;
> //<mxiong debug 2006/4/25                
>                writer.write("\tif (param->" + attribs[i].getParamName() + Integer.toString(anyCounter) + " != NULL)\n\t{\n");
> //>mxiong debug 2006/4/25
>             	writer.write("\t\tpSZ->serializeAnyObject(param->any" + Integer.toString(anyCounter) +");\n");
> //<mxiong debug 2006/4/25
>                writer.write("\t}\n");
>  //>mxiong debug 2006/4/25
>             }
> So I think it maybe a bug, could you like to check it ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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