From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Debugging printing to stderr prior glyph row values .... Date: Thu, 23 May 2019 10:23:03 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="39150"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 23 19:23:21 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hTrR3-000A3e-0O for ged-emacs-devel@m.gmane.org; Thu, 23 May 2019 19:23:21 +0200 Original-Received: from localhost ([127.0.0.1]:41014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTrR1-0002vu-Sn for ged-emacs-devel@m.gmane.org; Thu, 23 May 2019 13:23:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTrQv-0002vX-AY for emacs-devel@gnu.org; Thu, 23 May 2019 13:23:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTrQu-0003S7-8y for emacs-devel@gnu.org; Thu, 23 May 2019 13:23:13 -0400 Original-Received: from gateway31.websitewelcome.com ([192.185.144.218]:46157) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTrQu-0003RV-3C for emacs-devel@gnu.org; Thu, 23 May 2019 13:23:12 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway31.websitewelcome.com (Postfix) with ESMTP id A645634165 for ; Thu, 23 May 2019 12:23:10 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id TrQshn5v12PzOTrQshB1nt; Thu, 23 May 2019 12:23:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7rOKWA5TKTFaQJL19i7GSPf0nZtM1j3zFX6Xq5ryRQA=; b=H6qAiDE9HVov6xogj+d78HoXCr /UhiNOBsCI+wYFQU5shD3i/4dGvWxVu/YySqpqjLoRvb5kjeYzVS6Ch3f61vlJCmJDh16vJkW9uBK 0Wbi1ZFNqDF9yWaxYHCrao68OQ5v8/fgYN1QNndEsubQCqZd/N9Qr8CBI2xFjdx3wloAub077l2j7 RjyyzRn7DnpFgNiudoPPyw2UKwIiFcFTfhxSavZCDH9ScANhBdcYwO2HBNOeuS7AwD5x72HVoaGy4 HV7ZbLDo3MEAykASVPCWeNIulAJHgg1CQj6CPn6NGXCmvX7L4TkoI26dMbD279rrxKcP6fRkNlreC Iyvsh2AA==; Original-Received: from mobile-166-170-46-248.mycingular.net ([166.170.46.248]:47793 helo=MBP-13.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hTrQp-000Dv0-Kx; Thu, 23 May 2019 12:23:09 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 166.170.46.248 X-Source-L: No X-Exim-ID: 1hTrQp-000Dv0-Kx X-Source-Sender: mobile-166-170-46-248.mycingular.net (MBP-13.local) [166.170.46.248]:47793 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.144.218 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236939 Archived-At: Thank you, Eli, for having a look at this particular thread. I will add a test for the `used` row member to ensure that it is positive= . The crashing reported in the initial post only happens somtimes, so I'= ll need to do some further testing. The current issue relates to a window displaying a buffer, and the leadin= g/introductory function used to draw fake cursors has a check at the outs= et: if (!BUFFERP (w->contents)) return; I am looking to programmatically distinguish between the following three = types of consecutive rows: (1) the penultimate row _not_ ending in ZV th= at immediately precedes a row with _only_ ZV; (2) the last row that conta= ins _only_ ZV; and, (3) rows that follow a row with _only_ ZV. Every good boy deserves fudge.=C2=B6 ZV<=3D=3D [one or more ' ' space glyphs] [one or more ' ' space glyphs] Mode-Line Fake cursors are drawn immediately after each section [HPOS + LEN] of a p= otentially updated row in the desired_matrix is processed by update_windo= w; and, then fake cursors are drawn on _other_ rows using the current_mat= rix (after all potentially updated rows have been processed using the des= ired_matrix). Situation number 2 is labeled below as row_at_zv_p; and, stuation number = 3 is labeled below as row_beyond_zv_p. The problem I forsee with the row= _at_zv_p test is that there is no guarantee that ROW - 1 will be enabled = in the MATRIX containing ROW, and the test is therefore unreliable. bool row_at_zv_p =3D (MATRIX_ROW_START_BYTEPOS (row - 1) !=3D MATRIX_RO= W_END_BYTEPOS (row - 1) && !(row - 1)->ends_at_zv_p && MATRIX_ROW_START_BYTEPOS (row) =3D=3D MATRIX_ROW= _END_BYTEPOS (row) && row->ends_at_zv_p); bool row_beyond_zv_p =3D (MATRIX_ROW_START_BYTEPOS (row) =3D=3D MATRIX_= ROW_END_BYTEPOS (row)); A better method of determining row_at_zv_p (without consulting ROW - 1) w= ould be appreciated, if such a test exists. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [05-23-2019 07:43:14] <23 May 2019 17:43:14 +0300> > From: Eli Zaretskii >=20 > * * * >=20 > You didn't tell enough about the situation. E.g., what kind of window > is that -- a window that shows a buffer, or something else? How many > rows are in that window? What is the full content or ROW and ROW-1? >=20 > One potential problem I see is that this doesn't test the 'used' > member: >=20 > struct glyph *previous_row__last_glyph > =3D (vpos =3D=3D 0) > ? NULL > : (!(row - 1)->enabled_p) > ? NULL > : (row - 1)->glyphs[TEXT_AREA] + (row - 1)->used[TEXT_AREA] - 1; >=20 > The 'used' member should be positive, or else subtracting 1 is not > allowed.