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 "Bill Mitchell (JIRA)" <ji...@apache.org> on 2007/12/27 21:52:43 UTC

[jira] Created: (AXIS2C-856) axiom_element_get_children() code behavior does not match header description

axiom_element_get_children() code behavior does not match header description
----------------------------------------------------------------------------

                 Key: AXIS2C-856
                 URL: https://issues.apache.org/jira/browse/AXIS2C-856
             Project: Axis2-C
          Issue Type: Bug
          Components: xml/om
    Affects Versions: 1.1.0
         Environment: Windows XP, Visual Studio 2005, guththila parser, libcurl
            Reporter: Bill Mitchell
            Priority: Minor


The comments in axiom_element.h describing the behavior of axiom_element_get_children indicate that the returned interator is owned by the user and must be freed by the user.  In fact, the code implements this function like axiom_element_get_children_with_qname, where the iterator is owned by the element and is freed when the om is freed.

Obviously if the user follows the instructions in the .h file and frees the iterator, the memory may be reused before the om structure is freed, at which time things go rapidly downhill.  

Here are the current comments:

    /**
     *   returns a list of children iterator
     *   iterators free function must be called by user
     */
    AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL

    axiom_element_get_children(
        axiom_element_t * om_element,
        const axutil_env_t * env,
        axiom_node_t * element_node);

I suggest this should read:
    /**
     *   returns a list of children iterator
     *   returned iterator is freed when om element struct
     *  is freed 
     *   iterators reset function must be called by user
     */
    AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL

    axiom_element_get_children(
...

-- 
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


[jira] Updated: (AXIS2C-856) axiom_element_get_children() code behavior does not match header description

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

Lahiru Gunathilake updated AXIS2C-856:
--------------------------------------

    Attachment: diff.txt

> axiom_element_get_children() code behavior does not match header description
> ----------------------------------------------------------------------------
>
>                 Key: AXIS2C-856
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-856
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: 1.1.0
>         Environment: Windows XP, Visual Studio 2005, guththila parser, libcurl
>            Reporter: Bill Mitchell
>            Priority: Minor
>         Attachments: diff.txt
>
>
> The comments in axiom_element.h describing the behavior of axiom_element_get_children indicate that the returned interator is owned by the user and must be freed by the user.  In fact, the code implements this function like axiom_element_get_children_with_qname, where the iterator is owned by the element and is freed when the om is freed.
> Obviously if the user follows the instructions in the .h file and frees the iterator, the memory may be reused before the om structure is freed, at which time things go rapidly downhill.  
> Here are the current comments:
>     /**
>      *   returns a list of children iterator
>      *   iterators free function must be called by user
>      */
>     AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL
>     axiom_element_get_children(
>         axiom_element_t * om_element,
>         const axutil_env_t * env,
>         axiom_node_t * element_node);
> I suggest this should read:
>     /**
>      *   returns a list of children iterator
>      *   returned iterator is freed when om element struct
>      *  is freed 
>      *   iterators reset function must be called by user
>      */
>     AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL
>     axiom_element_get_children(
> ...

-- 
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


[jira] Resolved: (AXIS2C-856) axiom_element_get_children() code behavior does not match header description

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

Senaka Fernando resolved AXIS2C-856.
------------------------------------

    Resolution: Fixed
      Assignee: Senaka Fernando

Fixed Issue. Thanks Bill for the input.

> axiom_element_get_children() code behavior does not match header description
> ----------------------------------------------------------------------------
>
>                 Key: AXIS2C-856
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-856
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: xml/om
>    Affects Versions: 1.1.0
>         Environment: Windows XP, Visual Studio 2005, guththila parser, libcurl
>            Reporter: Bill Mitchell
>            Assignee: Senaka Fernando
>            Priority: Minor
>         Attachments: diff.txt
>
>
> The comments in axiom_element.h describing the behavior of axiom_element_get_children indicate that the returned interator is owned by the user and must be freed by the user.  In fact, the code implements this function like axiom_element_get_children_with_qname, where the iterator is owned by the element and is freed when the om is freed.
> Obviously if the user follows the instructions in the .h file and frees the iterator, the memory may be reused before the om structure is freed, at which time things go rapidly downhill.  
> Here are the current comments:
>     /**
>      *   returns a list of children iterator
>      *   iterators free function must be called by user
>      */
>     AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL
>     axiom_element_get_children(
>         axiom_element_t * om_element,
>         const axutil_env_t * env,
>         axiom_node_t * element_node);
> I suggest this should read:
>     /**
>      *   returns a list of children iterator
>      *   returned iterator is freed when om element struct
>      *  is freed 
>      *   iterators reset function must be called by user
>      */
>     AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL
>     axiom_element_get_children(
> ...

-- 
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