From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: How much do we care about undefined behavior triggered by invalid bytecode? Date: Tue, 22 May 2018 16:04:42 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000117810056ccbe784" X-Trace: blaine.gmane.org 1526997797 11049 195.159.176.226 (22 May 2018 14:03:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 May 2018 14:03:17 +0000 (UTC) Cc: Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 22 16:03:13 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 1fL7sa-0002eH-9G for ged-emacs-devel@m.gmane.org; Tue, 22 May 2018 16:03:13 +0200 Original-Received: from localhost ([::1]:55928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7uf-0004MX-KE for ged-emacs-devel@m.gmane.org; Tue, 22 May 2018 10:05:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fL7uN-0004HG-5d for emacs-devel@gnu.org; Tue, 22 May 2018 10:05:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fL7uJ-0005Sf-AB for emacs-devel@gnu.org; Tue, 22 May 2018 10:04:59 -0400 Original-Received: from mail-ot0-x22b.google.com ([2607:f8b0:4003:c0f::22b]:38523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fL7uJ-0005S2-4j for emacs-devel@gnu.org; Tue, 22 May 2018 10:04:55 -0400 Original-Received: by mail-ot0-x22b.google.com with SMTP id n3-v6so21081138ota.5 for ; Tue, 22 May 2018 07:04:55 -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=fgz3ixmQ2w3su8BZCBJLHWDXMybuW+Mz6RoFeik8xeM=; b=UOO4roiSmgr20PFOwSddFXS4QziqDiWrJOC83xMjEdbVAxigzDaSvPCAaiI74QlTKY QroFYA/cfe2B1pwW3/94KKwTXAXNAs5PDdcsYaB4YR89LwU5OBEdXAysmcuD2/sOefcy wlGz9Ytnoyk3QoJ4Nj+WGftZM3lP2pUa8h6zcW7Gc4dqn1JHBWwnd/JJ1Rxbk62jJ9Zt cWdZxvYgrU+qiP87SXHG2g3gcYb3bi7xl83k54hR7O+yzvrasaHSXp1XbUeq66yxZPeA AnZ+ZAI/F+ZfzYaTnFzv0VhxZ7qF8Fu9JEGZ45XyKIGqtkDDQi8N6/pkm+lFVZiqeJp5 vHwg== 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=fgz3ixmQ2w3su8BZCBJLHWDXMybuW+Mz6RoFeik8xeM=; b=oVLRjMUtOJ0DTWTWyOKa/ass5pv5ezwWq5WgKCt75KLgskAnjD2FSmqQMR90KN8gMx rTGfLuYBE2TneR+5Nw3bfi5WZ3hLEDyKaugTOSvfhLaHGTsXmAeZ6O8o8PWcK6XNF1Su zDS0sge6ftzl1oOF93BEGLMupyHKcGHNC2bbZAb5DO/5LoR7fzzP3XGd25/gfsI4dozw ygJSkc5xsnx1lIVxUHUfGCCFib8s9xlvB1B8ZsQG5mfZOYkp6CfFDM7eHZUKca7es6FU /padUgQ7FpHQyffSsPgSP8n+8Xe2c441BcKC3D5RhV4RzJ8104CCO7m4WfavUEGJ687O dwWg== X-Gm-Message-State: ALKqPwe3vrXauJ1zVAOGNbogaBDJiH63aMRqMPrncvUrbpP6FcOXL5R8 gakpanoP/FSBCTa6ZVfPqI8RsZ1vxotbIWaGobebgA== X-Google-Smtp-Source: AB8JxZqbiNnXDXoPOjzyXLVcIIAq42ytDXyT0eiRBOPlZohy1h6Uf9Y9W4coaUc0DcUyJ8zBzGDWY8WLdUYTDys2e50= X-Received: by 2002:a9d:5b32:: with SMTP id x47-v6mr17341875oth.26.1526997894389; Tue, 22 May 2018 07:04:54 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::22b 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:225553 Archived-At: --000000000000117810056ccbe784 Content-Type: text/plain; charset="UTF-8" Noam Postavsky schrieb am Di., 22. Mai 2018 um 15:42 Uhr: > 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). > That refers only to calling bytecode objects, not to e.g. reading their printed representation. Would it also apply to reading or other forms of handling bytecode objects? If so, the documentation should say so. --000000000000117810056ccbe784 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Noam P= ostavsky <npostavs@gmail.com&g= t; schrieb am Di., 22. Mai 2018 um 15:42=C2=A0Uhr:
On 22 May 2018 at 09:31, Philipp Stephani <p.stephani2@gmail.com>= 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 ob= ject
> is valid?

The latter, according to the manual (elisp) Byte-Code Objects:

=C2=A0 =C2=A0You should not try to come up with the elements for a byte-cod= e
function yourself, because if they are inconsistent, Emacs may crash
when you call the function.=C2=A0 Always leave it to the byte compiler to create these objects; it makes the elements consistent (we hope).

That refers only to calling bytecode objects, no= t to e.g. reading their printed representation. Would it also apply to read= ing or other forms of handling bytecode objects? If so, the documentation s= hould say so.=C2=A0
--000000000000117810056ccbe784--