From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: mmap for guile Date: Tue, 19 Jul 2022 15:34:54 +0200 Message-ID: References: <56ee7537-1666-3d04-7093-732a75624e9b@gmail.com> <0cf4e4ee80169487694b844996e04f3293eab92f.camel@telenet.be> <87k08tfau0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25137"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.42.1 Cc: guile-devel@gnu.org To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , guile-user@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Jul 19 15:35:24 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDnNk-0006Iz-6u for guile-devel@m.gmane-mx.org; Tue, 19 Jul 2022 15:35:24 +0200 Original-Received: from localhost ([::1]:50144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDnNi-0004A1-P3 for guile-devel@m.gmane-mx.org; Tue, 19 Jul 2022 09:35:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDnNN-00047x-HD for guile-devel@gnu.org; Tue, 19 Jul 2022 09:35:01 -0400 Original-Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:48478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDnNJ-0007gg-Fr for guile-devel@gnu.org; Tue, 19 Jul 2022 09:35:00 -0400 Original-Received: from ptr-bvsjgyig5nh0salm0pi.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by laurent.telenet-ops.be with bizsmtp id x1au2700H20ykKC011ave3; Tue, 19 Jul 2022 15:34:55 +0200 In-Reply-To: <87k08tfau0.fsf@gnu.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1658237695; bh=XsDxoGOqv+yuCnuMeMb3j2ZHOa++4OvokJw1Yr/1Trk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=QxVBTGnEHowx4YescRwtz6HdCXvEbYujqj6tTfQhfmnxKOrvJEcGqOyUkILLKrsd8 TQ07pj1svjvbI+V/VH2nbEGaVx1QHQKWnwL8zIU3VX3p0OzqA3wRtOXb0e+gnyyB0H 3dkYz/qtsK0b5AS4u3bXBE4p3DTtHntPP4v5d5kXVRzLUObuIbFg7d730RIZgpujfZ veT9UWaeEq6/yw+Q0jf+2nPcPbPa3fzn+AMs6qv7vVEdT9quYPqOnagRs0KX/5aAEn 1KV486KZdrlVG9BXsAa6HgbNghzRJN6ZCD729MpuJHrShb8JcIfj2RV5OnW0NHaMKv VxjnTokJboJKw== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21257 gmane.lisp.guile.user:18430 Archived-At: Ludovic Courtès schreef op ma 04-07-2022 om 12:09 [+0200]: > > Also, what if you mmap a region, use bytevector->pointer and pass > > it to > > some C thing, which saves the pointer somewhere where boehm-gc can > > find > > it and boehm-gc considers it to be live, is there something that > > prevents boehm-gc from improperly calling the finalizer & unmapping > > the > > region, causing a dangling pointer? > > There’s a risk, but I don’t think it’s specific to mmap. AFAIK, make-bytevector doesn't have an issue here, so by default I would assume mmap to not have it either, unless documented otherwise. However, I am not seeing tests or analysis that verify there's no issue here even though plausibly there might be an issue and neither am I seeing documentation that this doesn't work (for mmap in specific, or more generally). Greetings, Maxime.