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 sympa.inria.fr (Postfix) with ESMTPS id 4A9937EE35 for ; Wed, 23 Mar 2016 16:18:23 +0100 (CET) IronPort-PHdr: 9a23:yG+eUB2wiyAOSwFzsmDT+DRfVm0co7zxezQtwd8ZsegfK/ad9pjvdHbS+e9qxAeQG96Lu7Qd1aGJ6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZ3pnL/qs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjN92Mq+mh7YUgqJrmUbVC08iBdEDhLB6w6yCpj2qTT7sK9jnSOyIsD8C7w5D2eM9aBuHTbugTsAMy9xwmjNh9Brj7MT9BunrgB4x5+ScoiPOeZlfbL1ctYTRG4HVcFUAX8SSrigZpcCWrJSdd1TqJPw8h5X9UOz Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=anatoly.zaretsky@gmail.com; spf=Pass smtp.mailfrom=anatoly.zaretsky@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f46.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of anatoly.zaretsky@gmail.com) identity=pra; client-ip=74.125.82.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anatoly.zaretsky@gmail.com"; x-sender="anatoly.zaretsky@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of anatoly.zaretsky@gmail.com designates 74.125.82.46 as permitted sender) identity=mailfrom; client-ip=74.125.82.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anatoly.zaretsky@gmail.com"; x-sender="anatoly.zaretsky@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f46.google.com) identity=helo; client-ip=74.125.82.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anatoly.zaretsky@gmail.com"; x-sender="postmaster@mail-wm0-f46.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B3AwCRsvJWki5SfUpeg1E1egaoRIcmhgaEfIFwIYRcgRACgTUHOhIBAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBAwESER0BGx0BAwELBgUEAQY3AgIiAREBBQEcBhMIGodvAQMKCA6iMoExPjGLNoFqgleGeAoZJw0VPIQPAQEBAQEBBAEBAQEBAQETAQUKBYYPhESCW4IOglOCVgEEkwSEVoFShB+IE4IzjFeNSREegQ8PGAmCKB6BUzouAYoKAQEB X-IPAS-Result: A0B3AwCRsvJWki5SfUpeg1E1egaoRIcmhgaEfIFwIYRcgRACgTUHOhIBAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBAwESER0BGx0BAwELBgUEAQY3AgIiAREBBQEcBhMIGodvAQMKCA6iMoExPjGLNoFqgleGeAoZJw0VPIQPAQEBAQEBBAEBAQEBAQETAQUKBYYPhESCW4IOglOCVgEEkwSEVoFShB+IE4IzjFeNSREegQ8PGAmCKB6BUzouAYoKAQEB X-IronPort-AV: E=Sophos;i="5.24,382,1454972400"; d="scan'208,217";a="209746305" Received: from mail-wm0-f46.google.com ([74.125.82.46]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 23 Mar 2016 16:18:22 +0100 Received: by mail-wm0-f46.google.com with SMTP id l68so200707664wml.0 for ; Wed, 23 Mar 2016 08:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=RqytM86NCXjP9qmhdCo0DLpb31b9EdsuYN8kDyNlXCI=; b=Y9hjIY9U+Bxn0UkUJ0auZUmOsKp+n0Fh5z3Xtnn/OY16HvPeu8T+vsiyu8n3DEIRAE Iutf1OcmK91KyLvzmZe82NsG9eDHSQFCHQQ0vkLqMrhY/IqQNPFZCOQTY+vAqUmte0Fg nwib6fri9n9kiLgdLaqMjQ+O0q2OMjXfnBwgeaAlbr8wg0SVTJ4adq4FsxBEUk/UVwzk b0RRr6oHg0Abpumh+TF1SMtWpKKuv5ZlETK7rvnw02K6CIsN0Owx4WqmE/k5nG33qMbR 9aXlAnYb0RICpFUxDuh/sZrE1rw+tDv9zH6+PvAo7wnSLS/iicOmSvUpvhWxBEkJbhn2 tXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=RqytM86NCXjP9qmhdCo0DLpb31b9EdsuYN8kDyNlXCI=; b=ASMwf7RDRUjxn2p2D0+63UGcBjqTYGvJNNFUPTV+HY/PEFfDB/mrSStMki+E+fVajW ePnsM5W2hw+pt2UU8U3EXyBlJT2nkcB7CF9fszfP3+At/K/B7ugR4sxfTQpS4krmFMjo +twuAesW1KqNoBySYqdk2YJp+4pM4MS4sDdpc5+/yL05dF535sm/kwaoT57rPR4tB6hR RgmHCsFaxcuwdygMHL788R2t0axiOyglBn3xakCNmRjGD3FpisUvEm6apc0u/inBsdpm 1abPnDmu0LoCAslsmQThNcfl5iHYKhjZMXrWGz5YEFluV8PIQ3NpsJS7ureB42qBWExj XydA== X-Gm-Message-State: AD7BkJLobTkDT1pM0Jlt+aBcE1Qx+yMTQ0KR+7Y6AHiYzNgiN6TT/0QMmjg/cWFz1abCYyAduhxpXRl3q1atmA== MIME-Version: 1.0 X-Received: by 10.194.78.83 with SMTP id z19mr3998940wjw.5.1458746302561; Wed, 23 Mar 2016 08:18:22 -0700 (PDT) Received: by 10.27.12.209 with HTTP; Wed, 23 Mar 2016 08:18:22 -0700 (PDT) In-Reply-To: <20160323105016.GA2235@frosties> References: <20160323105016.GA2235@frosties> Date: Wed, 23 Mar 2016 17:18:22 +0200 Message-ID: From: Anatoly Zaretsky To: Goswin von Brederlow Cc: OCaml List Content-Type: multipart/alternative; boundary=047d7bf0c29a2e8543052eb8d7e2 Subject: Re: [Caml-list] RFH: can't figure out why my QT5 widget bindings segfault --047d7bf0c29a2e8543052eb8d7e2 Content-Type: text/plain; charset=UTF-8 Hello. On Wed, Mar 23, 2016 at 12:50 PM, Goswin von Brederlow wrote: > I'm stuck with a bug in the Tetrix example for my QT5 bindings: > > https://github.com/mrvn/ocaml-qt5 > > The segfault happens when you click start and the first piece is moved > one tile down in caml_mrvn_QT5_OPainter_fillRect. The arguments to the > call all look ok but something must corrupt the painter. The segfault > goes away when I force a Gc.full_major before creating a new OPainter > in TetrixBoard:148. > Just a wild guess: there are a lot of raw c++ pointer casts to ocaml values in the code, and to quote http://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec424 "this can crash the garbage collector" in some non-obvious circumstances. --047d7bf0c29a2e8543052eb8d7e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello.

On Wed, Mar 23, 2016 at 12:50 PM, Goswin von Brederlow <goswin-= v-b@web.de> wrote:
I'm stuck with a b= ug in the Tetrix example for my QT5 bindings:

=C2=A0 https://github.com/mrvn/ocaml-qt5

The segfault happens when you click start and the first piece is moved
one tile down in caml_mrvn_QT5_OPainter_fillRect. The arguments to the
call all look ok but something must corrupt the painter. The segfault
goes away when I force a Gc.full_major before creating a new OPainter
in TetrixBoard:148.

Just a wild g= uess: there are a lot of raw c++ pointer casts to ocaml values in the code,= and to quote http://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec424 "this can crash the garbage collector" in some non-obvious circ= umstances.
--047d7bf0c29a2e8543052eb8d7e2--