From unknown Sat Jun 21 05:15:02 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#31238 <31238@debbugs.gnu.org> To: bug#31238 <31238@debbugs.gnu.org> Subject: Status: Dynamic Module Crash Reply-To: bug#31238 <31238@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:15:02 +0000 retitle 31238 Dynamic Module Crash reassign 31238 emacs submitter 31238 Tu=E1=BA=A5n Anh Nguy=E1=BB=85n severity 31238 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 22 12:31:27 2018 Received: (at submit) by debbugs.gnu.org; 22 Apr 2018 16:31:27 +0000 Received: from localhost ([127.0.0.1]:35965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fAHte-0007tw-V5 for submit@debbugs.gnu.org; Sun, 22 Apr 2018 12:31:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fADH9-00010c-AZ for submit@debbugs.gnu.org; Sun, 22 Apr 2018 07:35:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fADH2-0000Zd-Q0 for submit@debbugs.gnu.org; Sun, 22 Apr 2018 07:35:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, FROM_EXCESS_BASE64,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fADH2-0000ZS-Mi for submit@debbugs.gnu.org; Sun, 22 Apr 2018 07:35:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fADH1-0006eh-Gf for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:35:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fADH0-0000Y9-DA for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:35:15 -0400 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]:39522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fADH0-0000Xm-3F for bug-gnu-emacs@gnu.org; Sun, 22 Apr 2018 07:35:14 -0400 Received: by mail-io0-x229.google.com with SMTP id v13-v6so15275810iob.6 for ; Sun, 22 Apr 2018 04:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=czYCUJFFUOCEZZX1u26iwojP4GT0l7J7OOXtzWgWeUE=; b=SoI4fetFkvsK731OoGA1yr0YiLgx5nyiDxcmad+mIzKOT5JFTosaScDWc0IHgBssdk 2vRVMWwXTJLazzg25JdfBevmqf8MEnKsgHGMMpn4ONYdjZ7zvX1quwYjswY/sn4prvqw qx6c8lMkT5NjvyI8vbJt6NJYsEdwG9nUZ0iepPRd5CXSpnTTFul6WpGpuTEq/h9B/12X /y/l3ZLzARv1dBuOk7V0QBvhQnRKXUqaLHto0Rhe2vvLBOa0N5q85KIWk7idFRZmzxoc 1eeCxfgEzop0sEh3AOUWrfgUtKdLzdz61cb/PoQAAhXeGzdyyexVJ/bE/Ut6VbOOIbx2 UvYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=czYCUJFFUOCEZZX1u26iwojP4GT0l7J7OOXtzWgWeUE=; b=QLmfSYKWT06sNgG3YIB53k5BGG/zcndozvHDSBIKEeG7ZxbKS2zrU+rZjz8Np+3lYj R7OwX9fLKLdVN18Vo71heZZxUXQ46vMP0QbJtej7MlUCDr6rlMcQA6sRzWVlK1i3JY9g I4VvjH99EXJRMwxQ76XzdmBcEihbjSqI0rdlsqOJtVKSr93PzuLUhE7Z53ePO9UYUS6j erzpCa1H96Hv6n9ilt1K45SgZ6+m9P8Uv4xuLjpVoZQ67uR312j3YEmNND58CYAMq/B/ tpMaoNkEMwVx5HOKFJ8yxm1/c9yGsnFUau6C6WT2p+z/KEKJoeEIcTEQEPHoJqDeMlTi VbHQ== X-Gm-Message-State: ALQs6tC4nPIB4jL8tvL7KZmyF/8/B4IzP0MvIeLXZuNZhsDL3UjvCEEB nzoesldyc9uty0MMZ2ouoIM7oz4a7yV6/7Suol1jog== X-Google-Smtp-Source: AB8JxZqH4esMuEUM4ZSxO29UJns/5TU3SPHIl4oebWefD8i117Si3fpYidiKTcfpocSh4VlX5wLBXseKgKCch9Guj18= X-Received: by 2002:a6b:2193:: with SMTP id h141-v6mr16831176ioh.235.1524396912385; Sun, 22 Apr 2018 04:35:12 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?VHXhuqVuIEFuaCBOZ3V54buFbg==?= Date: Sun, 22 Apr 2018 11:35:01 +0000 Message-ID: Subject: Dynamic Module Crash To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="00000000000075a3b7056a6e505c" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 22 Apr 2018 12:31:24 -0400 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: -4.9 (----) --00000000000075a3b7056a6e505c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Emacs 25.3.1 crashes with a segfault when trying to print a value constructed (in certain ways) by a dynamic module. Reproduction: https://github.com/ubolonton/emacs-module-crash Context: https://github.com/ubolonton/emacs-module-rs/issues/2 --=20 Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer --00000000000075a3b7056a6e505c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Emacs 25.3.1 crashes with a segfault when trying= to print a value constructed (in certain ways) by a dynamic module.
Reproduction: https://github.com/ubolonton/emacs-module-crash

Cont= ext: http= s://github.com/ubolonton/emacs-module-rs/issues/2

--
<= div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature= ">
Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n
Software E= ngineer
--00000000000075a3b7056a6e505c-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 24 10:08:18 2018 Received: (at 31238) by debbugs.gnu.org; 24 Apr 2018 14:08:18 +0000 Received: from localhost ([127.0.0.1]:38319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fAycE-0007bp-AY for submit@debbugs.gnu.org; Tue, 24 Apr 2018 10:08:18 -0400 Received: from mail-ot0-f174.google.com ([74.125.82.174]:36447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fAycD-0007bd-4W for 31238@debbugs.gnu.org; Tue, 24 Apr 2018 10:08:17 -0400 Received: by mail-ot0-f174.google.com with SMTP id p2-v6so21389640otf.3 for <31238@debbugs.gnu.org>; Tue, 24 Apr 2018 07:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zjeGKPCxX0XYUMwi6WSLojgomJZcDl+Wjp5kIIXQObY=; b=CUwBQDuaJWIpwO3OmbPCahYFTaSsU3Dm4iUNb41munyqDC7vE+9cUoavNG8uU17yT2 mlefh/1J0wbruPPHrhrieu4MjUJPGOAF9N6rIM0cSOoqIFzb/HNgskYyUt/X4yiqUQr8 wKYyxMOyn+DJ1LxJNSOxAqrih2q8pE3kpyfpffVjk9yCvXNB0UvP9ofMx/5XKpyAOi2l IPW+gSx01dBbq8vBAMDVXcK8rfBrroXt4Cbn9hvPZHBRkYoyd/Vzm5ynCWFDoXVAwe2Y Uws5cWzKytHRKizbuPQ1NT5bq+Gmrzk58oxVYVAzz7zV9L9UEiDWD9nUzzo7zsaBRVMI TiIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zjeGKPCxX0XYUMwi6WSLojgomJZcDl+Wjp5kIIXQObY=; b=iWwM4kv3j4uHmR3/+ET+//mgxfV3Jmn7ylarF7M/aJe5aQy+AyMnAtmL93JV4SkSr/ PDCZboOhChTyZnwz8Qp/bvyQVhaN90v2NDFxBcJARVt4aLX8vDqJCvGToEkFgK5S8kso LpjvvU8Ff+RTljShhcwrQMCvGbAdC82tudJe/hhI2rKO3wKyZBlSN+FDqWZnUx5tzaGo riVKZucV8f7sdXFw+IJCt7LQ8lTBcwNheXEncxx7IzgWYfxo+fuPdAl8KZo/hTWLP0va wWFMdhnIiH+ieCKs9NWDc3EQt8I4vMHFWAcmPmB+GS0YgxjOcMFiwmmOU0u3Pbic0MCw YIeg== X-Gm-Message-State: ALQs6tAz/exwUTA8P9WNrspf4NUuPU+aKsG++PCg0EfwAEJeUVTijOyh /u30Nmmbsu1rRpe3J4Bn21Riq492Wf2OUazH7Ds= X-Google-Smtp-Source: AIpwx4800ROLny7hkmhvQJDfKl3aLb26HysrziqPrrKc2iZiISDf748XHv95JFa9JUWMLTEhgyPJLz7/TLX3Oal4XSs= X-Received: by 2002:a9d:255b:: with SMTP id j27-v6mr11379188otd.316.1524578891577; Tue, 24 Apr 2018 07:08:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Tue, 24 Apr 2018 14:08:01 +0000 Message-ID: Subject: Re: bug#31238: Dynamic Module Crash To: =?UTF-8?B?VHXhuqVuIEFuaCBOZ3V54buFbg==?= Content-Type: multipart/alternative; boundary="00000000000043bfd0056a98af3f" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31238 Cc: 31238@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: -0.7 (/) --00000000000043bfd0056a98af3f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Tu=E1=BA=A5n Anh Nguy=E1=BB=85n schrieb am So., 22. A= pr. 2018 um 18:32 Uhr: > Emacs 25.3.1 crashes with a segfault when trying to print a value > constructed (in certain ways) by a dynamic module. > > Reproduction: https://github.com/ubolonton/emacs-module-crash > > Context: https://github.com/ubolonton/emacs-module-rs/issues/2 > > This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, which removed GC protection for module-allocated values. --00000000000043bfd0056a98af3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Tu=E1= =BA=A5n Anh Nguy=E1=BB=85n <ubolo= nton@gmail.com> schrieb am So., 22. Apr. 2018 um 18:32=C2=A0Uhr:
=
Emacs 25.3.= 1 crashes with a segfault when trying to print a value constructed (in cert= ain ways) by a dynamic module.

Reproduction: https://github= .com/ubolonton/emacs-module-crash

Context: https:= //github.com/ubolonton/emacs-module-rs/issues/2

This might be caused by commi= t=C2=A03eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, which removed GC protectio= n for module-allocated values.=C2=A0
--00000000000043bfd0056a98af3f-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 13:17:04 2018 Received: (at 31238) by debbugs.gnu.org; 21 Sep 2018 17:17:04 +0000 Received: from localhost ([127.0.0.1]:48427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3P38-0006Lx-W2 for submit@debbugs.gnu.org; Fri, 21 Sep 2018 13:17:03 -0400 Received: from mail-ot1-f54.google.com ([209.85.210.54]:33724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3P37-0006LK-6e for 31238@debbugs.gnu.org; Fri, 21 Sep 2018 13:17:01 -0400 Received: by mail-ot1-f54.google.com with SMTP id i10-v6so13755330oth.0 for <31238@debbugs.gnu.org>; Fri, 21 Sep 2018 10:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LomAXdtworMbt97PSIPV/5vNTXDxkfYtXY/EUTO9mUU=; b=ri86Xi7ERv6H041JvAMgLMCi2b5R1qYoiFlQ7wnv4rKHAuch00BzdoNjPEJxzJVRdJ uGCJDgIy69f64sjUdLJEaCkJp8XGphhs6yN6iQ+eoi90HJm+u1ozxOZaMj5VPQoFEBQg 159h7mPXYfnvLuzwl5pnIL5P+N+pfiVe1ynLgAbwdJ9ygCx3ZtbfJ+b4SgpNPx6G30Rb +r7Aiplfs4oDbEbRw6uT6dDyS862A3dvPASScolUX9bHiCNQDhDgkOAhIjmxN0iPcwGZ /prLNDjaiViO5cb7iRR/vFRgTJXz119oha2Kn/KhbdTq+D14gBNYeTG6CBz3eskQrXiI VemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LomAXdtworMbt97PSIPV/5vNTXDxkfYtXY/EUTO9mUU=; b=MDeTckMlCfj1KRGCFhQNMgo8Q8uE1HjTC3V6SF7aAhQ3wxaM+YqCquZMiR6Os0kFIQ hja58mq4OLcgjFgxZCzTOFjiAl3hHFv15sPfP/caW/JUWQaYHuteLTKOHU1qbSL2hZJp 5kr2KUOwHTlHZCYlo+TOxrnxlJj7DUP5GVMmlQ5jk+24gG98uLJbiFpsIoHDp/8gpyNJ zeSz3hA5lN7xdxYFXYt6gPZvIwgdUnTwIsO3mlBKfmYZdtylr+AkGJObviKe/0Owyd6m oMB6WmDPF+ygOdbyIEf7AIe9eGzWb94R8s6/P7CuQ3YRElun9A3EI89XdwFS3hH62RaC wnSQ== X-Gm-Message-State: APzg51Dl20WKke9MrQV829BuOzZS3yUC3AV2nrNOuig0tRBUquPZ2ZOD Evnz4e6CjTaxt+46EFaSIe7wxseN9BjE8M8dH4Q= X-Google-Smtp-Source: ANB0VdZCBo5rxKYPTYHknh2jjrLGuktoHBQ9xCxdzbL0C09Ikd0pTIW2NHDAWU1aRUa6J5R9TtFWoY1VMMoLuFzP0+Y= X-Received: by 2002:a9d:2868:: with SMTP id h37-v6mr14707759otd.42.1537550215455; Fri, 21 Sep 2018 10:16:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Fri, 21 Sep 2018 19:16:44 +0200 Message-ID: Subject: Re: bug#31238: Dynamic Module Crash To: =?UTF-8?B?VHXhuqVuIEFuaCBOZ3V54buFbg==?= Content-Type: multipart/alternative; boundary="0000000000006aa885057664ceee" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31238 Cc: 31238@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: -0.7 (/) --0000000000006aa885057664ceee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Philipp Stephani schrieb am Di., 24. Apr. 2018 um 16:08 Uhr: > Tu=E1=BA=A5n Anh Nguy=E1=BB=85n schrieb am So., 22.= Apr. 2018 um > 18:32 Uhr: > >> Emacs 25.3.1 crashes with a segfault when trying to print a value >> constructed (in certain ways) by a dynamic module. >> >> Reproduction: https://github.com/ubolonton/emacs-module-crash >> >> Context: https://github.com/ubolonton/emacs-module-rs/issues/2 >> >> > This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, > which removed GC protection for module-allocated values. > Unless anybody complains, I'll revert that commit. Modules can store/use emacs_value objects in arbitrary ways; there's no way we can rely on stack scanning to reliably find them. --0000000000006aa885057664ceee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Di., 24. Apr. 2018 um 16:08=C2=A0Uhr:
Tu=E1=BA=A5n Anh Nguy=E1=BB=85n <ubolonton@gmail.com> schrieb am So., 22= . Apr. 2018 um 18:32=C2=A0Uhr:
Emacs 25.3.1 crashes with a segfault when trying to = print a value constructed (in certain ways) by a dynamic module.

Reproduction: https://github.com/ubolonton/emacs-module-crash
=
Context: https://github.com/ubolonton/emacs-module-rs/is= sues/2


=
This might be = caused by commit=C2=A03eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, which remov= ed GC protection for module-allocated values.=C2=A0

Unless anybody complains, I'll revert that c= ommit. Modules can store/use emacs_value objects in arbitrary ways; there&#= 39;s no way we can rely on stack scanning to reliably find them.=C2=A0
--0000000000006aa885057664ceee-- From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 14:34:09 2018 Received: (at 31238) by debbugs.gnu.org; 21 Sep 2018 18:34:09 +0000 Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3QFk-0008Mc-W5 for submit@debbugs.gnu.org; Fri, 21 Sep 2018 14:34:09 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:41208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3QFh-0008M1-Im for 31238@debbugs.gnu.org; Fri, 21 Sep 2018 14:34:05 -0400 Received: by mail-oi0-f45.google.com with SMTP id k12-v6so12213659oiw.8 for <31238@debbugs.gnu.org>; Fri, 21 Sep 2018 11:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=n7M+xmgtsoowTOJhfaibGJnl0hwAPYUB5edYr1Yfg4Y=; b=BTjO3AkWgM/T8izD6TwhSESC57kzPMST1Hmi8by+w/i/fHZrG9AY32YBKStgPaaDij sf+xzo1w4r6OQyHJLSz6Y8UuJSITeCjumn9Mg9BtY6yha3XhZfjdrEEUNLWiBOeNOeu+ vJv55Dp2t5gA3TMLyxGidUvHOC2KZe6f/+5kuUGnOOhZ2p27yxkjQfyMo6dRDAD+6BM3 kikhcPJevi8x742gtTkPcCyqWZLW4z8U2Zig3DqaZ6vPl/Lcd2QFoOYvLO5pDVZALGGG B/5BrI+SBE+006ny3J4s6j5IsBXWGtYhxX+mYC7snBeM6yLy8QxNcfLZ8O1bbWTYL9aM okpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=n7M+xmgtsoowTOJhfaibGJnl0hwAPYUB5edYr1Yfg4Y=; b=ogRy8nE33gFarm5iV4znpv8s4y785IxhXfCECoaaT5zD5a7I7HAbO5f6XcVSV6Qsgx etk1GPYtiqAgXSCVJlCZ1vlNehxI3jPnNIE1E5Gr3Mu3ujxvttPaQzxjUeiwNC4w4W27 GeEVs8kdlZsuQ6uSesMYiDqWJP3fl4w7dP5vvCwDMUuTxQYH+4HOZj+oLbVGYrEvJWkp wBJEV+CIOaFJhzFFjCotRBLEg1npM8Mxeg0uuCS0V/mJTcKTZ2FMh5ir3B65JkPT/jWn 9w2y/kElRG2s0ABgiJP2kInfRMsVMlu3Qo7EhQSMZU68uiDTDMWmAcprtKbQWk3RgyHC d6Mg== X-Gm-Message-State: APzg51AoOzEBragOj2l5ARPQzRNXOrelzMn6Suac/HFxj2qDMYsfZCKp hpAbYMVOFl2WtXpzHFVnwVUpPPdtu3+JsYWVUqQ= X-Google-Smtp-Source: ANB0VdbavHBUG0GiaQzoG5ywd+hh3bScGa6N0NbbXcLiXIVcSiQnWcqey3zbhl6/WYrWnwH9hAfjBnateuBlEdVxLcM= X-Received: by 2002:aca:4c14:: with SMTP id z20-v6mr2452622oia.164.1537554840034; Fri, 21 Sep 2018 11:34:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Noam Postavsky Date: Fri, 21 Sep 2018 14:33:47 -0400 Message-ID: Subject: Re: bug#31238: Dynamic Module Crash To: Philipp Stephani Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31238 Cc: 31238@debbugs.gnu.org, ubolonton@gmail.com, Stefan Monnier 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 (-) On Fri, 21 Sep 2018 at 13:18, Philipp Stephani wrot= e: > > Philipp Stephani schrieb am Di., 24. Apr. 2018 um= 16:08 Uhr: >> >> Tu=E1=BA=A5n Anh Nguy=E1=BB=85n schrieb am So., 22= . Apr. 2018 um 18:32 Uhr: >>> >>> Emacs 25.3.1 crashes with a segfault when trying to print a value const= ructed (in certain ways) by a dynamic module. >>> Reproduction: https://github.com/ubolonton/emacs-module-crash >>> Context: https://github.com/ubolonton/emacs-module-rs/issues/2 >> >> This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a,= which removed GC protection for module-allocated values. > > Unless anybody complains, I'll revert that commit. Modules can store/use = emacs_value objects in arbitrary ways; there's no way we can rely on stack = scanning to reliably find them. I'll just add author of said commit to Cc, perhaps that will increase the chance of getting some useful response... From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 18:48:45 2018 Received: (at 31238) by debbugs.gnu.org; 21 Sep 2018 22:48:45 +0000 Received: from localhost ([127.0.0.1]:48504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3UE8-0006MM-Tc for submit@debbugs.gnu.org; Fri, 21 Sep 2018 18:48:45 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:56413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3UE6-0006MB-1Q for 31238@debbugs.gnu.org; Fri, 21 Sep 2018 18:48:42 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w8LMmeLY024087; Fri, 21 Sep 2018 18:48:41 -0400 Received: by pastel.home (Postfix, from userid 20848) id B55C9617EB; Fri, 21 Sep 2018 18:48:40 -0400 (EDT) From: Stefan Monnier To: Philipp Stephani Subject: Re: bug#31238: Dynamic Module Crash Message-ID: References: Date: Fri, 21 Sep 2018 18:48:40 -0400 In-Reply-To: (Philipp Stephani's message of "Fri, 21 Sep 2018 19:16:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6379=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6379> : inlines <6891> : streams <1799133> : uri <2715274> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31238 Cc: 31238@debbugs.gnu.org, =?utf-8?Q?Tu=E1=BA=A5n?= Anh =?utf-8?Q?Nguy=E1=BB=85n?= 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: -3.3 (---) >>> Emacs 25.3.1 crashes with a segfault when trying to print a value >>> constructed (in certain ways) by a dynamic module. >>> Reproduction: https://github.com/ubolonton/emacs-module-crash >>> Context: https://github.com/ubolonton/emacs-module-rs/issues/2 >> This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, IIUC that's just a wild guess, right? >> which removed GC protection for module-allocated values. Not really, no. It just relied on another pre-existing mechanism. > Unless anybody complains, I'll revert that commit. Do we even know that reverting it circumvents this crash? And IIRC this patch is not just an implementation detail, it changes the module's API and ABI, so reverting it shouldn't be done lightly. > Modules can store/use emacs_value objects in arbitrary ways; > there's no way we can rely on stack scanning to reliably find them. We don't blindly rely on stack scanning: there are functions to (un)register other values stored in the (non-Lisp) heap. The previous code wasn't magical either. I don't know nearly enough about Rust's implementation strategy and the `emacs` crate used to guess how its memory management could/should interact with Emacs's. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 15:31:45 2019 Received: (at 31238) by debbugs.gnu.org; 21 Mar 2019 19:31:45 +0000 Received: from localhost ([127.0.0.1]:53621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h73Pl-0007BA-2Q for submit@debbugs.gnu.org; Thu, 21 Mar 2019 15:31:45 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:35853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h73Ph-0007Aw-NV for 31238@debbugs.gnu.org; Thu, 21 Mar 2019 15:31:43 -0400 Received: by mail-ot1-f49.google.com with SMTP id o74so6518888ota.3 for <31238@debbugs.gnu.org>; Thu, 21 Mar 2019 12:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LIFBWPly/fstEWe63V7tmPV7JA6HqVDilO9jdO7shQo=; b=lcPsIAC1GauFSIM0KzgYAy0qqd95Fd7TYdxcYUvcCklUvXYI3hmxZBO4ciQPgU892b or/aadSJbNIFeAlx/37BE1S9N37pD/r4KjVbOuGU4H7QeCGdMrwh7+12VtRp9sPnR+oT 9srfelwUENLtIL07e906L1srgyV2ep44Mo12Mp2RLti2qDX2Uuy0Xyt2eg4Fg5JgMTNY t/fADXJ7Ubv7MyPZoaThWmHoYtyOMWs8J8lOQOdKyUYYziQH3AVeKoclCnVeE5A28pEB NmlUSDMETSpin8vxEWsngIG//mb9uSwhvqHPeye8XLe8DLEhI/wR/XLYidFTzSDE1lP4 mxYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LIFBWPly/fstEWe63V7tmPV7JA6HqVDilO9jdO7shQo=; b=kvnRdt7S1WaMfY84+XMsh13X5s7sq1GKV+yOF/7pRgak6PO97HT5p5RJ8sbwkmdGcZ T6oeaxaP2jYVdfD6MSx+JFt/le1hEG36hZbW7OBcI/ruxqJueDoek1dvfggEsK6AXJZp uxXMfIoCkBaMARAxWSxXTSoRq3j3NmuUMtWaMLWvw8rc5LCTOUCZZKX3BrRJkhhzJW+3 EC7qMFnZ3arzZO7jhpxd59B5TqTc4ZbBv3mcqh6Q8fGcNfh513M1xGqUFUB0Ds7pz5Gl mvb6PVi31pct7NFWqQ0jaWDMCIVbwne0OichpFIMiknFc6PGax2L4IXyBKf6LacJ5gMs bM6g== X-Gm-Message-State: APjAAAXdJSiUUQrDbp4Q0I/nW+ZHduccRiUGoHbLk/XkZW1NOwpMBuhe 22L7Y3LrMdfO31q2dxo4fG6dUrG7wyqdvJ9TKlE= X-Google-Smtp-Source: APXvYqwZmzumGh0ptUTGepSPKH58x6rqPc1RQ8oRcfqtFmOZ9vY42Y9QvDL4VpJCYc6gXFb9aOBSg+dcmZDz0wgFVm0= X-Received: by 2002:a9d:7a4b:: with SMTP id z11mr3911137otm.355.1553196694509; Thu, 21 Mar 2019 12:31:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Thu, 21 Mar 2019 20:31:23 +0100 Message-ID: Subject: Re: bug#31238: Dynamic Module Crash To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 31238 Cc: 31238@debbugs.gnu.org, =?UTF-8?B?VHXhuqVuIEFuaCBOZ3V54buFbg==?= 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: -0.7 (/) Am Sa., 22. Sept. 2018 um 00:48 Uhr schrieb Stefan Monnier : > > >>> Emacs 25.3.1 crashes with a segfault when trying to print a value > >>> constructed (in certain ways) by a dynamic module. > >>> Reproduction: https://github.com/ubolonton/emacs-module-crash > >>> Context: https://github.com/ubolonton/emacs-module-rs/issues/2 > >> This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, > > IIUC that's just a wild guess, right? Let's rather say that it's the obvious suspect. I've now also confirmed that I can consistently reproduce this bug with commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a, and that it's consistently fixed after reverting 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a. Since there was also no consensus to install commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a in the first place (see https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00150.html), I went ahead and reverted commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a on master. > > >> which removed GC protection for module-allocated values. > > Not really, no. It just relied on another pre-existing mechanism. A mechanism that can't work. Lisp_Object values in Emacs's source code might be known to be on the stack, but that's not the case for modules. > > > Unless anybody complains, I'll revert that commit. > > Do we even know that reverting it circumvents this crash? Yes, I've tested this now extensively. > > And IIRC this patch is not just an implementation detail, it changes the > module's API and ABI, so reverting it shouldn't be done lightly. Commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a did introduce a breaking change in the module API in the sense that it removed NULL as a sentinel value. Reverting that commit restores the original behavior (which is itself not a breaking change). I don't see any ABI changes with 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a since it didn't change emacs-module.h (meaningfully). > > > Modules can store/use emacs_value objects in arbitrary ways; > > there's no way we can rely on stack scanning to reliably find them. > > We don't blindly rely on stack scanning: there are functions to > (un)register other values stored in the (non-Lisp) heap. Do you mean the "global value" function? These are only for values that have to survive longer than their environment. All other values live as long as their environment. > > The previous code wasn't magical either. No, and I certainly don't claim it's perfect, but at least it didn't exhibit this bug. I'm happy to discuss alternatives as long as we (at least Daniel and I) agree with them and they don't reintroduce this bug. > > I don't know nearly enough about Rust's implementation strategy and the > `emacs` crate used to guess how its memory management could/should > interact with Emacs's. I don't think Rust is the issue here. As with any language exposing a C interface, it has to play by C's rules for the scope of that interface. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 04:16:37 2019 Received: (at control) by debbugs.gnu.org; 22 Mar 2019 08:16:37 +0000 Received: from localhost ([127.0.0.1]:53960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7FLx-00072W-IE for submit@debbugs.gnu.org; Fri, 22 Mar 2019 04:16:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h7FLu-00072F-A7; Fri, 22 Mar 2019 04:16:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7FLn-0008BN-7X; Fri, 22 Mar 2019 04:16:27 -0400 Received: from [176.228.60.248] (port=2300 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h7FLm-0001l0-Sw; Fri, 22 Mar 2019 04:16:27 -0400 Date: Fri, 22 Mar 2019 11:16:28 +0300 Message-Id: <83tvfvs4rn.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Thu, 21 Mar 2019 20:56:17 -0400) Subject: Re: bug#34655: 26.1.92; Segfault in module with --module-assertions References: <874l8r1t3a.fsf@tcd.ie> <8336oamu3y.fsf@gnu.org> <87h8c1cv6l.fsf@tcd.ie> <83lg1dwhse.fsf@gnu.org> <87va0h12js.fsf@tcd.ie> <835zsgw3ui.fsf@gnu.org> <87ef7486h0.fsf@tcd.ie> <83r2b4ul1c.fsf@gnu.org> <831s30upqd.fsf@gnu.org> <83o964t4de.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: contovob@tcd.ie, 34655@debbugs.gnu.org, p.stephani2@gmail.com 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 (-) merge 31238 34655 close 34655 thanks > From: Stefan Monnier > Cc: Philipp Stephani , contovob@tcd.ie, 34655@debbugs.gnu.org > Date: Thu, 21 Mar 2019 20:56:17 -0400 > > > OK, but I think Stefan's opinion is not less important. > > I think the module API is already so completely different from what I'd > like it to be that it's OK to revert my change here. OK, so I reverted my revert, and I'm marking this bug done. Thanks. From unknown Sat Jun 21 05:15:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Apr 2019 11:24:06 +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