From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E4713BC57 for ; Tue, 25 May 2010 21:29:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsCAOXB+0tKfVI0m2dsb2JhbACeAwgVAQEBAQEICQoJESKwZIIBhTwuiE8BAQMFhQ4Egz0 X-IronPort-AV: E=Sophos;i="4.53,299,1272837600"; d="scan'208";a="51817537" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 May 2010 21:29:29 +0200 Received: by wwa36 with SMTP id 36so149953wwa.39 for ; Tue, 25 May 2010 12:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qYzCgs1cKdZ113kVyCTnsMJp3lyDOCk08n4EpSt2v5Q=; b=RYvUcM+xqI9aeBuFENCgtbfbtIoGTkQaVA+KVN7QoGVZPcCkHrOw1icq3ozI1LA6vI 1dvSj6kANRp1U4D/y1dNe4fzwIbRYtDvLJRssV9V8gwarMHdoyJ+06bADB1GatcKT6wQ NvD9NklvKSPLGBsM3RlIu9Rpjb6fin2EljWZI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=wSh7OU3BeXBAh5b5AeF6Z2jbpSJqG7ESNEeXXNdRp6RJuqlgw/jWE4YyS//hiFAIF1 qzLhTqpBoJGNtjxKZk50g3pdJQ7PlFebM2BEQdb28D1DjTEyvnE8UvDX4zSp1V3P/BdM GwBEZnjOQncCqDnZPvIxSOWWasPRV5+r6DqaM= MIME-Version: 1.0 Received: by 10.216.88.133 with SMTP id a5mr4677713wef.192.1274815768930; Tue, 25 May 2010 12:29:28 -0700 (PDT) Received: by 10.216.134.8 with HTTP; Tue, 25 May 2010 12:29:28 -0700 (PDT) In-Reply-To: <201005251125.21755.toots@rastageeks.org> References: <201005251125.21755.toots@rastageeks.org> Date: Tue, 25 May 2010 23:29:28 +0400 Message-ID: Subject: Re: [Caml-list] Bigarrays and blocking_section.. From: Dmitry Bely To: Romain Beauxis Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; bigarrays:01 segfault:01 bigarrays:01 val:01 val:01 bigarray:01 struct:01 buffer:01 height:98 wrote:01 dmitry:01 dmitry:01 caml-list:01 int:01 int:01 On Tue, May 25, 2010 at 8:25 PM, Romain Beauxis wrot= e: > =A0 =A0 =A0 =A0Hi all ! > > I am trying to understand some segfault that we observe and I have a ques= tion > about the relationships between bigarrays in C and the Gc. > > We have the following code: > > static frame *frame_of_value(value v, frame *f) > { > =A0f->data =3D Caml_ba_data_val(Field(v,0)); > =A0f->width =3D Int_val(Field(v,1)); > =A0f->height =3D Int_val(Field(v,2)); > =A0f->stride =3D Int_val(Field(v,3)); > > =A0return f; > } Are you sure that you correctly calculate the bigarray size in your Caml code? Why not just use struct caml_ba_array fields? I suspect it's not GC problem but just a buffer overrun in memset(). - Dmitry Bely