You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Mirko Wischer (JIRA)" <ji...@apache.org> on 2009/01/30 09:15:59 UTC

[jira] Created: (AXIS2-4225) ADB generated code generates memory leak

ADB generated code generates memory leak
----------------------------------------

                 Key: AXIS2-4225
                 URL: https://issues.apache.org/jira/browse/AXIS2-4225
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.4.1
         Environment: Win32
            Reporter: Mirko Wischer
            Priority: Minor


The xslt used for transforming to C Code (CADBBeanTemplateSource.xsl) creates a memory leak:

Code created for adb_..._serialize(..) contains a memory leak for the following types:
- axutil_date_time_t 
- axutil_base64_binary_t

The XSLT uses axutil_base64_binary_get_encoded_binary() and axutil_date_time_serialize_date_time() for creating
textual representations.  After writing these texts to the stream the start and end tags are freed but the 
the generated code never releases the base64 text or data_time text:

Look at the follown snippet from the trunk version of the XSLT:
(starting at Line:  4435)
                        <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
                          text_value_<xsl:value-of select="$position"/> = axutil_date_time_serialize_date_time(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>));  
---> MISSING FREE AT THIS POSITION:  AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>

And starting at line: 4446
                      <xsl:when test="$propertyType='axutil_base64_binary_t*'">
                          text_value_<xsl:value-of select="$position"/> =axutil_base64_binary_get_encoded_binary(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>)); ----> MISSING FREE HERE: AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>




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


[jira] Updated: (AXIS2-4225) ADB generated code generates memory leak

Posted by "Mirko Wischer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mirko Wischer updated AXIS2-4225:
---------------------------------

    Description: 
The xslt used for transforming to C Code (CADBBeanTemplateSource.xsl) creates a memory leak:

Code created for adb_..._serialize(..) contains a memory leak for the following types:
- axutil_date_time_t 
- axutil_base64_binary_t

The XSLT uses axutil_base64_binary_get_encoded_binary() and axutil_date_time_serialize_date_time() for creating
textual representations.  After writing these texts to the stream the start and end tags are freed but the 
the generated code never releases the base64 text or data_time text:

Look at the follown snippet from the trunk version of the XSLT:
(starting at Line:  4435)
                        <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
                          text_value_<xsl:value-of select="$position"/> = axutil_date_time_serialize_date_time(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>));  
---> MISSING FREE AT THIS POSITION:  AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>

And starting at line: 4446
                      <xsl:when test="$propertyType='axutil_base64_binary_t*'">
                          text_value_<xsl:value-of select="$position"/> =axutil_base64_binary_get_encoded_binary(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>)); ----> MISSING FREE HERE: AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>

Patch for trunk is included as DIFF file ( this also contains a fix for compiling with Visual Studio C Compiler)

  was:
The xslt used for transforming to C Code (CADBBeanTemplateSource.xsl) creates a memory leak:

Code created for adb_..._serialize(..) contains a memory leak for the following types:
- axutil_date_time_t 
- axutil_base64_binary_t

The XSLT uses axutil_base64_binary_get_encoded_binary() and axutil_date_time_serialize_date_time() for creating
textual representations.  After writing these texts to the stream the start and end tags are freed but the 
the generated code never releases the base64 text or data_time text:

Look at the follown snippet from the trunk version of the XSLT:
(starting at Line:  4435)
                        <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
                          text_value_<xsl:value-of select="$position"/> = axutil_date_time_serialize_date_time(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>));  
---> MISSING FREE AT THIS POSITION:  AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>

And starting at line: 4446
                      <xsl:when test="$propertyType='axutil_base64_binary_t*'">
                          text_value_<xsl:value-of select="$position"/> =axutil_base64_binary_get_encoded_binary(<xsl:value-of select="$propertyInstanceName"/>, env);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                           </xsl:if>
                           axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>)); ----> MISSING FREE HERE: AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
                           <xsl:if test="$anon or $istype">
                           axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                           </xsl:if>
                        </xsl:when>





> ADB generated code generates memory leak
> ----------------------------------------
>
>                 Key: AXIS2-4225
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4225
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Win32
>            Reporter: Mirko Wischer
>            Priority: Minor
>         Attachments: CADBBeanTemplateSource_trunk.xsl.diff
>
>
> The xslt used for transforming to C Code (CADBBeanTemplateSource.xsl) creates a memory leak:
> Code created for adb_..._serialize(..) contains a memory leak for the following types:
> - axutil_date_time_t 
> - axutil_base64_binary_t
> The XSLT uses axutil_base64_binary_get_encoded_binary() and axutil_date_time_serialize_date_time() for creating
> textual representations.  After writing these texts to the stream the start and end tags are freed but the 
> the generated code never releases the base64 text or data_time text:
> Look at the follown snippet from the trunk version of the XSLT:
> (starting at Line:  4435)
>                         <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
>                           text_value_<xsl:value-of select="$position"/> = axutil_date_time_serialize_date_time(<xsl:value-of select="$propertyInstanceName"/>, env);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, start_input_str, start_input_str_len);
>                            </xsl:if>
>                            axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>));  
> ---> MISSING FREE AT THIS POSITION:  AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, end_input_str, end_input_str_len);
>                            </xsl:if>
>                         </xsl:when>
> And starting at line: 4446
>                       <xsl:when test="$propertyType='axutil_base64_binary_t*'">
>                           text_value_<xsl:value-of select="$position"/> =axutil_base64_binary_get_encoded_binary(<xsl:value-of select="$propertyInstanceName"/>, env);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, start_input_str, start_input_str_len);
>                            </xsl:if>
>                            axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>)); ----> MISSING FREE HERE: AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, end_input_str, end_input_str_len);
>                            </xsl:if>
>                         </xsl:when>
> Patch for trunk is included as DIFF file ( this also contains a fix for compiling with Visual Studio C Compiler)

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


[jira] Updated: (AXIS2-4225) ADB generated code generates memory leak

Posted by "Mirko Wischer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mirko Wischer updated AXIS2-4225:
---------------------------------

    Attachment: CADBBeanTemplateSource_trunk.xsl.diff

Patch for memory leak in serialize code.
Also contains a fix for a compiling problem using Visual Studio C compiler

> ADB generated code generates memory leak
> ----------------------------------------
>
>                 Key: AXIS2-4225
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4225
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Win32
>            Reporter: Mirko Wischer
>            Priority: Minor
>         Attachments: CADBBeanTemplateSource_trunk.xsl.diff
>
>
> The xslt used for transforming to C Code (CADBBeanTemplateSource.xsl) creates a memory leak:
> Code created for adb_..._serialize(..) contains a memory leak for the following types:
> - axutil_date_time_t 
> - axutil_base64_binary_t
> The XSLT uses axutil_base64_binary_get_encoded_binary() and axutil_date_time_serialize_date_time() for creating
> textual representations.  After writing these texts to the stream the start and end tags are freed but the 
> the generated code never releases the base64 text or data_time text:
> Look at the follown snippet from the trunk version of the XSLT:
> (starting at Line:  4435)
>                         <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
>                           text_value_<xsl:value-of select="$position"/> = axutil_date_time_serialize_date_time(<xsl:value-of select="$propertyInstanceName"/>, env);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, start_input_str, start_input_str_len);
>                            </xsl:if>
>                            axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>));  
> ---> MISSING FREE AT THIS POSITION:  AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, end_input_str, end_input_str_len);
>                            </xsl:if>
>                         </xsl:when>
> And starting at line: 4446
>                       <xsl:when test="$propertyType='axutil_base64_binary_t*'">
>                           text_value_<xsl:value-of select="$position"/> =axutil_base64_binary_get_encoded_binary(<xsl:value-of select="$propertyInstanceName"/>, env);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, start_input_str, start_input_str_len);
>                            </xsl:if>
>                            axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>, axutil_strlen(text_value_<xsl:value-of select="$position"/>)); ----> MISSING FREE HERE: AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>);
>                            <xsl:if test="$anon or $istype">
>                            axutil_stream_write(stream, env, end_input_str, end_input_str_len);
>                            </xsl:if>
>                         </xsl:when>

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