From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Wilfred Hughes Newsgroups: gmane.emacs.bugs Subject: bug#25684: 25.1; (downcase -1) segfaults Emacs on GNU/Linux Date: Wed, 15 Feb 2017 22:48:49 +0000 Message-ID: References: <5t1sv1u6cp.fsf@fencepost.gnu.org> <87r33095l3.fsf@linux-m68k.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1487199015 28919 195.159.176.226 (15 Feb 2017 22:50:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Feb 2017 22:50:15 +0000 (UTC) Cc: 25684@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 15 23:50:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ce8On-00071p-4a for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Feb 2017 23:50:09 +0100 Original-Received: from localhost ([::1]:43350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ce8Os-00061G-TN for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Feb 2017 17:50:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ce8Om-0005zv-NE for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 17:50:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ce8Oi-0003Nf-0j for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 17:50:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ce8Oh-0003NQ-T4 for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 17:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ce8Of-0005tt-Pu for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 17:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wilfred Hughes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 22:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25684 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25684-submit@debbugs.gnu.org id=B25684.148719895622624 (code B ref 25684); Wed, 15 Feb 2017 22:50:01 +0000 Original-Received: (at 25684) by debbugs.gnu.org; 15 Feb 2017 22:49:16 +0000 Original-Received: from localhost ([127.0.0.1]:41449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce8Nw-0005sq-KD for submit@debbugs.gnu.org; Wed, 15 Feb 2017 17:49:16 -0500 Original-Received: from mail-qt0-f181.google.com ([209.85.216.181]:35627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce8Nv-0005se-3a for 25684@debbugs.gnu.org; Wed, 15 Feb 2017 17:49:15 -0500 Original-Received: by mail-qt0-f181.google.com with SMTP id x49so579618qtc.2 for <25684@debbugs.gnu.org>; Wed, 15 Feb 2017 14:49:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilfred-me-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=adqt7kexNHK7uxVuj4xDgqQc5pF5rA7qwPS0VdxWNR0=; b=lvirwaKRQ5Q0CZziuIJ7HX6HvWZNLVF3qWxc3gfIjE7q/KccFlu2rO8368IW10d5ot 8DZrDdFqM+khSYqtzx4B3dAeVSQs2JPSBMvr5Li5IQOamUYABg2csFbnZXfrswDvj/YW aZDIqJdgks2AQ1kxxk+0c/1qSmp07ccpO1+XzUq9uuVzcDu7znZe6G0NtvlL3gUpjTTF NrFPPo4fKPuHiHgVcE/U7/Cyq3H+yeZXEjoklIabVxA5RYRQBC7mIHnLsRtSuKxjpYfL sRTEIJwbP3pOcfxfA19I34kQOcPdgGJm65pJZkixzTHaNF5paqy33zpw5UF3Rm8/Glti Otkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=adqt7kexNHK7uxVuj4xDgqQc5pF5rA7qwPS0VdxWNR0=; b=Gnthtk5mGLCBFA1GtVl4KgQXYpO7YDjxpvi+1t5vpgb2O3ahnbUn6QTJ5bGoUFXLrl a+dehJfkbHW4jMYCRKtDQAHTfkpEaJK5SZES7KGSqRD2++2Y8H3la+PBu3SuBWQ4JK2J F6N+dXGu2cK48VFoxaJwsWZYj1leq9BIOjSlT3VUGg+ZLJsPf1JMt1IyONghktmHwltr NXNiJeGnTvcTrUAMmuTtImS0QIWzLwtHLDmK/gfOXdlynhK5zTWGWSsJ76OnNbypSFyj 9iicDEYfJxHsDv282txMKR9lwX45kRQrcMqYQLUHKeaVVutr3wBP4LhfYOYn7qSAqsbv 5D2A== X-Gm-Message-State: AMke39lQxatNbzXIxTL408Krm1HRzMmR3CCNmskLNllSqoKAA5NnIl5i5gG7HMP3ibbMMY+tD7AJ7RInE7IbCA== X-Received: by 10.237.36.129 with SMTP id t1mr35210387qtc.202.1487198949307; Wed, 15 Feb 2017 14:49:09 -0800 (PST) Original-Received: by 10.237.36.239 with HTTP; Wed, 15 Feb 2017 14:48:49 -0800 (PST) X-Originating-IP: [77.103.217.201] In-Reply-To: <87r33095l3.fsf@linux-m68k.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129397 Archived-At: When I tested it on OS X, (downcase -1) returned -1. I agree with Glenn that I think the most sensible behaviour would be to signal a type error. I don't believe the manual specifies this behaviour: https://www.gnu.org/software/emacs/manual/html_node/elisp/Case-Conversion.html so it's unlikely users depend on this. On 14 February 2017 at 15:04, Andreas Schwab wrote: > On Feb 13 2017, Glenn Morris wrote: > >> Wilfred Hughes wrote: >> >>> The elisp primitives downcase and upcase cause Emacs to segfault when >>> given a negative argument. For example, (downcase -1). >>> >>> I can reproduce this on Emacs 25.1 as well as on master. It occurs on >>> GNU/Linux but not on OS X. >> >> I can't reproduce this, but it seems to me that (downcase -1) should >> signal a wrong-type-argument error, since negative numbers are not characters. >> But I think there are probably subtleties here that I don't get. > > The function uses XFASTINT, which only works for non-negative numbers. > This is checked when runtime checking is enabled. > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different."