Return-Path: X-Original-To: apmail-axis-c-dev-archive@www.apache.org Delivered-To: apmail-axis-c-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5F7059565 for ; Mon, 30 Apr 2012 11:35:12 +0000 (UTC) Received: (qmail 79621 invoked by uid 500); 30 Apr 2012 11:35:12 -0000 Delivered-To: apmail-axis-c-dev-archive@axis.apache.org Received: (qmail 79525 invoked by uid 500); 30 Apr 2012 11:35:12 -0000 Mailing-List: contact c-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list c-dev@axis.apache.org Received: (qmail 79517 invoked by uid 99); 30 Apr 2012 11:35:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2012 11:35:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2012 11:35:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A8D3F42701D for ; Mon, 30 Apr 2012 11:34:48 +0000 (UTC) Date: Mon, 30 Apr 2012 11:34:48 +0000 (UTC) From: "Sebastian Brandt (JIRA)" To: c-dev@axis.apache.org Message-ID: <1732187130.9119.1335785688693.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (AXIS2C-1590) axiom_attribute reference counting broken MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Sebastian Brandt created AXIS2C-1590: ---------------------------------------- Summary: axiom_attribute reference counting broken Key: AXIS2C-1590 URL: https://issues.apache.org/jira/browse/AXIS2C-1590 Project: Axis2-C Issue Type: Bug Components: xml/om Affects Versions: 1.7.0 Reporter: Sebastian Brandt The reference counting in axiom_attribute seems to be broken. When created, om_element has ref = 0. When free is called the first time, if(--attribute->ref > 0) evaluates to false; thus, the instance is freed. so far ok. When axiom_attribute_increment_ref is called, the ref count is incremented. if axiom_attribute_free is called now, again, if(--attribute->ref > 0) evaluates to false, and the instance is freed. Now, which is the right way to use the instance? a) call _create, and _free b) call _create, _increment_ref, and _free once? c) call _create, _increment_ref, and _free twice? (currently results in duplicate free). As far as I can see, a and b both happen, though I'm sure the b case looks rather like having forgotten to call _free a second time. axiom_element_add_attribute: axutil_hash_set(om_element->attributes, name, AXIS2_HASH_KEY_STRING, attribute); axiom_attribute_increment_ref(attribute, env); axiom_element_free: for each attribute in ->attributes: axiom_attribute_free((axiom_attribute_t *)val, env); for _these_ attributes, no other call to axiom_attribute_free is done. In other cases, _create and _free is called without increment_ref. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org For additional commands, e-mail: c-dev-help@axis.apache.org