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 5C69D7EE36 for ; Wed, 23 Mar 2016 18:18:36 +0100 (CET) IronPort-PHdr: 9a23:Vxel2BSTg2NoeMhSeoMpWpziktpsv+yvbD5Q0YIujvd0So/mwa64YBSN2/xhgRfzUJnB7Loc0qyN4/CmADJLsMnJmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviq9uKPU4Z23KUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrVdCHEiMnspzMztrxjKCwWVtVUGVWBDvABBBYfC7QrNdJD7tTey4uRn0S+ROsztC7ozUzO+x6xmQVnmknFUZHYC7GjLh5ko3+pgqxW7qkknzg== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=francois.bobot@cea.fr; spf=None smtp.mailfrom=francois.bobot@cea.fr; spf=None smtp.helo=postmaster@oxalide-out.extra.cea.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=pra; client-ip=132.168.224.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=mailfrom; client-ip=132.168.224.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@oxalide-out.extra.cea.fr) identity=helo; client-ip=132.168.224.8; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="postmaster@oxalide-out.extra.cea.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DfAQCiz/JWkwjgqIRehAZ6AbxlIYRcgRACgT07EQEBAQEBAQEBEAEBAQEJCwkJIS+CLYIVAQEEIw8BBUARCxgCAgUWCAMCAgkDAgECATQREwYCAogOAxIOsEmLfSKESwEBAQcBAQEBAQEBGXyJZoJbgi2CNIJWBZdahXGKRocDhVSPBzaCQIFSaQGKCgEBAQ X-IPAS-Result: A0DfAQCiz/JWkwjgqIRehAZ6AbxlIYRcgRACgT07EQEBAQEBAQEBEAEBAQEJCwkJIS+CLYIVAQEEIw8BBUARCxgCAgUWCAMCAgkDAgECATQREwYCAogOAxIOsEmLfSKESwEBAQcBAQEBAQEBGXyJZoJbgi2CNIJWBZdahXGKRocDhVSPBzaCQIFSaQGKCgEBAQ X-IronPort-AV: E=Sophos;i="5.24,383,1454972400"; d="scan'208";a="170442381" Received: from oxalide-out.extra.cea.fr ([132.168.224.8]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Mar 2016 18:18:13 +0100 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by oxalide.extra.cea.fr (8.15.2/8.15.2/CEAnet-Internet-out-2.4) with ESMTP id u2NHICX2031575 for ; Wed, 23 Mar 2016 18:18:12 +0100 Received: from pisaure.intra.cea.fr (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 7B56F20B869 for ; Wed, 23 Mar 2016 18:19:01 +0100 (CET) Received: from muguet1.intra.cea.fr (muguet1.intra.cea.fr [132.166.192.6]) by pisaure.intra.cea.fr (Postfix) with ESMTP id 67BCC20B843 for ; Wed, 23 Mar 2016 18:19:01 +0100 (CET) Received: from [10.8.32.80] (is222783.intra.cea.fr [10.8.32.80]) by muguet1.intra.cea.fr (8.15.2/8.15.2/CEAnet-Intranet-out-1.4) with ESMTP id u2NHICWa018275 for ; Wed, 23 Mar 2016 18:18:12 +0100 To: caml-list@inria.fr References: <20160323105016.GA2235@frosties> From: =?UTF-8?Q?Fran=c3=a7ois_Bobot?= Message-ID: <56F2CFD4.4000401@cea.fr> Date: Wed, 23 Mar 2016 18:18:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Icedove/44.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] RFH: can't figure out why my QT5 widget bindings segfault On 23/03/2016 16:18, Anatoly Zaretsky wrote: > 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. And in the future of no-naked pointer it will be forbidden. Perhaps it should be added to the ocaml documentation with the precise future rules [1]. The segfault is in C++ code, so I think it is not this problem. Moreover no asserts of the debug runtime are broken. On debian I don't know how to install qt5 in debug mode, so I'm not able to see in gdb which pointer is at fault. NB: the INSTALL file forget to ask to install qt5 development file, even if it is obviously needed ;). [1]: https://github.com/ocaml/ocaml/pull/297#issuecomment-159233967 -- François