From unknown Tue Jun 24 22:36:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#56794 <56794@debbugs.gnu.org> To: bug#56794 <56794@debbugs.gnu.org> Subject: Status: Segmentation fault in purecopy while dumping - stack overflow attempting to copy cyclic Lisp value Reply-To: bug#56794 <56794@debbugs.gnu.org> Date: Wed, 25 Jun 2025 05:36:40 +0000 retitle 56794 Segmentation fault in purecopy while dumping - stack overflow= attempting to copy cyclic Lisp value reassign 56794 emacs submitter 56794 Lynn Winebarger severity 56794 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 27 10:07:57 2022 Received: (at submit) by debbugs.gnu.org; 27 Jul 2022 14:07:57 +0000 Received: from localhost ([127.0.0.1]:56596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGhhc-000560-OY for submit@debbugs.gnu.org; Wed, 27 Jul 2022 10:07:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:38956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGhhZ-00055m-8r for submit@debbugs.gnu.org; Wed, 27 Jul 2022 10:07:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGhhZ-000605-2I for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 10:07:53 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:46781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGhhX-0000h9-9m for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 10:07:52 -0400 Received: by mail-pf1-x42c.google.com with SMTP id c3so16194441pfb.13 for ; Wed, 27 Jul 2022 07:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=88YSDcM7cqJi9V/I53EYSTsC7lJWp07aTaAf0CRibao=; b=G59hz07OWsl8WbjzOQrKwfYax8zG+sexV4gMlPwVyT57r18rOiTEzKMiKNQGXaNGaV pbvu+A0lxFsIwpwj+zH7osmE2AuVuzz3kyzr79EDBeu6GlhTtYewBl2SHMAp8LOH6t+P 4KXYAuXNG7QQbUhu4Z8/wySBxwMfdi8hJhhfI8HumtZ2ifiCCrGlD5Z8YmOxqWBzMSMr a+LmxSgIRLdS5zDBDLBrBFZKyWkKzrggu4y/EGiHBIJ6onj0WCgiFr/M9TMc4FYyjuaj BNvQ0bGQNOAI0LmrNklJo0nYTFNaknys2MVnFdW9lqYBmXpnqK+kWlVorCKWc1LPj5TM jRVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=88YSDcM7cqJi9V/I53EYSTsC7lJWp07aTaAf0CRibao=; b=a0TBCIV0RICkQ2u1judgMgEb79GEN9LMdPLm11GfS6sPAlCjs7Ow/f4Hu5FD/LlbNY AxgogFuTBeRqz6MkizJPSx4RhkDz7g/01Z0/ImsKQ/46+UibL1nn7493gD4l5jGAlPHM I0LXInOVYCrTqGh/ehuw/gUiMtXzTMd5gagDKqSZ3Q/pLHFfk5ya2G8ffGAqRz/q2DQA iUqN9ZjfRFsnhYHG3dWex5uLuKzi6btHdFBveXTIwsg7R7uDHxO5Nx/6Ku6idG3ZfrqW DcucXN47OhFAWbZpomVP9vI2atvBBZ4vEjm0Kf9KQRLRDwS7ieIy/mMr4pQ10NBCPieZ 28Jg== X-Gm-Message-State: AJIora+v87IGsYcM2AUAoGoPeX3fW3b8nMOUcYrXQwnBJnP8Oxe172B7 AhwbPCXDifqlgcFLKUfec55E+S69gKhg3Aj1INmgCYPCM7g= X-Google-Smtp-Source: AGRyM1sMZTlynrT/rnCGb0SqTj6yHjWCHhcfXAnzyZzyaTPybFGbt09TaJdFkO1nuWVYgATYRrbE7Nc4Re9dC2/cWbY= X-Received: by 2002:a05:6a00:298d:b0:52b:cf1f:5738 with SMTP id cj13-20020a056a00298d00b0052bcf1f5738mr22156886pfb.0.1658930868495; Wed, 27 Jul 2022 07:07:48 -0700 (PDT) MIME-Version: 1.0 From: Lynn Winebarger Date: Wed, 27 Jul 2022 10:07:35 -0400 Message-ID: Subject: Segmentation fault in purecopy while dumping - stack overflow attempting to copy cyclic Lisp value To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000001fad1e05e4c9f143" Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=owinebar@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000001fad1e05e4c9f143 Content-Type: text/plain; charset="UTF-8" I apologize for not being able to include significant details of the build, as this is happening on a sandboxed system in a proprietary context. I've been attempting to dump emacs built from the 28.1 tarball with a large number of core libraries preloaded. I have observed segmentation faults when attempting to dump with native-compilation enabled and with native-compilation disabled. However, it only happened with one file (nxml/rng-pttrn.el) while dumping several hundred core libraries with native compilation. With native compilation disabled, the problem has appeared with both auth-source.el and emacs-lisp/eieio-core.el, the latter preventing me from proceeding much further in the dump process. Note these were both dumped successfully with native-compilation enabled. I used gdb to look at the backtrace after the segmentation fault while loading auth-source.el, and the stack was in a tight recursive loop in purecopy: for (i = 0; i < size; i++) vec->contents[i] = purecopy (vec->contents[i]); In this case the index I alternated between two values in each pair of stack frames: 0 and 10. I'm not familiar enough with the layout of lisp objects to recognize the pseudo vector type on site, but it's probably a byte-vector with a recursive call - the constants vector in slot 0, and the recursive binding in slot 10 of the constants vector. Plus, the fact that this started happening more frequently with byte-compilation only is suspicious in itself. Since I'm restricted to using official release tarballs with only local modifications, I'd welcome any hints on any "quick fix" to the problem aside from the long-term solution of just eliminating purecopy altogether (unless that can be done with a de minimis change to the code). Lynn --0000000000001fad1e05e4c9f143 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I apologize for not being able to include significant deta= ils of the build, as this is happening on a sandboxed system in a proprieta= ry context.
I've been attempting to dump emacs built from the 28.1 t= arball with a large number of core libraries preloaded.=C2=A0 I have observ= ed segmentation faults when attempting to dump with native-compilation enab= led and with native-compilation disabled.=C2=A0 However, it only happened w= ith one file (nxml/rng-pttrn.el) while dumping several hundred core librari= es with native compilation.=C2=A0 With native compilation disabled, the pro= blem has appeared with both auth-source.el and emacs-lisp/eieio-core.el, th= e latter preventing me from proceeding much further in the dump process.=C2= =A0 Note these were both dumped successfully with native-compilation enable= d.
I used gdb to look at the backtrace after the segmentation fault whil= e loading auth-source.el, and the stack was in a tight recursive loop in pu= recopy:

for (i =3D 0; i < size; i++)
vec->contents[i] =3D purecopy (vec->content= s[i]);
In this case the index I alternated between= two values in each pair of stack frames: 0 and 10.
I'm not familia= r enough with the layout of lisp objects to recognize the pseudo vector typ= e on site, but it's probably a byte-vector with a recursive call - the = constants vector in slot 0, and the recursive binding in slot 10 of the con= stants vector.=C2=A0 Plus, the fact that this started happening more freque= ntly with byte-compilation only is suspicious in itself.
Since I&= #39;m restricted to using official release tarballs with only local modific= ations, I'd welcome any hints on any "quick fix" to the probl= em aside from the long-term solution of just eliminating purecopy altogethe= r (unless that can be done with a de minimis change to the code).

Lynn


--0000000000001fad1e05e4c9f143-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 27 19:06:52 2022 Received: (at 56794) by debbugs.gnu.org; 27 Jul 2022 23:06:52 +0000 Received: from localhost ([127.0.0.1]:57201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGq79-0004lP-Oy for submit@debbugs.gnu.org; Wed, 27 Jul 2022 19:06:51 -0400 Received: from mail-oi1-f169.google.com ([209.85.167.169]:40838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGq76-0004l7-AK for 56794@debbugs.gnu.org; Wed, 27 Jul 2022 19:06:50 -0400 Received: by mail-oi1-f169.google.com with SMTP id c185so532052oia.7 for <56794@debbugs.gnu.org>; Wed, 27 Jul 2022 16:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=mxPrVlKOWwma8FhFL0eZtDGSxLaid949KwNi7s/pDFI=; b=gR521yZPkBFoEWK/iUc0wUk/olMr/G0hwBCbDVLt9S7aL1a7zJNXZHqnNtubzdIUcG IGrIOHH371EbRMzVU0aFT72KFjmAFOoW9vVHFZuhsciDOI+c+Ji3zX/IDO//0p1awYfb XLK7sCbYdE+Gt6ve73RZGRVXzpQjkgsNCdUP+Pr+nqhwZ5m5EuBAsfEu9nDzOLG1oSvz UG4wdTH//fpk8OKI2wWFAmX9dBpHqAfsO8dZ3ShRNCEyXCahqaN8p1AYOuckwrTkF9ju E2DslT7gG3Fiu89rPNTFMd/wQ1Ag+a289H+0ivOlh3q3nljiIGr9BXwr/3Vd1sxI+llq sapA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=mxPrVlKOWwma8FhFL0eZtDGSxLaid949KwNi7s/pDFI=; b=L7keM8x/YYcMRmGyly9a4ZChN8B3nv5aTnNGq4ZFWHZAInQn8gGsIy32NAlcngmTpm 0JyizXBv1pbbvSIkS/jP6Kknlu6V4gngYaVmOOS9HU2gIzvmcwktgP0rxsKDboeDe9YH b43EB9UjbfAzNxSMlrlLMjkL8d8003Vby75DD4DiMAxtKOd5cdxoGr0CGmNFbY8EKOZ0 S3eYIi6znyFhIwfKGt1/ACe9/2VM8S4v8Wq6cdIT17v16VP2mRPKNje2+JlX13Eb5dfY ZMYq0AkUa2yObjhG/MbKxjbBSeWxyaGkhWOh8i53zI8jSIADPVftiukjSJ3tn3LMhYdV 5Plw== X-Gm-Message-State: AJIora8URNRCwgzw8ejBPpVcwcSz9MspAtF0Pmc28EjrkYt/oFwN7uig NLOf1aqxWWWmJEIP0gHgwbjL8DhHHYCVGFkkltblTfi5 X-Google-Smtp-Source: AGRyM1uV4NUVf5bBHwQ2UNqnM5nBLitGk1UQBfTdjCRAqcFN1TD5xEPSACN5Xg8a4jjvXLs7biPrNONOXjy5HMAdmRg= X-Received: by 2002:a05:6808:e89:b0:33a:315a:eb90 with SMTP id k9-20020a0568080e8900b0033a315aeb90mr2836089oil.162.1658963201647; Wed, 27 Jul 2022 16:06:41 -0700 (PDT) MIME-Version: 1.0 From: Lynn Winebarger Date: Wed, 27 Jul 2022 19:06:28 -0400 Message-ID: Subject: Recompiled with proper debugging flags and found the offending object To: 56794@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 56794 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The cyclic object is a record with the type field (index 0) set to the eieio-default-class, which has the cyclic record at index 10. I don't know if this is a bug in itself or not. I put a check for this case in purecopy (splitting off the RECORDP case), printing a message whenever a record with a non-symbol entry 0 is encountered. So far it's only this one. Also, it seems weird this was not an issue for the build with native compilation enabled. Lynn From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 12 09:02:37 2025 Received: (at 56794-done) by debbugs.gnu.org; 12 Feb 2025 14:02:37 +0000 Received: from localhost ([127.0.0.1]:33400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiDK1-0008A7-2Q for submit@debbugs.gnu.org; Wed, 12 Feb 2025 09:02:37 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:53581) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tiDJz-00089s-Q2 for 56794-done@debbugs.gnu.org; Wed, 12 Feb 2025 09:02:36 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-ab7f76aeedbso80602566b.3 for <56794-done@debbugs.gnu.org>; Wed, 12 Feb 2025 06:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739368949; x=1739973749; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=94eyc/jjav8aGagkbeUWsC3p1dNLME5XIQY4MOcjjCM=; b=CUS3WDY4qRh91k5Z2sAxWGolPo5XwVty7by7UIvUuNoW+JA2gnR+ROWB9+QoPOrtSB KUPu0EZDdnnOt7Tw5BRIY/SBTyasAt+d827Ab7Q0aW1Liod2++4GERDpi4QJTCzlnmym ETv15LF0uAMgmOvu9njDvTdaM/+3BZTU2H32WJ0yvfi+zukHYkNYPBVR2nqU0yqPtuDQ 0HB3vdxfiy9vsTs2pGG9DRmUFRJogJPGQ5Hzdi+pSUcAwzSfmybxEtXWndimq9PO5aON Q5OpZnF8tLqwtkKLB7gFrZ7deIz09miYU1yQBDArZ1gBOmJRF6JDqX/SkB0jHMyf6TaE vlDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739368949; x=1739973749; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=94eyc/jjav8aGagkbeUWsC3p1dNLME5XIQY4MOcjjCM=; b=GonchW4anOtoUM0QPbzD7BrM6/K+/UiMxHcGXEWpgey/I+pi3xywp/OpxT+UPiRHo0 yMm1BRF/WBi0P1jlpDKywf/tLKBRh3IpkABkYPQigPlF5+AZNwpPG0u6M9bDh3W21uYR SZ2JryRhzu5OXh/HON87c0S5Ri2dI3b4G/mbgAc1lkNDIOeBHizp6BOhp7gKAI2ayTzT Gb6Cl06+lLqTWciRKI05TLEagyFtQ9UKebWdlQv8JZJz7LGQEji4czVoWLL7fg9KqNAc DDcfIHocGCBx15ih2GwvDQQI3CqQMxaWm1sBem6VRftyIW6QvmMO4DJk5a4uRl6Xzg9n UtTw== X-Gm-Message-State: AOJu0YyTZVig5UMeH+KQnNaZKC4XfQdxvTErZH959p2hqL2oxGXfU/ES tihzEo0T5IT5z+yW4uvrB8+QvZw6Rv3kTqIw2zQFWID+oJWxxDB/ONuxR/hSwZKYhTjVf2y0OTT zqTSwWJISaYzAMMZuOvJLAGtSZOk= X-Gm-Gg: ASbGncuzhlPGxk/DKJgrR7dBO/jXyJI7gsTFAeHQEzwRnwJweiZBnUyadxAACKjLEI9 fneEa6wrdqr0otTYV+jxd9P+f2WLYqduoiCPIa3mRg36iuqGq6rFkiCL7v8nNcD0hio1TTCHWW3 0= X-Google-Smtp-Source: AGHT+IEsTl6iGDqtyuyNMY142nyCxQhzGibI0rvneKgqoi39fyGZ7fw34ZdqWwL+Piybz/pZAvIxZesPdUk/nkYrqYU= X-Received: by 2002:a05:6402:460a:b0:5d0:9054:b119 with SMTP id 4fb4d7f45d1cf-5deadddd593mr6890290a12.21.1739368949001; Wed, 12 Feb 2025 06:02:29 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Feb 2025 06:02:28 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Wed, 12 Feb 2025 06:02:28 -0800 X-Gm-Features: AWEUYZmO-3srQkMHeD_26Ar9Z6J21UrgaF6mSD9IXILtzEtUyhjGOB8lbCmUhDc Message-ID: Subject: Re: bug#56794: Segmentation fault in purecopy while dumping - stack overflow attempting to copy cyclic Lisp value To: Lynn Winebarger Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 56794-done Cc: 56794-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lynn Winebarger writes: > I apologize for not being able to include significant details of the build, as this is happening on a > sandboxed system in a proprietary context. > I've been attempting to dump emacs built from the 28.1 tarball with a large number of core libraries > preloaded. I have observed segmentation faults when attempting to dump with native-compilation > enabled and with native-compilation disabled. However, it only happened with one file > (nxml/rng-pttrn.el) while dumping several hundred core libraries with native compilation. With native > compilation disabled, the problem has appeared with both auth-source.el and > emacs-lisp/eieio-core.el, the latter preventing me from proceeding much further in the dump process. > Note these were both dumped successfully with native-compilation enabled. > I used gdb to look at the backtrace after the segmentation fault while loading auth-source.el, and the > stack was in a tight recursive loop in purecopy: > > for (i = 0; i < size; i++) > > vec->contents[i] = purecopy (vec->contents[i]); > > In this case the index I alternated between two values in each pair of stack frames: 0 and 10. > I'm not familiar enough with the layout of lisp objects to recognize the pseudo vector type on site, but > it's probably a byte-vector with a recursive call - the constants vector in slot 0, and the recursive > binding in slot 10 of the constants vector. Plus, the fact that this started happening more frequently > with byte-compilation only is suspicious in itself. > Since I'm restricted to using official release tarballs with only local modifications, I'd welcome any > hints on any "quick fix" to the problem aside from the long-term solution of just eliminating purecopy > altogether (unless that can be done with a de minimis change to the code). With the removal of purespace on master, `purecopy' is now an alias for `identity', so I don't think there's anything more to do here. Thanks for reporting it, nevertheless. I'm therefore closing this bug report. From unknown Tue Jun 24 22:36:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 13 Mar 2025 11:24:29 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator