From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#75292: 31.0.50; igc: (file-error "Doing vfork" "Bad address") Date: Fri, 03 Jan 2025 19:11:58 +0000 Message-ID: <8734hzk91d.fsf@protonmail.com> References: <87pll5qexm.fsf@localhost> <87cyh5kksp.fsf@protonmail.com> <87y0zrg4om.fsf@localhost> Reply-To: Pip Cet Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7091"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75292@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 03 20:13:39 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tTn74-0001fD-P7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jan 2025 20:13:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTn6d-0004ms-N2; Fri, 03 Jan 2025 14:13:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTn6V-0004mU-8E for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 14:13:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTn6U-0005yH-VG for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 14:13:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=397IDHPpKIsIiAnrW26awQ9v0dOXmRiLt7QbDkavJOk=; b=cZ1l9O5v3U0MmTKFlnazbhevDk2RDeQkEl669d3ZZGBS1NpdbqKTZcT7EevvJ8qrw+tkclKV93x5ETrDwtgw5Oan1AxwsYpsUEi+ktsPcZpM9/HyNz8luc8PDuAiExj/LCNTRGAL7i5N4zrFUpoJi7j2gJZQm4o84TvPhngvgOai3v1xMx5KfHtqSYQLP+HjcN5PXG+gZcL3m3OMLvVGM+MkaiSnKxZ+Lk3eO7G7y9apQVAco4RE2KhPN3iv/iXYjHacqV1lJkcI4lkPqxHEPcbsv33almWuwE0y9/7MPITGQ+Jz9Ez+2OxxcpFKCyRWO6a+YBoj5pSjer42u1/VYg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTn6U-0002fz-GE for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 14:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jan 2025 19:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75292 X-GNU-PR-Package: emacs Original-Received: via spool by 75292-submit@debbugs.gnu.org id=B75292.173593153310177 (code B ref 75292); Fri, 03 Jan 2025 19:13:02 +0000 Original-Received: (at 75292) by debbugs.gnu.org; 3 Jan 2025 19:12:13 +0000 Original-Received: from localhost ([127.0.0.1]:52105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTn5h-0002e4-16 for submit@debbugs.gnu.org; Fri, 03 Jan 2025 14:12:13 -0500 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]:28709) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tTn5d-0002d0-IO for 75292@debbugs.gnu.org; Fri, 03 Jan 2025 14:12:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1735931521; x=1736190721; bh=397IDHPpKIsIiAnrW26awQ9v0dOXmRiLt7QbDkavJOk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=U4tcx60m/OOfwTvojpg8xKFSiJ/6tZDk/AcqoZaXeiwQSUq8XRJz8u4OJRGxklsHU kXD2hnVIf4SBJYjRm0O3q1OScw/wUBqdjV8sU5U0NpHcVmTt4w04P8QvCn0HPqiIqK U/g30f9QM4Zv9N7UFaHDxULhvTu9MPzmuF9qryqzwOEyWEUjt0thsfxRgDA8mmEWSc J9yS1QZMGkCpeOVCFOCTFH0ocJZgtw4KeWd7omL7JFeGm52Pz0Fq1cu/Us0RKS+hzd 5rLWlbixqFxOhpGPwT1V8dEaeWtx4gtU3ZpAf9y3FNJj38qlEiJQeQSIhg7VSFNEqY cXK0CADbQuUDg== In-Reply-To: <87y0zrg4om.fsf@localhost> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 30c1ddb458590515c1c57b22cf39a4587d60a942 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298301 Archived-At: Pip Cet writes: > "Ihor Radchenko" writes: > > The most likely candidate right now is make_environment_block, which > happily stuffs string data pointers into an xmalloc'd block and goes > about its merry way without letting GC know about them. I think it > would cause the problem you observed, but haven't managed to reproduce > it yet. If I manage to do so, I'll push a fix. There's definitely a bug there (inserting an igc_collect() will corrupt the environment), and I'll fix it, but I'm a bit puzzled by the "Bad address" thing, and I think there may be an additional bug (making four overall for this very productive bug report): How do syscalls and execve(), in particular, handle the case of a pointer to MPS-managed memory which is behind an active memory barrier? I'm pretty sure there's no SIGSEGV in this case, just an EFAULT. Easily fixable for execve, which accesses only a limited amount of data, but I don't remember whether we ever read() or write() MPS-managed memory, which I assume would eventually run into this bug. If syscalls silently accept mprotect()ed mapped areas which are currently inaccessible (they really shouldn't because it breaks w+x protection!), that's an additional problem we need to work around, because the memory contents might not be valid. I don't think we(*) ever read() or write() Lisp_Objects and expect useful results, so maybe everything's okay in that case? (*) - the fork()-based mark-and-sweep GC did, so it's not entirely unreasonable to do that :-) Pip