From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32038: 27.0.50; Emacs hangs when using :propertize mode line construct and not providing a property value Date: Wed, 04 Jul 2018 18:07:23 +0300 Message-ID: <83po03niok.fsf@gnu.org> References: <87in5xf6xa.fsf@jonathanmitchell.org> <8736x16i4t.fsf@jonathanmitchell.org> <871scj7kxy.fsf@jonathanmitchell.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1530716766 20538 195.159.176.226 (4 Jul 2018 15:06:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2018 15:06:06 +0000 (UTC) Cc: k.michal@zoho.com, 32038@debbugs.gnu.org To: Jonathan Kyle Mitchell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 17:06:01 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fajM1-0005CO-92 for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2018 17:06:01 +0200 Original-Received: from localhost ([::1]:47681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fajO8-0006XI-9U for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2018 11:08:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fajO1-0006Wx-Bn for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2018 11:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fajNy-0003CL-7V for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2018 11:08:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fajNy-0003CF-2t for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2018 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fajNx-00088a-Tz for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2018 11:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Jul 2018 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32038 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32038-submit@debbugs.gnu.org id=B32038.153071685731252 (code B ref 32038); Wed, 04 Jul 2018 15:08:01 +0000 Original-Received: (at 32038) by debbugs.gnu.org; 4 Jul 2018 15:07:37 +0000 Original-Received: from localhost ([127.0.0.1]:46841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fajNY-00087z-7G for submit@debbugs.gnu.org; Wed, 04 Jul 2018 11:07:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fajNW-00087n-Ki for 32038@debbugs.gnu.org; Wed, 04 Jul 2018 11:07:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fajNO-0002ty-6O for 32038@debbugs.gnu.org; Wed, 04 Jul 2018 11:07:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fajNO-0002tq-35; Wed, 04 Jul 2018 11:07:26 -0400 Original-Received: from [176.228.60.248] (port=2504 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fajNN-0003ke-HA; Wed, 04 Jul 2018 11:07:25 -0400 In-reply-to: <871scj7kxy.fsf@jonathanmitchell.org> (message from Jonathan Kyle Mitchell on Tue, 03 Jul 2018 22:12:57 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:148188 Archived-At: > From: Jonathan Kyle Mitchell > Date: Tue, 03 Jul 2018 22:12:57 -0500 > Cc: 32038@debbugs.gnu.org > > I think I found a way to make redisplay ignore any malformed property list by > putting a single check around Fset_text_properties in xdisp.c. The text of the > modeline is still set according to the provided string, but the property list > is ignored if it doesn't have an even number of elements. It doesn't > infinitely loop anymore given a malformed property list. Thanks, but I think we should log the error in *Messages*, because otherwise the error will go unnoticed. > + if (EQ (Fmod (Flength (props), make_number (2)), > + make_number (0))) We are on the C level, so it is easier/simpler to do this instead: ptrdiff_t seqlen = XFASTINT (Flength (props)); if (seqlen % 2 == 0) Fset_text_properties (...); More importantly, Flength can signal an error if PROPS is too long, so I'm not sure the idea of your patch is 100% correct, because the code you propose can still signal an error. An alternative would be to call Fset_text_properties via internal_condition_case_n, like we do in safe__call.