From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24206: 25.1; Curly quotes generate invalid strings, leading to a segfault Date: Sun, 14 Aug 2016 20:18:18 +0300 Message-ID: <83zioffew5.fsf@gnu.org> References: <8337m7h1dp.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1471195219 13152 195.159.176.226 (14 Aug 2016 17:20:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Aug 2016 17:20:19 +0000 (UTC) Cc: p.stephani2@gmail.com, johnw@gnu.org, nicolas@petton.fr, 24206@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 14 19:20:15 2016 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 1bYz54-0003DO-O1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 19:20:14 +0200 Original-Received: from localhost ([::1]:33261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYz51-0002QC-Qa for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 13:20:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYz4v-0002NP-VM for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 13:20:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYz4r-0005CW-Nx for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 13:20:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYz4r-0005CS-Kb for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 13:20:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bYz4r-0004A6-Hp for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 13:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2016 17:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24206 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24206-submit@debbugs.gnu.org id=B24206.147119514215919 (code B ref 24206); Sun, 14 Aug 2016 17:20:01 +0000 Original-Received: (at 24206) by debbugs.gnu.org; 14 Aug 2016 17:19:02 +0000 Original-Received: from localhost ([127.0.0.1]:57438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYz3u-00048h-J7 for submit@debbugs.gnu.org; Sun, 14 Aug 2016 13:19:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYz3t-00048D-KB for 24206@debbugs.gnu.org; Sun, 14 Aug 2016 13:19:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYz3l-00053R-3K for 24206@debbugs.gnu.org; Sun, 14 Aug 2016 13:18:56 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYz3Z-00052j-RG; Sun, 14 Aug 2016 13:18:41 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1356 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bYz3V-0002Hk-Ru; Sun, 14 Aug 2016 13:18:40 -0400 In-reply-to: (message from Paul Eggert on Sun, 14 Aug 2016 09:51:43 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:122204 Archived-At: > Cc: p.stephani2@gmail.com, 24206@debbugs.gnu.org, johnw@gnu.org, > nicolas@petton.fr > From: Paul Eggert > Date: Sun, 14 Aug 2016 09:51:43 -0500 > > On 08/14/2016 09:27 AM, Eli Zaretskii wrote: > > The "length = 1" part is only correct if the argument string is > > multibyte, and should otherwise count the number of bytes in > > uLSQM/uRSQ, right? > > This string is by definition multibyte at that point, since that part of > the code is inserting a Unicode character that is not ASCII. Sorry, I don't understand what you are saying. The sequence of bytes "\xE2\x80\x98" can be either a sequence of unibyte bytes or a single multibyte character, depending on whether a string it is in is unibyte or multibyte. More generally, a Lisp string with the same sequence of bytes as its data can be treated either as unibyte or as multibyte, I'm sure you know that. Its multibyteness is entirely in Emacs's imagination. > More generally, Fsubstitute_command_keys is quite confused about unibyte > versus multibyte issues. It merges together a number of strings, and > assumes that they are all multibyte iff the original string is > multibyte, which is obviously not true in general. Could you please point out the specific places where this is done? Because I'm not sure I agree with your interpretation. (Let's use the code on emacs-25, where it was still not changed, for the purposes of this discussion.) Thanks.