From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#36431: Crash in marker.c:337 Date: Tue, 02 Jul 2019 13:22:22 -0400 Message-ID: References: <20190629.131734.877718102639559715.wl@gnu.org> <831rzch9nd.fsf@gnu.org> <83zhm0fuqg.fsf@gnu.org> <83ftnrf87e.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="201193"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36431@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 02 21:58:59 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 1hiOva-000qCO-PM for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jul 2019 21:58:58 +0200 Original-Received: from localhost ([::1]:56890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiOvZ-0000C4-QJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jul 2019 15:58:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60863) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiMUj-0002Bu-5i for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 13:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiMUi-0006XD-8g for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 13:23:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiMUg-0006WA-HC for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 13:23:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hiMUg-0007O1-Aq for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 13:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jul 2019 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36431 X-GNU-PR-Package: emacs Original-Received: via spool by 36431-submit@debbugs.gnu.org id=B36431.156208815528300 (code B ref 36431); Tue, 02 Jul 2019 17:23:02 +0000 Original-Received: (at 36431) by debbugs.gnu.org; 2 Jul 2019 17:22:35 +0000 Original-Received: from localhost ([127.0.0.1]:47829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiMUD-0007MN-AZ for submit@debbugs.gnu.org; Tue, 02 Jul 2019 13:22:34 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiMUB-0007M0-3q for 36431@debbugs.gnu.org; Tue, 02 Jul 2019 13:22:31 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E47B181176; Tue, 2 Jul 2019 13:22:24 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B36AA80B8C; Tue, 2 Jul 2019 13:22:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1562088143; bh=HnZZxyITLvE/oUTIoxpzwpXpyW+2aLtqbjR63kyhMmI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=mMxe75zoTgEpvy/BdtweRne/9+VfkjnsVLZfyFmNz/T2d2VFjo+s9sgIt0ekl7UPk AAVvQDzjLv+Ob1rB+3SlmIM1dQQQmM1JTkkWvsQysimj8+N51TeLazkoouH985yaL0 BMdWavu10lpIIyMcI+JPg+Aj1iJViorbiR77yPYZ4Du8zL8/2Sb6b9ox443GG4PuDU gxkEo3oB05smZ+Gs80aBzTHrv1q9CKDUoOgqPK5dCIKg/oclvERNe3OqgB3PywqIwZ i/kaHp7JBg9x6LUHRoqnWdvfI69kBD2p361i3r676OzWsXFpE19ejU9aQbkTiC1z6Y /S98k/nTi6g4g== Original-Received: from pastel (76-10-151-214.dsl.teksavvy.com [76.10.151.214]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 810E0120B3F; Tue, 2 Jul 2019 13:22:23 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Tue, 02 Jul 2019 13:04:38 -0400") 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:161984 Archived-At: > In the current code, we read the raw bytes to the beginning of the gap, > then (when Vset_auto_coding_function needs to be called), we (virtually) > move them into the current buffer, which is usually multibyte. > AFAICT at this point we have a buffer in a transiently inconsistent > state since it's multibyte but it can contain arbitrary byte sequences, > hence invalid byte sequences. Before calling Vset_auto_coding_function > we make this buffer unibyte, which brings us back to a consistent state, > but I wonder if/how/why making the buffer unibyte and then back to > multibyte always preserves the original byte sequence, since AFAICT > set-buffer-multibyte will always make the effort to bring the buffer to > a consistent state, so if the state is inconsistent before the pair of > calls to set-buffer-multibyte, either we changed the byte sequence or > set-buffer-multibyte doesn't always result in a consistent state. > What am I missing? OK, I finally saw that we don't actually call set-buffer-multibyte but instead we just set bset_enable_multibyte_characters. I'm beginning to understand better. Stefan