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 8A8E6D5AC for ; Sat, 10 Nov 2012 18:43:12 +0000 (UTC) Received: (qmail 10369 invoked by uid 500); 10 Nov 2012 18:43:12 -0000 Delivered-To: apmail-axis-c-dev-archive@axis.apache.org Received: (qmail 10338 invoked by uid 500); 10 Nov 2012 18:43: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 10329 invoked by uid 99); 10 Nov 2012 18:43:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Nov 2012 18:43:12 +0000 Date: Sat, 10 Nov 2012 18:43:12 +0000 (UTC) From: "Alex Mantaut (JIRA)" To: c-dev@axis.apache.org Message-ID: <1477937241.96794.1352572992381.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (AXIS2C-1611) Seg fault if error on building conf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Alex Mantaut created AXIS2C-1611: ------------------------------------ Summary: Seg fault if error on building conf Key: AXIS2C-1611 URL: https://issues.apache.org/jira/browse/AXIS2C-1611 Project: Axis2-C Issue Type: Bug Components: core/engine Affects Versions: 1.6.0 Environment: Linux Reporter: Alex Mantaut Fix For: 1.7.0 There is a segfault when an error ocurrs in creating conf. To reproduce the bug: - Install axis2c trunk, and compile samples - go to AXIS2C_HOME/lib and remove or move one of the libraries (cd $AXIS2C_HOME/lib &&sudo mv libaxis2_http_receiver.so.0.7.0 libaxis2_http_receiver.so.0.7.0.1) - execute one of the samples (i.e. echo) it will segfault. Altough it is an error not beeing able to find an so, it should close gracefully, I think that this segfault may arise under other circumstances which cause conf building to fail... Examining the issue with valgrind it seems that there is a double freeing of dep_engine. dep_engine has a reference to conf and conf has a reference to dep_engine, and when it fails on creating conf, it deletes the conf (dep_engine.c:968) and when it exits the function tries to delete dep_engine again, which causes the segfault. The proposed solution is to set the dep_engine ptr from conf to NULL before deleting the conf. The proposed patch avoids the segfault, and doesn't leak memory in normal or error cases, please let me know if it is OK. Also I attach the valgrind analysis for the segfault (version prior applying the patch) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators 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