ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-538

zookeeper.async causes python to segfault

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.2.2, 3.3.0
    • Component/s: contrib-bindings
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Henry, can you take a look at this, am I doing it right?

      calling
      zookeeper.async(self.handle, path)
      causes python to segfault.

      see: http://github.com/phunt/zk-smoketest/blob/master/zk-smoketest.py

      1. callback.patch
        7 kB
        Patrick Hunt
      2. callback.patch
        6 kB
        Henry Robinson

        Activity

        Hide
        Henry Robinson added a comment -

        This should fix the problem - if a completion callback wasn't specified for async functions, the C zookeeper library would try and call NULL.

        Fixed by adding a callback to every async call which exits if no callback has been supplied by the user.

        I haven't added any new tests for this yet - Patrick, the smoketest is already better than what zkpython currently has I think. When it's finished, will you commit that?

        Show
        Henry Robinson added a comment - This should fix the problem - if a completion callback wasn't specified for async functions, the C zookeeper library would try and call NULL. Fixed by adding a callback to every async call which exits if no callback has been supplied by the user. I haven't added any new tests for this yet - Patrick, the smoketest is already better than what zkpython currently has I think. When it's finished, will you commit that?
        Hide
        Patrick Hunt added a comment -

        while jira was down I said:
        ---------
        That patch makes things better, but the script still fails, now on the third async rather than the first.

        Can you give this a try? Thanks.

        phunt@valhalla:~/dev/workspace/zk-smoketest[master]$ PYTHONPATH=lib.linux-i686-2.6 LD_LIBRARY_PATH=lib.linux-i686-2.6 ./zk-smoketest.py
        Connecting to localhost:2181
        Connected, handle is 0
        Node /zk-smoketest already exists, attempting reuse
        Connecting to localhost:2181
        Connected, handle is 1
        ASYNC
        ASYNCDONE
        ASYNC
        got watch in watcher, count 1
        ASYNCDONE
        Connecting to localhost:2181
        Connected, handle is 2
        ASYNC
        Segmentation fault

        Henry said:
        ------------
        Ok, I'll take a look

        Show
        Patrick Hunt added a comment - while jira was down I said: --------- That patch makes things better, but the script still fails, now on the third async rather than the first. Can you give this a try? Thanks. phunt@valhalla:~/dev/workspace/zk-smoketest [master] $ PYTHONPATH=lib.linux-i686-2.6 LD_LIBRARY_PATH=lib.linux-i686-2.6 ./zk-smoketest.py Connecting to localhost:2181 Connected, handle is 0 Node /zk-smoketest already exists, attempting reuse Connecting to localhost:2181 Connected, handle is 1 ASYNC ASYNCDONE ASYNC got watch in watcher, count 1 ASYNCDONE Connecting to localhost:2181 Connected, handle is 2 ASYNC Segmentation fault Henry said: ------------ Ok, I'll take a look
        Hide
        Patrick Hunt added a comment -

        Disregard my last comment - the patch Henry provided does fix this problem.

        turns out I was closing a handle and then later re-using it (in an async call).

        I've entered a jira on zkpython to handle this more gracefully:
        ZOOKEEPER-540

        Show
        Patrick Hunt added a comment - Disregard my last comment - the patch Henry provided does fix this problem. turns out I was closing a handle and then later re-using it (in an async call). I've entered a jira on zkpython to handle this more gracefully: ZOOKEEPER-540
        Hide
        Patrick Hunt added a comment -

        same as previous patch except added async test.

        Show
        Patrick Hunt added a comment - same as previous patch except added async test.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12421073/callback.patch
        against trunk revision 820808.

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

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

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12421073/callback.patch against trunk revision 820808. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 2 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/16/console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        +1 looks good, thanks Henry!

        Show
        Patrick Hunt added a comment - +1 looks good, thanks Henry!
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #485 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/485/)
        . zookeeper.async causes python to segfault

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #485 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/485/ ) . zookeeper.async causes python to segfault

          People

          • Assignee:
            Henry Robinson
            Reporter:
            Patrick Hunt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development