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 8C08980160 for ; Sat, 10 Jun 2017 17:33:23 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=alex.only.d@gmail.com; spf=Pass smtp.mailfrom=alex.only.d@gmail.com; spf=None smtp.helo=postmaster@mail-io0-f179.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alex.only.d@gmail.com) identity=pra; client-ip=209.85.223.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alex.only.d@gmail.com"; x-sender="alex.only.d@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of alex.only.d@gmail.com designates 209.85.223.179 as permitted sender) identity=mailfrom; client-ip=209.85.223.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alex.only.d@gmail.com"; x-sender="alex.only.d@gmail.com"; 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@mail-io0-f179.google.com) identity=helo; client-ip=209.85.223.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alex.only.d@gmail.com"; x-sender="postmaster@mail-io0-f179.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AOP64mBbb5Wsxa2EUGWbpZk//LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZoMi8bnLW6fgltlLVR4KTs6sC0LuJ9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQtFiT6/bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD?= =?us-ascii?q?0fOjA5/m/ZidF+grxHrx+6uxxz35TZbJ2JOPZifK7Qe84RS2pbXsZWUixMGp+x?= =?us-ascii?q?b48RAOsOI+lZr5T2qVQBrRu5HwmsA/3vwSJPi3Ds2a01zesgHRvB3AwmG9IPsG?= =?us-ascii?q?7Yo8juOacdVOC61qjIzTHZY/xK3jf97ZHFfxY8qv+CWrJwdNDeyUgpFw7dllWf?= =?us-ascii?q?s5flPy+L2esWsmib6fBsWv6oi24irQx6vzuhxt80h4XXmo4YzkrI+CZ5zYovO9?= =?us-ascii?q?G0VkB2bcS5HJZSsyyXMZZ9TNk4TGFyoik6z6ULuZ6lcygOz5Qq3xvfZOaGc4iM?= =?us-ascii?q?+x7jVeGRLSthiHJrZb6yhRK//VKvyu37Ucm031JKoTRfntbQsXAN0gTf6smBSv?= =?us-ascii?q?Rj4keswSiD2xzX5+1eIk05lbDXJ4A/zrM+jJYfrEbOEyvulEXzlqCWd0Ek+uay?= =?us-ascii?q?6+TgZ7XrvoWTN4tqhQDxKKguncq/AeA4MwQUQmeW4uu81Lj58k34RLVGlOE5kq?= =?us-ascii?q?7csJzCP8QUura5AxNJ0oYk8xuwEy2p0NEcnXUeKFJFeQmHj5TyNlHVIPH4CO+/?= =?us-ascii?q?jE62nDdqwfDGJLzhDY/XInjNireyNYp6vkVVzQ52ydFE+7pVDKsAKbT9QBzfrt?= =?us-ascii?q?vdWzY9Phy50q7KB9Jn0Z1WDWuLD7/fN6XWoBmEzu0qKuiIIoQSvWCueLAe+/fy?= =?us-ascii?q?gCphyhcmdq6z0M5PZQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DjBQC+EDxZf7PfVdFchGqBDQeDbZlsA?= =?us-ascii?q?WkBAQEGikCOew4ahXgCgn4HQxQBAQEBAQEBAQEBARIBAQkLCwgmMUIOAYFiIoJ?= =?us-ascii?q?tBBkBGx4DEhAPAiYCJAERAQUBDgEuigsBAwgNoWuDRT+MCIFsGAUBHIMKBYNpC?= =?us-ascii?q?hknDVaDaQIBBRJ5hERMhRKFaoJGgmEFiVSHaY0ChyuMHoNpjh2TJBQfgRU2gSs?= =?us-ascii?q?wISNdGYZ8OTaFSYQqAQEB?= X-IPAS-Result: =?us-ascii?q?A0DjBQC+EDxZf7PfVdFchGqBDQeDbZlsAWkBAQEGikCOew4?= =?us-ascii?q?ahXgCgn4HQxQBAQEBAQEBAQEBARIBAQkLCwgmMUIOAYFiIoJtBBkBGx4DEhAPA?= =?us-ascii?q?iYCJAERAQUBDgEuigsBAwgNoWuDRT+MCIFsGAUBHIMKBYNpChknDVaDaQIBBRJ?= =?us-ascii?q?5hERMhRKFaoJGgmEFiVSHaY0ChyuMHoNpjh2TJBQfgRU2gSswISNdGYZ8OTaFS?= =?us-ascii?q?YQqAQEB?= X-IronPort-AV: E=Sophos;i="5.39,324,1493676000"; d="scan'208";a="227852230" Received: from mail-io0-f179.google.com ([209.85.223.179]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Jun 2017 17:33:18 +0200 Received: by mail-io0-f179.google.com with SMTP id y77so41964110ioe.3 for ; Sat, 10 Jun 2017 08:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hfKUo44PJazTtCr9rDJhMdtvNxDOcL9G5zVNACivFWE=; b=MIUkRGGUEpeshBmCD7cbjjCubs9iLoyAC9kJNkUvWF+R3llLu5U+znd+ABB5F/LRi0 HqGGZWYkCMIqnSHZAjTUhTtMlwYuvYd8/Lkw5QkAZ1Y6FOaPisWysH5EohSNUsvQFYyH TQdSd+NQvVzvJcyunSkfti9iR7RIYcTqoF844zCU3vYUzsZ6g07lKNzxjfZVtY8O3SjV W5b1nElp1ubUfnzt5M0AG1SU1AhHQYiu68IUxCr/LcKWWvYsXmYkh04NcFFDJgjpr+p8 oaMho5f7xVoMytEBsOsGyJthcSDiHUVeqhK3NWofjndJsEr3AM/ykL34i7lLFoZ/o0Vx Q/Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hfKUo44PJazTtCr9rDJhMdtvNxDOcL9G5zVNACivFWE=; b=ZLDMUvllenf4WW/2WDiF/ovTH/a+yhToDjPsVCx24Huf9EeEYizQHrmvU7uiuRQfFo ceVi6FfNQuPbD3X2UZi9hF9iBZ6bnFBp/FNT9KFxDg9SrvLOIX7fVkMharZsGXB1ocWY KTu5Kv35F8k+00dFHuondJKPmuhjFUhqtJpez+xOV6hzi/h9rNNBLmxKGvqSTkqRSmPs AolBiRonGzO7fcxu1oDaCWXYjPhx2Azw80tSIpnDkw+PBmJlH2g9pxhSp5je8LvJY9Hn AiC+2a2otia98ykx/A758iUHv5hQur5Y3sENruI7+Hyif0ZhzDfys0AJ3VsOH0T5UrP0 4yFQ== X-Gm-Message-State: AODbwcB587GjwxbPM+Irc53kMRKzjxWKbeDVWK0wnoiHiQMmd5eU10N6 RRf1uoS6ty5/BpT4MRQoXj4MXLA7Ccq/ X-Received: by 10.107.137.166 with SMTP id t38mr38350038ioi.79.1497108797176; Sat, 10 Jun 2017 08:33:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.151.19 with HTTP; Sat, 10 Jun 2017 08:33:16 -0700 (PDT) From: Alexey Egorov Date: Sat, 10 Jun 2017 20:33:16 +0500 Message-ID: To: caml-list@inria.fr Content-Type: text/plain; charset="UTF-8" Subject: [Caml-list] memory corruption using C stub Hello, I have an OCaml application with some C code which (I believe) is the reason of some random crashes. Here is the code - https://pastebin.com/FVtLphZu This function reads file at given offset, divides data into chunks and compute checksums and compression ratio: external compute_data_props : string -> int -> int -> int -> (int * int * float) list = "compute_data_props" The problem is, after some calls to this stub, application is crashing at random places in OCaml code. I can't figure out what's going wrong, but replacing this stub with dummy function (which does nothing but returns some predefined list) eliminates the problem. What can we do to debug it? We are using OCaml 4.04.1 and Windows 10, and there is no other C stubs in our codebase. Thanks!