From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41520: 28.0.50; Crash in character.h due to assertion error Date: Mon, 25 May 2020 07:28:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87535"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41520@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 25 09:30:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jd7Yy-000Mfi-7r for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 09:30:20 +0200 Original-Received: from localhost ([::1]:59768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jd7Yw-0004Zr-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 May 2020 03:30:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jd7Yi-0004Zi-3e for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 03:30:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jd7Yh-00027N-R9 for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 03:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jd7Yh-0001RQ-N4 for bug-gnu-emacs@gnu.org; Mon, 25 May 2020 03:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 May 2020 07:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41520 X-GNU-PR-Package: emacs Original-Received: via spool by 41520-submit@debbugs.gnu.org id=B41520.15903917465421 (code B ref 41520); Mon, 25 May 2020 07:30:03 +0000 Original-Received: (at 41520) by debbugs.gnu.org; 25 May 2020 07:29:06 +0000 Original-Received: from localhost ([127.0.0.1]:39639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jd7Xm-0001PN-Gb for submit@debbugs.gnu.org; Mon, 25 May 2020 03:29:06 -0400 Original-Received: from mail-oo1-f67.google.com ([209.85.161.67]:40088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jd7Xl-0001Oo-3n for 41520@debbugs.gnu.org; Mon, 25 May 2020 03:29:05 -0400 Original-Received: by mail-oo1-f67.google.com with SMTP id f39so93057ooi.7 for <41520@debbugs.gnu.org>; Mon, 25 May 2020 00:29:05 -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=ZYf7SWEEimeoL9+u9DDvYBLkVSML3LhRHwjaRP3Qyxg=; b=T3vBTPNBSCh6kO546XQrSV6aMQmHyoTvJfV49K6zG1UIJ9RLtEkNX2dsBsygmqM11H enUbA8IsPwG94jh7sMSi5hGhd7rFzDyclaL+d4Ta94jXRPbXU2FTcEpV3qFpge113Szz sVlbm9A1inSlvs/Njh0bM8ku4SBCNHLD4epbOn7RnsxUqGlQ0Aswi17UmM9qYugaPEpw 6xllGbl1ygVGyx/IVxrcQdD0JP+MmAu4c0wdRNObY3F59hVPKIKwQlprRwT3WFGtwnEh AM1pSClkRFu+qjCRGa1838W5wrTImi0Npwai+NXhCp8VcTZu63EfptcVjq3qPuT2OLAP 6TYQ== 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=ZYf7SWEEimeoL9+u9DDvYBLkVSML3LhRHwjaRP3Qyxg=; b=YmAbpVgrGJFJdcY+nCW1qc8XDLeWr6b5pqIRTGrDDsH3Jj06Tx/q6WLdWbh/HhtVbS BQGCY98vX7h+/xg/3eSfdr+aYqO43Czd9NqMv91fSgCmaOco79yCHjeEVvOIA83AB2/1 XoR/Zt3qc5SpRZtprhxYRb6Ow4buQvAAps+7zJUq/PNK5tUh9rXEtc27lDzs4C/tt89/ J0Hkna2o95s+UdwLZO3fVD1eDCNCnI51mgcF83WVeB5Urcr6e9DfEPvEU8tdWb3V+Er2 xvGvRLPwkOA+Sk1JpNS+9mSvxctqRzyIea51yqi3ROZ8f2aB0JWcRBvoWaEHgJtYaAzV koVw== X-Gm-Message-State: AOAM5333Bvwddm3VGSNknG0ilQHMTFij2RebaxGOvs53SRWWsmNhe4BE KtrjBmHnG9vayhky6B5IanaK7vPI4orOXa/aGrf54TuxVhY= X-Google-Smtp-Source: ABdhPJxWEP0idZJX9JmFX5r9PEy4Wbcy5bCrLKOVukHopgMogf2//R0abhFMCVR2aFuIUyw6nyOsyFcjJB5ViSXa4Hg= X-Received: by 2002:a4a:e702:: with SMTP id y2mr12273126oou.44.1590391739461; Mon, 25 May 2020 00:28:59 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180955 Archived-At: On Mon, May 25, 2020 at 7:06 AM Stefan Kangas wrote: > When editing an org-mode document, I saw a crash due to this assertion > error: It's a bug in this code in xdisp.c: else if (it->bidi_it.charpos == bob || (!string_p && (FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n' || FETCH_CHAR (it->bidi_it.bytepos) == '\n'))) The first FETCH_CHAR should be a FETCH_BYTE to avoid the assertion error. There's at least one other place that has the same error, so I'll grep some more before sending a patch. My suggestion is to drop the "eassume" on emacs-27, and fix FETCH_CHAR to FETCH_BYTE on master. (I'd like to reiterate my proposal to use a pos_t for bytepos/charpos pairs, which would catch or silently fix (which happened in this case on my pos_t branch) such bugs. The code on my branch reads: else if (POS_CHAR_EQUAL (it->bidi_it.pos, bob) || (!string_p && (FETCH_CHAR (dec_pos (it->bidi_it.pos)) == '\n' || FETCH_CHAR (it->bidi_it.pos) == '\n'))) which, while minimally slower, doesn't throw assertion errors.)