From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id bK3yAYdXOWAVKgAA0tVLHw (envelope-from ) for ; Fri, 26 Feb 2021 20:18:15 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +Jq7OIZXOWDtIAAAbx9fmQ (envelope-from ) for ; Fri, 26 Feb 2021 20:18:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx2.migadu.com (Postfix) with ESMTPS id 5673A8FFD for ; Fri, 26 Feb 2021 21:18:14 +0100 (CET) Received: from localhost ([::1]:37126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFjYz-0002U8-Aj for larch@yhetil.org; Fri, 26 Feb 2021 15:18:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFjYo-0002RR-O7 for bug-guix@gnu.org; Fri, 26 Feb 2021 15:18:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59283) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFjYo-00074s-EC for bug-guix@gnu.org; Fri, 26 Feb 2021 15:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lFjYo-0004qK-7j for bug-guix@gnu.org; Fri, 26 Feb 2021 15:18:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46796: Cuirass & pointer finalization. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 26 Feb 2021 20:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46796 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Mathieu Othacehe , 46796@debbugs.gnu.org Received: via spool by 46796-submit@debbugs.gnu.org id=B46796.161437062518554 (code B ref 46796); Fri, 26 Feb 2021 20:18:02 +0000 Received: (at 46796) by debbugs.gnu.org; 26 Feb 2021 20:17:05 +0000 Received: from localhost ([127.0.0.1]:42596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFjXs-0004pB-Rb for submit@debbugs.gnu.org; Fri, 26 Feb 2021 15:17:05 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:43813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFjXr-0004oe-B6 for 46796@debbugs.gnu.org; Fri, 26 Feb 2021 15:17:03 -0500 Received: by mail-wr1-f44.google.com with SMTP id w11so9738688wrr.10 for <46796@debbugs.gnu.org>; Fri, 26 Feb 2021 12:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=C2LM1sjD3BMs58uH8Rc/InEhq3fyVzzSJVuhmeuOV4A=; b=eqVto3sOnEyXoiwPCgDfOWa+OhELnYSG/KqmLlp7Tu2pqGp98BxfXTLbgz0fB7jX++ L4Z+y8sO2c94sdFtWBVR0jx38VmkUUDJPbL7YwKcnD8ons7nG9kzbzsv5zA44M+yZjAU 4gM5VCFML2IYQ0kE47ZHMqMaQwKXQzOIisMAbtyvPlkIXw7ymyV/3Lel/lkJeb6FiPw4 1rtbOUm2Mu8+Qr0MdJUP4gllUzyczS3bmR8lfMaPOM76emo6ArWCs9OAW/hF9lwMZJ6a G1lsCu40OGPJZHmaRc4CWOt8qoO9tacD8BZHALnWRc10lyxcTUb2ZI40bBdzhW+KVo/m xX/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=C2LM1sjD3BMs58uH8Rc/InEhq3fyVzzSJVuhmeuOV4A=; b=LXNoH5A+gWbiMo5t9J+89Nl5Nx5HmVFhRNoLtOf0b2N2Eyt4cyDPmU2oT3tkBUr8JU OqWT6i24F+9DLUudNiLVlFsTZJW1kcLlFyJl1+fdQW+WSrMLPgB03ArlXzjkqa00eekE EXZKxLVOiJOHyq40Ea7y8szawWxR11jtACxHBBT5Ud2rmun8YCZZ5wLc2TkODSWuOvWh qjhPRaLmC8UZqO31CrlV6iTU0rtkOAyrHYNZTRso1yFwThpY5kX7WJz3ysWPAHgPMZnu LvKt4XACgz6vS5VVJ4x/WUaU3urKGklAp6+JeZblC0brc05rbQFhtTDTa/124HD4jPfc mKOQ== X-Gm-Message-State: AOAM533opPeUKsDIUhapVMMQdjq3DFCtV2zh6I8shuI8YQigKXBBukk4 mBeSmkYWgOEpSyyJI1PLOOsCYMOx7Rw= X-Google-Smtp-Source: ABdhPJyiW/6Bnr2/SlKwcJa/B7Ujw+XOpCt61X7usApv/obVlNz3u6qDwdn72zRZfvwwhvflmpNF5A== X-Received: by 2002:a5d:6cab:: with SMTP id a11mr4980652wra.419.1614370617403; Fri, 26 Feb 2021 12:16:57 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u4sm6503281wrm.24.2021.02.26.12.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 12:16:57 -0800 (PST) From: zimoun In-Reply-To: <8735xihq60.fsf@gnu.org> References: <8735xihq60.fsf@gnu.org> Date: Fri, 26 Feb 2021 21:12:56 +0100 Message-ID: <86im6e1tbr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614370694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=C2LM1sjD3BMs58uH8Rc/InEhq3fyVzzSJVuhmeuOV4A=; b=swanUE9GhgLmNpGZIPbd7bJrMPv89A7tWGQBiBhW7cJGa+WWHVjb0FYSzSJFz17oqDgpHQ ghvbskeLSa3xcbAlgtEewObSZ3+fLN05aq7UAhPusBT+hRHxU+ix9tpxqEiqeO/VFjkW2Z whks6Uhc3WiKOv+apR0DdgdTMSG6sbIeN7faTZPMxVs7KmJzq/b/Q72PPmsj+hOgfJ44eV xtRjVwVhc6zV9q5hGA4INe2Jjjl1nzZUVAIuGMeZU1MQI6qa1P48k4Zh3iy9nJo2IRB8Db 4un4Bylzpq341vi+kzGCli782O3AzOfxTr9GQvK5Xcp63Xx1XUC2gzSLpno2pA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614370694; a=rsa-sha256; cv=none; b=LUVQbfvo5/w2Q8pnwAoJjOJhr3SE8ChU9IGTBGOtj5i3PSEhngpPIlBdffp4mkesirwnIg Rzr+hMTzOelW1fK4fpJy3vs+8UeUIHTCTnPye2eByUwCkVYA91Ihz8jNaBUBZR0pnH4eAX UvmgKuOejM+TzwA47oi85AmSngJRVZZX/XFj+eSdVwSSHButtbkCfPMNxsKxJQvpTyWkbX btct83+NwbFH3J/IXYB56lZnWaprDo5jis0OWiNpgRc/WP7a6XmKTb0dsu9ViTOJGoe02n wxurf2kkcFGvhciIfxJx6Dt8VzHGOHYnOutGiq9Je0Zq3N9QqsVDcbZgtZ/QZw== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eqVto3sO; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.27 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eqVto3sO; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 5673A8FFD X-Spam-Score: -1.27 X-Migadu-Scanner: scn0.migadu.com X-TUID: vHIGZTDzvx0W Hi Mathieu, I know nothing about the topic and I probably out-of-scope. On Fri, 26 Feb 2021 at 15:14, Mathieu Othacehe wrote: > I'm trying to fix a memory corruption in the remote-server process of > Cuirass since a few days. Even though I don't have a usable core dump > file yet, I'm pretty sure the error comes from the "zmq-msg-init" > procedure of Guile-Simple-ZMQ. > > This procedure creates a bytevector, call the C function zmq_msg_init to > initialize it, adds zmq_msg_close as pointer finalizer and returns a > wrapped pointer. > > My understanding is that the wrapped pointer that is passed around in > Cuirass ensures that the underlying bytevector is not garbage collected > until the pointer goes out of scope. However, some assertions failures > such as this one: > > --8<---------------cut here---------------start------------->8--- > Assertion failed: check () (src/msg.cpp:394) > --8<---------------cut here---------------end--------------->8--- > > let me think that the bytevector is garbage collected, while ZMQ is > still using it. Some help would be much appreciated here :). >From =E2=80=99zmq-msg-init=E2=80=99 defined here: and why is =E2=80=99zmq-message-content=E2=80=99 used for? Since =E2=80=99= message=E2=80=99 is initialized with zero, I guess. Well, I am confused by: --8<---------------cut here---------------start------------->8--- (let ((content-ptr (zmq_msg_data (message->pointer message))) [...] (pointer->bytevector content-ptr size)))) =E2=80=A6 (let ((msg (pointer->message! msg-pointer))) (when content-bv (let ((target (zmq-message-content msg))) (bytevector-copy! content-bv 0 target 0 len))) msg)))) --8<---------------cut here---------------end--------------->8--- Is =E2=80=99target=E2=80=99 at the same address than =E2=80=99msg=E2=80=99?= Maybe =E2=80=99target=E2=80=99 creates somehow a dangling pointer. Cheers, simon