Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9A24900B for ; Tue, 7 Feb 2012 21:42:26 +0000 (UTC) Received: (qmail 56624 invoked by uid 500); 7 Feb 2012 21:42:26 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 56590 invoked by uid 500); 7 Feb 2012 21:42:25 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Delivered-To: moderator for user@zookeeper.apache.org Received: (qmail 51183 invoked by uid 500); 7 Feb 2012 20:12:43 -0000 Delivered-To: apmail-hadoop-zookeeper-user@hadoop.apache.org X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of mfthom@gmail.com) Date: Tue, 7 Feb 2012 12:12:18 -0800 (PST) From: mfthom To: zookeeper-user@hadoop.apache.org Message-ID: <1328645538004-7263621.post@n2.nabble.com> Subject: c binding asynchronous get problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm having trouble with a c client doing an asynchronous get. This code: #include #include #include #include char *Z = "/fuzz/targets/targ0000000002"; int main(int argc, char **argv) { static zhandle_t *zh = NULL; char ip[8192]; int len; struct Stat stat; printf("here here \n"); zh = zookeeper_init("172.20.110.100:2181", NULL, 30000, 0, 0, 0); int rc = zoo_get(zh, Z, 0, ip, &len, &stat); if(rc != ZOK) { printf("crash\n"); }else{ printf("ip is %s len is %d\n", ip, len); } } will fail or work depending on the size of the ip array. 1024 works usually. 8292 fails. The failure symptom is that it returns a len of zero bytes instead of the data (a simple IP address). And sometimes, zookeeper seg faults while doing memcpy. Thanks, --Mike -- View this message in context: http://zookeeper-user.578899.n2.nabble.com/c-binding-asynchronous-get-problem-tp7263621p7263621.html Sent from the zookeeper-user mailing list archive at Nabble.com.