From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35273: "Marker does not point anywhere" when reading next article Date: Tue, 16 Apr 2019 09:56:36 -0400 Message-ID: <87tveyxdd7.fsf@gmail.com> References: <875zrgpusw.fsf@vuxu.org> <87lg0czgy1.fsf@tcd.ie> <8736mkgu83.fsf@vuxu.org> <87zhoqxgzn.fsf@gmail.com> <87wojum7vc.fsf@vuxu.org> <87wojuxfdl.fsf@gmail.com> <87sguim6gn.fsf@vuxu.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="245040"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: "Basil L. Contovounesios" , 35273@debbugs.gnu.org To: Leah Neukirchen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 16 15:57:16 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGOaI-0011YO-Vl for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Apr 2019 15:57:15 +0200 Original-Received: from localhost ([127.0.0.1]:37378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGOaH-0001Sd-VE for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Apr 2019 09:57:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGOaA-0001RS-EL for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 09:57:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGOa8-0007JL-W4 for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 09:57:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52362) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGOa8-0007JF-EY for bug-gnu-emacs@gnu.org; Tue, 16 Apr 2019 09:57:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hGOa6-0006yf-59; Tue, 16 Apr 2019 09:57:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 16 Apr 2019 13:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35273 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 35273-submit@debbugs.gnu.org id=B35273.155542300726797 (code B ref 35273); Tue, 16 Apr 2019 13:57:01 +0000 Original-Received: (at 35273) by debbugs.gnu.org; 16 Apr 2019 13:56:47 +0000 Original-Received: from localhost ([127.0.0.1]:37673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGOZq-0006y8-FR for submit@debbugs.gnu.org; Tue, 16 Apr 2019 09:56:46 -0400 Original-Received: from mail-qt1-f177.google.com ([209.85.160.177]:41226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGOZo-0006xv-J3 for 35273@debbugs.gnu.org; Tue, 16 Apr 2019 09:56:45 -0400 Original-Received: by mail-qt1-f177.google.com with SMTP id w30so23317105qta.8 for <35273@debbugs.gnu.org>; Tue, 16 Apr 2019 06:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Qa8NuPUCErowXnTBMFlZtkVPqibGWk6VBZNAYds4nfU=; b=VVihcU4rHqHc9pXKob6HXCrbTcQitWqhgLyMwjO+x++yaFcC7y9QJ6o2Bqd6e0zIvQ y2U1MrN1r9tfYDUCMEsxkhyvx6710O+vVoolP7tEX4KRyyLgyVvnNu2RV0QY/97itAgY NoQRnt8jcnMKqvYdUqwNHF38ArH6FaKc1Paq7/E02qOrK8UfvX64r9nAOFUO4nU8816+ RrXu69Qc5Zo7bxzVDcpeqQfC4P83SSk41GBRLPpI5GJ38yQX4WEGaGdjGK7+MadKKiT6 jMnuv1jloICXCSpXc2o29rwWvvTJ0C7G5Gzw3ISmL8ZJT2ATqRae+mZ3upMFO2WOjnwt PVqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Qa8NuPUCErowXnTBMFlZtkVPqibGWk6VBZNAYds4nfU=; b=mGDZGX0D2FBgRJ93a9wmtaxfyMYc0OiyGgLAq2pLKNdgBhxq+/8oyDT1irOeKaWYlv A89vBVKcrzM9czzWJzLouLvg0XWEvId2VNWtpsV24Y/FPn5NjBHE160VmdHKTMNvx9X5 vI4eHIS1dXtaOrgQAeoZxyCiXFzMeB4WZcVbK73o/2KAvr1oA6uZmFSpH4Ckql63f+Cr lHjMtEy0UF7WBjpk5aBmhFIv8hlUdaSdbk6vHCOwgv/69FT0WDQQY7H9Y2yjYQhwCAuR sj00yHX5VVFQicmwoG77lyVaoqhzlMvA2/KBCGS8PijHCD6kbvOajmCGEidAwFSKIIlL AmsA== X-Gm-Message-State: APjAAAVFMI6o2HuoyKLDclYjMjrtnPeiXgMfW/yLeAU/xsI6rUuEysau aC0sDgOITo/UXi2StXuu1H43uLbk X-Google-Smtp-Source: APXvYqw0eWWUIgBy4KiQi/coSruR4iL0k3NpKiF9yPMfBbXGd5CCzx3/vDcuQriYNufhTB6iA7cJhA== X-Received: by 2002:aed:2401:: with SMTP id r1mr63177547qtc.312.1555422998597; Tue, 16 Apr 2019 06:56:38 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 75sm31737070qke.32.2019.04.16.06.56.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 06:56:37 -0700 (PDT) In-Reply-To: <87sguim6gn.fsf@vuxu.org> (Leah Neukirchen's message of "Tue, 16 Apr 2019 15:21:12 +0200") 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:157715 Archived-At: Leah Neukirchen writes: > Noam Postavsky writes: > >> I think the signal-hook-function might have worked (though I forgot >> to tell you to check the value of bug-35273-last-backtrace >> afterwards) but it would only have a single frame of "redisplay" so >> it would be useless. > > (It was nil.) Oh, hmm. Maybe the backtrace doesn't have `signal' in that context, so nothing is collected. >> And neither note_mouse_highlight nor mouse_face_overlay_overlaps call >> marker_position, so I'm confused how we got there. note_mouse_highlight >> does call Fmarker_position, but that one doesn't signal an error. >> >> Maybe the debug info is messed up by optimization. Could you try >> recompiling with CFLAGS='-O0 -g3'? > > (gdb) bt > #0 marker_position (marker=XIL(0x5555578a47c5)) at marker.c:680 > #1 0x00005555556fc2dd in mouse_face_overlay_overlaps ( > overlay=XIL(0x5555578a4825)) at buffer.c:3047 > #2 0x0000555555606f5f in note_mouse_highlight (f=0x55555610dbf0, x=100, y=9) > at xdisp.c:31631 > (gdb) up > #1 0x00005555556fc2dd in mouse_face_overlay_overlaps ( > overlay=XIL(0x5555578a4825)) at buffer.c:3047 > 3047 ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); > (gdb) l > 3042 `mouse-face' property overlapping OVERLAY. */ > 3043 > 3044 bool > 3045 mouse_face_overlay_overlaps (Lisp_Object overlay) > 3046 { > 3047 ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); > 3048 ptrdiff_t end = OVERLAY_POSITION (OVERLAY_END (overlay)); Oh right, OVERLAY_POSITION calls marker_position. I think the patch below should paper over the problem, but I'm not sure if it's the right thing. --- i/src/buffer.c +++ w/src/buffer.c @@ -3044,8 +3044,13 @@ overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, bool mouse_face_overlay_overlaps (Lisp_Object overlay) { - ptrdiff_t start = OVERLAY_POSITION (OVERLAY_START (overlay)); - ptrdiff_t end = OVERLAY_POSITION (OVERLAY_END (overlay)); + Lisp_Object start_pos = Fmarker_position (OVERLAY_START (overlay)); + Lisp_Object end_pos = Fmarker_position (OVERLAY_END (overlay)); + if (!(INTEGERP (start_pos) && INTEGERP (end_pos))) + return false; + intmax_t start, end; + integer_to_intmax (start_pos, &start); + integer_to_intmax (end_pos, &end); ptrdiff_t n, i, size; Lisp_Object *v, tem; Lisp_Object vbuf[10];