You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Gowrima (Jira)" <ji...@apache.org> on 2025/02/14 22:48:00 UTC

[jira] [Commented] (ZOOKEEPER-4615) C сlient LOG_DEBUG after api_epilog uses freed handle

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927298#comment-17927298 ] 

Gowrima commented on ZOOKEEPER-4615:
------------------------------------

[~bibmaster] log callback function pointer is copied to local variable log_callback_fn fn which has the memory allocated on stack before freeing zh. This shouldn't result in a segmentation fault.
 
 
 

> C сlient LOG_DEBUG after api_epilog uses freed handle
> -----------------------------------------------------
>
>                 Key: ZOOKEEPER-4615
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4615
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>            Reporter: Dmitry Sokolov
>            Priority: Major
>
>  
> {code:java}
> api_epilog(zh, 0);
> LOG_DEBUG(LOGCALLBACK(zh), "completion thread terminated"); {code}
> {code:java}
> api_epilog(zh, 0);
> LOG_DEBUG(LOGCALLBACK(zh), "IO thread terminated"); {code}
> Handle zh is freed in api_epilog.
> LOG_CALLBACK(zh) uses freed handle and may cause segmentation fault.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)