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 "Dinesh Premalal (JIRA)" <ji...@apache.org> on 2006/11/07 16:20:50 UTC
[jira] Assigned: (AXIS2C-394) element free segfaults if namespace
reused
[ http://issues.apache.org/jira/browse/AXIS2C-394?page=all ]
Dinesh Premalal reassigned AXIS2C-394:
--------------------------------------
Assignee: Dinesh Premalal
> element free segfaults if namespace reused
> ------------------------------------------
>
> Key: AXIS2C-394
> URL: http://issues.apache.org/jira/browse/AXIS2C-394
> Project: Axis2-C
> Issue Type: Bug
> Components: xml/om
> Affects Versions: 0.95
> Reporter: Chris Darroch
> Assigned To: Dinesh Premalal
> Attachments: axis2c-394.patch
>
>
> If you create a namespace with axiom_namespace_create() and then create two
> sibling elements using axiom_element_create(), passing them both the namespace pointer,
> then both elements add the namespace pointer to their internal namespace hash,
> because neither finds declated it in any of the ancerstor elements.
> Then when you call axiom_node_free_tree(), you get a segfault when axiom_element_free() runs
> for the second element, because it calls axiom_namespace_free() on a namespace that
> the first element already freed. Both elements treat the namespace as if it was private to
> themselves and add it to their internal namespace hashes, and then both try to free it.
> I think some kind of reference counting will be required here. I'll try to make up a patch tonight
> and post it here.
> If I may just say so, though ... this is why trying to do alloc/free on everything is hard! It would
> be so much easier if you were using APR memory pools! Then you could make lots of
> pointers (like these internal namespace hash pointers) and not worry about reference
> counting, and when you were *totally* done with everything, just clear or destroy the pool.
--
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