You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Tudor Bosman (Jira)" <ji...@apache.org> on 2020/07/13 17:30:00 UTC

[jira] [Created] (ZOOKEEPER-3885) zoo_aremove_watches segfault: zk_hashtable needs locking!

Tudor Bosman created ZOOKEEPER-3885:
---------------------------------------

             Summary: zoo_aremove_watches segfault: zk_hashtable needs locking!
                 Key: ZOOKEEPER-3885
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3885
             Project: ZooKeeper
          Issue Type: Bug
          Components: c client
    Affects Versions: 3.5.8, 3.6.1
            Reporter: Tudor Bosman


We're encountering the following segfault (stack abridged).

This happens because the watcher hashtable has no locking, and is accessed concurrently from multiple threads:

- the thread doing zoo_aremove_watches, and
- the IO thread adding / firing watchers

We encountered this with zookeeper 3.5.8, but by code inspection the code appears the same in 3.6. 

*** Signal 11 (SIGSEGV) (0xae000000aa) received by PID 199 (pthread TID 0x7f1d64667700) (linux TID 1273) (code: address not mapped to object), stack trace: ***
    @ 00007f1d98dfc8b3 folly::symbolizer::(anonymous namespace)::signalHandler(int, siginfo_t*, void*)
                       /src/folly/folly/experimental/symbolizer/SignalHandler.cpp:431
    @ 00007f1d95e6c89f (unknown)
    @ 00007f1d8f73de1e containsWatcher.part.3
                       /src/zookeeper/zookeeper-client/zookeeper-client-c/src/zk_hashtable.c:152
    @ 00007f1d8f73e806 pathHasWatcher
                       /src/zookeeper/zookeeper-client/zookeeper-client-c/src/zk_hashtable.c:456
    @ 00007f1d8f7382dd aremove_watches
                       /src/zookeeper/zookeeper-client/zookeeper-client-c/src/zookeeper.c:4260
    @ 00007f1d8f738f82 zoo_aremove_watches
                       /src/zookeeper/zookeeper-client/zookeeper-client-c/src/zookeeper.c:5131




--
This message was sent by Atlassian Jira
(v8.3.4#803005)