From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 186367FB1E for ; Fri, 5 Dec 2014 10:14:21 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anders@fugmann.net) identity=pra; client-ip=90.184.182.235; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="anders@fugmann.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of anders@fugmann.net designates 90.184.182.235 as permitted sender) identity=mailfrom; client-ip=90.184.182.235; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="anders@fugmann.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@fw.fugmann.net) identity=helo; client-ip=90.184.182.235; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="postmaster@fw.fugmann.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkAAOl2gVRauLbrl2dsb2JhbABZg1hYgwXDQoYTAoEvAQEBAQERAQEBAQEIFgdChAMBAQQjFUARCxgCAgUWCwICCQMCAQIBRQYBDAgCiDsJv0eWYwEBCAEBAQEBGQSBKIwAgy6Cb4FHAQSNWYVnjQeQPm6CQwEBAQ X-IPAS-Result: ArkAAOl2gVRauLbrl2dsb2JhbABZg1hYgwXDQoYTAoEvAQEBAQERAQEBAQEIFgdChAMBAQQjFUARCxgCAgUWCwICCQMCAQIBRQYBDAgCiDsJv0eWYwEBCAEBAQEBGQSBKIwAgy6Cb4FHAQSNWYVnjQeQPm6CQwEBAQ X-IronPort-AV: E=Sophos;i="5.07,521,1413237600"; d="scan'208";a="91933408" Received: from 0405ds1-vaer.1.fullrate.dk (HELO fw.fugmann.net) ([90.184.182.235]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 05 Dec 2014 10:14:20 +0100 Received: from [10.0.10.23] (issuu [195.184.103.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by fw.fugmann.net (Postfix) with ESMTPSA id 050C816A49EA; Fri, 5 Dec 2014 10:14:17 +0100 (CET) Message-ID: <54817769.2050605@fugmann.net> Date: Fri, 05 Dec 2014 10:14:17 +0100 From: Anders Fugmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 To: Kenneth Adam Miller , caml users References: <54801373.3010506@fugmann.net> <5480309B.3020402@fugmann.net> <5480B7C3.90300@fugmann.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Validation-by: anders@fugmann.net Subject: Re: [Caml-list] Potential OCaml-ZMQ memory management problems On 12/04/2014 10:48 PM, Kenneth Adam Miller wrote: > Well I am just no thorough and you are correct. > > The sending of data over a zmq socket and the conversion of that data > from string to protobuf encoded string all occurred in one line. One I > added a print statement and then segregated them more cleanly, I can see > that it is most certainly the line that converts to protobuf. > > The exact function that fails (on my end, could be deeper within this) > is to_pb from here: > > https://github.com/argp/bap/blob/master/ocaml/piqi/ast_piqi.ml#L186 > > In any case, I did a test, and in my first function when to_pb gets > called the first time and succeeds, I added an additional call to it... > which also succeeded. But then in a subsequent unit test, the one that > has been failing, still segfaults. > > If I turn off the tests prior to the segfaulting test, to_pb works in > this particular run. But if the tests run before hand, something goes > awry between the tests. Is it possible that to_pb is using some shared > state between calls? I would not expect so. If you create a failing unittest that I could try? Also, does the segfault contain a usable back trace (using gdb)? That might give some insights into which code is failing. /Anders