From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#37385: 27.0.50; Crash on multibyte assertion violation Date: Fri, 13 Sep 2019 00:30:11 +0300 Organization: LINKOV.NET Message-ID: <87v9txmbfw.fsf@mail.linkov.net> References: <87tv9ir38c.fsf@mail.linkov.net> <83ftl11xdn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="200369"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 37385@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 12 23:54:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i8X2c-000pwo-6a for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Sep 2019 23:54:14 +0200 Original-Received: from localhost ([::1]:39016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8X2a-0007qS-EF for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Sep 2019 17:54:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35219) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8X2R-0007oC-J1 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2019 17:54:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8X2Q-0002cU-IX for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2019 17:54:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8X2Q-0002cN-FP for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2019 17:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i8X2Q-0000JG-BO for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2019 17:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Sep 2019 21:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37385 X-GNU-PR-Package: emacs Original-Received: via spool by 37385-submit@debbugs.gnu.org id=B37385.15683252321169 (code B ref 37385); Thu, 12 Sep 2019 21:54:02 +0000 Original-Received: (at 37385) by debbugs.gnu.org; 12 Sep 2019 21:53:52 +0000 Original-Received: from localhost ([127.0.0.1]:44168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i8X2F-0000In-PT for submit@debbugs.gnu.org; Thu, 12 Sep 2019 17:53:52 -0400 Original-Received: from cheetah.birch.relay.mailchannels.net ([23.83.209.34]:52798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i8X2C-0000Id-Pa for 37385@debbugs.gnu.org; Thu, 12 Sep 2019 17:53:49 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A17496A265F; Thu, 12 Sep 2019 21:53:47 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-96-83-181.trex.outbound.svc.cluster.local [100.96.83.181]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 21D576A28CF; Thu, 12 Sep 2019 21:53:47 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Thu, 12 Sep 2019 21:53:47 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Absorbed-Spill: 20a07272191c2498_1568325227399_673520395 X-MC-Loop-Signature: 1568325227399:3832254115 X-MC-Ingress-Time: 1568325227398 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 1805980911; Thu, 12 Sep 2019 14:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=pVKAUmHXxYpu9bpuNHQVDiur0NM=; b= wbAxhVx/v3PlR1oD0K4ZJs/uNqpEtNP7OPKolntUZ1LbaXh+bIOb39F+KTWrz3V0 0nDTyupnEsZWPkv1RgBin9yDYBSSmh+JBK+Tg7/EjCawFp32heWPKa79mJSYdNvA e7SsI2cvrjByxhwvZ5+W3WqBrDdn7Mx1bc0Bzc+t+lE= Original-Received: from mail.jurta.org (m91-129-108-240.cust.tele2.ee [91.129.108.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTPSA id 98DA580917; Thu, 12 Sep 2019 14:53:41 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: <83ftl11xdn.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 12 Sep 2019 16:01:56 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrtdeigddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrvdegtdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrddvgedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd 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: 209.51.188.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:166377 Archived-At: >> I tried the following fix and it prevents the crash: > > Thanks, but this is a backward-incompatible change on too low a level. > It is a long-standing "convention" in Emacs that Lisp strings rendered > as part of, or in relation to, unibyte buffers are assumed unibyte by > default, and I don't want to change that -- who knows how many places > in the code rely on this implicit assumption? > > Also, the change in reseat_1 looks unnecessary, as I'd be surprised if > that function was called in your use case (reseat_1 is used only when > displaying buffers, not strings). > > Please try an alternative patch below. (I don't have access to an X > build without a toolkit, so I cannot test this myself.) Thanks for the proper fix. I tried and it works without problems. Also I found third place (in addition to two places in your patch) where STRING_MULTIBYTE could be used for reseat_to_string. Is the following change needed as well? diff --git a/src/xdisp.c b/src/xdisp.c index 9f999c7903..af6faf9d34 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13804,7 +13812,8 @@ tool_bar_height (struct frame *f, int *n_rows, bool pixelwise) temp_row->reversed_p = false; it.first_visible_x = 0; it.last_visible_x = WINDOW_PIXEL_WIDTH (w); - reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); + reseat_to_string (&it, NULL, f->desired_tool_bar_string, + 0, 0, 0, STRING_MULTIBYTE (f->desired_tool_bar_string)); it.paragraph_embedding = L2R; while (!ITERATOR_AT_END_P (&it))