You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2018/10/09 05:02:00 UTC

[jira] [Commented] (ZOOKEEPER-2320) C-client crashes when removing watcher asynchronously in "local" mode

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

Hadoop QA commented on ZOOKEEPER-2320:
--------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12814621/ZOOKEEPER-2320.patch
  against trunk revision 00c4c11853460923bdc9f3e4618382391d7b713c.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 4 new or modified tests.

    -1 patch.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/3705//console

This message is automatically generated.

> C-client crashes when removing watcher asynchronously in "local" mode
> ---------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2320
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2320
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>    Affects Versions: 3.5.1
>            Reporter: Hadriel Kaplan
>            Assignee: Abraham Fine
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: ZOOKEEPER-2320.patch, ZOOKEEPER-2320.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The C-client library will crash when invoking the asynchronous {{zoo_aremove_watchers()}} API function with the '{{local}}' argument set to 1.
> The reason is: if the local argument is 1/true, then the code does '{{notify_sync_completion((struct sync_completion *)data);}}' But casting the '{{data}}' variable to a {{sync_completion}} struct pointer is bogus/invalid, and when it's later handles as that struct pointer it's accessing invalid memory.
> As a side note: it will work ok when called _synchronously_ through {{zoo_remove_watchers()}}, because that function creates a {{sync_completion}} struct and passes it to the asynch {{zoo_aremove_watchers()}}, but it will not work ok when the asynch function is used directly for the reason stated perviously.
> Another side note: the docs state that setting the 'local' flag makes the C-client remove the watcher "even if there is no server connection" - but really it makes the C-client remove the watcher without notifying the server at *all*, even if the connection to a server is up. (well... that's what it would do if it didn't just crash instead ;)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)