From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: How much do we care about undefined behavior triggered by invalid bytecode? Date: Tue, 22 May 2018 16:01:47 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1526997605 28840 195.159.176.226 (22 May 2018 14:00:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 May 2018 14:00:05 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Philipp Stephani , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 22 16:00:01 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fL7pZ-0007LI-4U for ged-emacs-devel@m.gmane.org; Tue, 22 May 2018 16:00:01 +0200 Original-Received: from localhost ([::1]:55910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7re-00038h-M2 for ged-emacs-devel@m.gmane.org; Tue, 22 May 2018 10:02:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7rR-00038P-Q8 for emacs-devel@gnu.org; Tue, 22 May 2018 10:02:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fL7rM-00041A-7k for emacs-devel@gnu.org; Tue, 22 May 2018 10:01:57 -0400 Original-Received: from mx2.suse.de ([195.135.220.15]:44271) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fL7rM-0003zy-28 for emacs-devel@gnu.org; Tue, 22 May 2018 10:01:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0BC16ACD3; Tue, 22 May 2018 14:01:48 +0000 (UTC) X-Yow: HELLO, little boys! Gimme a MINT TULIP!! Let's do the BOSSA NOVA!! In-Reply-To: (Noam Postavsky's message of "Tue, 22 May 2018 09:42:38 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225552 Archived-At: On Mai 22 2018, Noam Postavsky wrote: > On 22 May 2018 at 09:31, Philipp Stephani wrote: >> It's pretty easy to find examples of (printed representations of) invalid >> bytecode that trigger C-level assertions or undefined behavior ("crashes"). >> Should these be reported as bugs, or do we assume that any bytecode object >> is valid? > > The latter, according to the manual (elisp) Byte-Code Objects: > > You should not try to come up with the elements for a byte-code > function yourself, because if they are inconsistent, Emacs may crash > when you call the function. Always leave it to the byte compiler to > create these objects; it makes the elements consistent (we hope). Nevertheless, IMHO the bytecode interpreter should be made robust where possible. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."