[ 
https://issues.apache.org/jira/browse/AXIS2C-1611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Mantaut updated AXIS2C-1611:
---------------------------------

    Attachment: axis2c_dep_engine_double_free.patch

Patch to solve the problem
                
> 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
>              Labels: conf, core, dep_engine, patch
>             Fix For: 1.7.0
>
>         Attachments: axis2c_dep_engine_double_free.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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-unsubscr...@axis.apache.org
For additional commands, e-mail: c-dev-h...@axis.apache.org

Reply via email to