From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling Resent-From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: jan.h.d@swipnet.se, bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Aug 2010 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6855@debbugs.gnu.org Cc: jan.h.d@swipnet.se X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: jan.h.d@swipnet.se Received: via spool by submit@debbugs.gnu.org id=B.128179000017186 (code B ref -1); Sat, 14 Aug 2010 12:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Aug 2010 12:46:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkG8F-0004T9-Vx for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:46:40 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkG8E-0004T4-68 for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:46:38 -0400 Received: from lists.gnu.org ([199.232.76.165]:51184) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OkFTT-0003xz-5e for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:04:31 -0400 Received: from [140.186.70.92] (port=49092 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OkFTR-0000GJ-Ty for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OkFTP-0000SB-Sk for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:29 -0400 Received: from smtprelay-b11.telenor.se ([62.127.194.20]:37625) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkFTP-0000S3-Ji for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:27 -0400 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 6F906E9694 for ; Sat, 14 Aug 2010 14:04:26 +0200 (CEST) X-SENDER-IP: [85.228.195.132] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQ6AIcjZkxV5MOEPGdsb2JhbACTNI0QDAEBAQE1LbsGhTsE X-IronPort-AV: E=Sophos;i="4.55,367,1278280800"; d="scan'208";a="119214920" Received: from c-84c3e455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.195.132]) by ipb1.telenor.se with ESMTP; 14 Aug 2010 14:04:26 +0200 Received: by muon.localdomain (Postfix, from userid 1000) id 4C37F4841C1; Sat, 14 Aug 2010 14:04:25 +0200 (CEST) From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Mail-Copies-To: never Date: Sat, 14 Aug 2010 14:04:25 +0200 Message-ID: <877hjt1jue.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) There are some bugs in the handling of tool bar labels that can cause Emacs to crash. ### gtkutil.c: update_frame_tool_bar ### char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL)); Here we take string data out. ### keyboard.c: parse_tool_bar_item ### else if (EQ (key, QClabel)) { /* `:label LABEL-STRING'. */ PROP (TOOL_BAR_ITEM_LABEL) = value; have_label = 1; } But here we put an arbitrary object in. ... if (!have_label) ... char buf[64]; EMACS_INT max_lbl = 2*tool_bar_max_label_size; Lisp_Object new_lbl; if (strlen (caption) < max_lbl && caption[0] != '\0') { strcpy (buf, caption); tool-bar-max-label-size is a user variable, so this can mean a buffer overflow. ... if (SCHARS (new_lbl) <= tool_bar_max_label_size) PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; If we came here but the branch is not taken, the label will be nil, not a string. From unknown Sun Aug 17 00:58:09 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Subject: bug#6855: closed (Re: bug#6855: 24.0.50; Bug in tool bar label handling) Message-ID: References: <4C67A335.1050002@swipnet.se> <877hjt1jue.fsf@gnu.org> X-Gnu-PR-Message: they-closed 6855 X-Gnu-PR-Package: emacs Reply-To: 6855@debbugs.gnu.org Date: Sun, 15 Aug 2010 08:20:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1281860403-31591-1" This is a multi-part message in MIME format... ------------=_1281860403-31591-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6855: 24.0.50; Bug in tool bar label handling which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6855@debbugs.gnu.org. --=20 6855: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6855 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1281860403-31591-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6855-done) by debbugs.gnu.org; 15 Aug 2010 08:19:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkYR0-0008DH-Pw for submit@debbugs.gnu.org; Sun, 15 Aug 2010 04:19:15 -0400 Received: from smtprelay-b12.telenor.se ([62.127.194.21]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkYQy-0008DA-9F for 6855-done@debbugs.gnu.org; Sun, 15 Aug 2010 04:19:13 -0400 Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b12.telenor.se (Postfix) with ESMTP id 19E28E9D51 for <6855-done@debbugs.gnu.org>; Sun, 15 Aug 2010 10:20:07 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAzANI/Z0xV4S0jPGdsb2JhbACHZ5hiDAEBAQE1LbZkhTsE X-IronPort-AV: E=Sophos;i="4.55,370,1278280800"; d="scan'208";a="561759183" Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb3.telenor.se with ESMTP; 15 Aug 2010 10:20:07 +0200 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id C051F7FA05A; Sun, 15 Aug 2010 10:20:06 +0200 (CEST) Message-ID: <4C67A335.1050002@swipnet.se> Date: Sun, 15 Aug 2010 10:20:05 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Johan_Bockg=E5rd?= Subject: Re: bug#6855: 24.0.50; Bug in tool bar label handling References: <877hjt1jue.fsf@gnu.org> In-Reply-To: <877hjt1jue.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 6855-done Cc: 6855-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) Johan Bockg=E5rd skrev 2010-08-14 14.04: > > There are some bugs in the handling of tool bar labels that can cause > Emacs to crash. > > > > ### gtkutil.c: update_frame_tool_bar ### > > char *label =3D SSDATA (PROP (TOOL_BAR_ITEM_LABEL)); > > Here we take string data out. > > > > ### keyboard.c: parse_tool_bar_item ### > > else if (EQ (key, QClabel)) > { > /* `:label LABEL-STRING'. */ > PROP (TOOL_BAR_ITEM_LABEL) =3D value; > have_label =3D 1; > } > > But here we put an arbitrary object in. > We kind of assume people do the sensible thing and put in strings. It is= the same as for help and image. If Emacs crashes because somebody didn't put in a string, that is actually a good thing IMHO. The error becomes very apparent then. > > ... > > if (!have_label) > > ... > char buf[64]; > EMACS_INT max_lbl =3D 2*tool_bar_max_label_size; > Lisp_Object new_lbl; > > if (strlen (caption)< max_lbl&& caption[0] !=3D '\0') > { > strcpy (buf, caption); > > tool-bar-max-label-size is a user variable, so this can mean a buffer > overflow. > > > ... > if (SCHARS (new_lbl)<=3D tool_bar_max_label_size) > PROP (TOOL_BAR_ITEM_LABEL) =3D new_lbl; > > If we came here but the branch is not taken, the label will be nil, > not a string. > I have checked in a fix for those two. Thanks, Jan D. ------------=_1281860403-31591-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Aug 2010 12:46:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkG8F-0004T9-Vx for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:46:40 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkG8E-0004T4-68 for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:46:38 -0400 Received: from lists.gnu.org ([199.232.76.165]:51184) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OkFTT-0003xz-5e for submit@debbugs.gnu.org; Sat, 14 Aug 2010 08:04:31 -0400 Received: from [140.186.70.92] (port=49092 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OkFTR-0000GJ-Ty for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OkFTP-0000SB-Sk for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:29 -0400 Received: from smtprelay-b11.telenor.se ([62.127.194.20]:37625) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkFTP-0000S3-Ji for bug-gnu-emacs@gnu.org; Sat, 14 Aug 2010 08:04:27 -0400 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 6F906E9694 for ; Sat, 14 Aug 2010 14:04:26 +0200 (CEST) X-SENDER-IP: [85.228.195.132] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQ6AIcjZkxV5MOEPGdsb2JhbACTNI0QDAEBAQE1LbsGhTsE X-IronPort-AV: E=Sophos;i="4.55,367,1278280800"; d="scan'208";a="119214920" Received: from c-84c3e455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.195.132]) by ipb1.telenor.se with ESMTP; 14 Aug 2010 14:04:26 +0200 Received: by muon.localdomain (Postfix, from userid 1000) id 4C37F4841C1; Sat, 14 Aug 2010 14:04:25 +0200 (CEST) From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Bug in tool bar label handling X-Debbugs-CC: jan.h.d@swipnet.se Mail-Copies-To: never Date: Sat, 14 Aug 2010 14:04:25 +0200 Message-ID: <877hjt1jue.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) There are some bugs in the handling of tool bar labels that can cause Emacs to crash. ### gtkutil.c: update_frame_tool_bar ### char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL)); Here we take string data out. ### keyboard.c: parse_tool_bar_item ### else if (EQ (key, QClabel)) { /* `:label LABEL-STRING'. */ PROP (TOOL_BAR_ITEM_LABEL) = value; have_label = 1; } But here we put an arbitrary object in. ... if (!have_label) ... char buf[64]; EMACS_INT max_lbl = 2*tool_bar_max_label_size; Lisp_Object new_lbl; if (strlen (caption) < max_lbl && caption[0] != '\0') { strcpy (buf, caption); tool-bar-max-label-size is a user variable, so this can mean a buffer overflow. ... if (SCHARS (new_lbl) <= tool_bar_max_label_size) PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; If we came here but the branch is not taken, the label will be nil, not a string. ------------=_1281860403-31591-1-- From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Aug 2010 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6855@debbugs.gnu.org Cc: jan.h.d@swipnet.se Received: via spool by 6855-submit@debbugs.gnu.org id=B6855.128186224632383 (code B ref 6855); Sun, 15 Aug 2010 08:51:01 +0000 Received: (at 6855) by debbugs.gnu.org; 15 Aug 2010 08:50:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkYvV-0008QG-LR for submit@debbugs.gnu.org; Sun, 15 Aug 2010 04:50:45 -0400 Received: from mail-out.m-online.net ([212.18.0.9]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkYvT-0008QA-Qs for 6855@debbugs.gnu.org; Sun, 15 Aug 2010 04:50:44 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 6CD451C158EC; Sun, 15 Aug 2010 10:51:39 +0200 (CEST) Received: from igel.home (ppp-88-217-103-111.dynamic.mnet-online.de [88.217.103.111]) by mail.mnet-online.de (Postfix) with ESMTP id 350E21C002B2; Sun, 15 Aug 2010 10:51:39 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id A81E8CA297; Sun, 15 Aug 2010 10:51:38 +0200 (CEST) From: Andreas Schwab References: <877hjt1jue.fsf@gnu.org> <4C67A335.1050002@swipnet.se> X-Yow: Is this "BOOZE"? Date: Sun, 15 Aug 2010 10:51:37 +0200 In-Reply-To: <4C67A335.1050002@swipnet.se> ("Jan =?UTF-8?Q?Dj=C3=A4rv"'s?= message of "Sun, 15 Aug 2010 10:20:05 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Jan Djärv writes: > We kind of assume people do the sensible thing and put in strings. It is the > same as for help and image. If Emacs crashes because somebody didn't put > in a string, that is actually a good thing IMHO. The error becomes very > apparent then. I don't agree. Emacs should be robust against type mismatches, crashing is the worst possible reaction. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Aug 2010 10:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas Schwab Cc: 6855@debbugs.gnu.org Received: via spool by 6855-submit@debbugs.gnu.org id=B6855.12818676472169 (code B ref 6855); Sun, 15 Aug 2010 10:21:02 +0000 Received: (at 6855) by debbugs.gnu.org; 15 Aug 2010 10:20:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkaKc-0000Yw-Qi for submit@debbugs.gnu.org; Sun, 15 Aug 2010 06:20:47 -0400 Received: from smtprelay-h21.telenor.se ([195.54.99.196]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkaKa-0000Yp-0a for 6855@debbugs.gnu.org; Sun, 15 Aug 2010 06:20:44 -0400 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h21.telenor.se (Postfix) with ESMTP id CCC1BE9C7C for <6855@debbugs.gnu.org>; Sun, 15 Aug 2010 12:21:39 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgzAGtcZ0xV4S0jPGdsb2JhbACDFYRSmGMMAQEBATUtpwuQcoEmgyJzBIRf X-IronPort-AV: E=Sophos;i="4.55,371,1278280800"; d="scan'208";a="119518202" Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb1.telenor.se with ESMTP; 15 Aug 2010 12:21:39 +0200 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id E7C777FA05A; Sun, 15 Aug 2010 12:21:38 +0200 (CEST) Message-ID: <4C67BFB1.8030804@swipnet.se> Date: Sun, 15 Aug 2010 12:21:37 +0200 From: Jan =?UTF-8?Q?Dj=C3=A4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 References: <877hjt1jue.fsf@gnu.org> <4C67A335.1050002@swipnet.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.0 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) Andreas Schwab skrev 2010-08-15 10.51: > Jan Dj=C3=A4rv writes: > >> We kind of assume people do the sensible thing and put in strings. It= is the >> same as for help and image. If Emacs crashes because somebody didn't = put >> in a string, that is actually a good thing IMHO. The error becomes ve= ry >> apparent then. > > I don't agree. Emacs should be robust against type mismatches, crashin= g > is the worst possible reaction. If the documentation states that one should use STRING, and somebody puts= in=20 nil or a lambda expression or a symbol, that is a usage error. Being rob= ust=20 against this kind of error by ignoring the faulty input just hides the er= ror=20 and makes people think it is OK to misuse things. Better then to crash, = that=20 way action is usually taken at once. Hidden errors can linger for years.= .. Jan D. From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Aug 2010 10:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Cc: 6855@debbugs.gnu.org Received: via spool by 6855-submit@debbugs.gnu.org id=B6855.12818685992818 (code B ref 6855); Sun, 15 Aug 2010 10:37:02 +0000 Received: (at 6855) by debbugs.gnu.org; 15 Aug 2010 10:36:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkaZx-0000jP-SS for submit@debbugs.gnu.org; Sun, 15 Aug 2010 06:36:39 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkaZv-0000jH-5a for 6855@debbugs.gnu.org; Sun, 15 Aug 2010 06:36:35 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id DD9611C00361; Sun, 15 Aug 2010 12:37:30 +0200 (CEST) Received: from igel.home (ppp-88-217-103-111.dynamic.mnet-online.de [88.217.103.111]) by mail.mnet-online.de (Postfix) with ESMTP id A5AE71C00188; Sun, 15 Aug 2010 12:37:30 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 291C7CA297; Sun, 15 Aug 2010 12:37:30 +0200 (CEST) From: Andreas Schwab References: <877hjt1jue.fsf@gnu.org> <4C67A335.1050002@swipnet.se> <4C67BFB1.8030804@swipnet.se> X-Yow: Is a tattoo real, like a curb or a battleship? Or are we suffering in Safeway? Date: Sun, 15 Aug 2010 12:37:29 +0200 In-Reply-To: <4C67BFB1.8030804@swipnet.se> ("Jan =?UTF-8?Q?Dj=C3=A4rv"'s?= message of "Sun, 15 Aug 2010 12:21:37 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Jan Dj=C3=A4rv writes: > If the documentation states that one should use STRING, and somebody pu= ts > in nil or a lambda expression or a symbol, that is a usage error. Sure. But crashing is a bug. > Better then to crash No, never. Andreas. --=20 Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different." From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Aug 2010 11:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Cc: 6855@debbugs.gnu.org, schwab@linux-m68k.org Reply-To: Eli Zaretskii Received: via spool by 6855-submit@debbugs.gnu.org id=B6855.12818724556884 (code B ref 6855); Sun, 15 Aug 2010 11:41:02 +0000 Received: (at 6855) by debbugs.gnu.org; 15 Aug 2010 11:40:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkbaB-0001mz-3o for submit@debbugs.gnu.org; Sun, 15 Aug 2010 07:40:55 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Okba9-0001mt-99 for 6855@debbugs.gnu.org; Sun, 15 Aug 2010 07:40:54 -0400 Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Okbb3-0003kq-Gm; Sun, 15 Aug 2010 07:41:49 -0400 From: Eli Zaretskii In-reply-to: <4C67BFB1.8030804@swipnet.se> (message from Jan =?UTF-8?Q?Dj=C3=A4rv?= on Sun, 15 Aug 2010 12:21:37 +0200) References: <877hjt1jue.fsf@gnu.org> <4C67A335.1050002@swipnet.se> <4C67BFB1.8030804@swipnet.se> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: Date: Sun, 15 Aug 2010 07:41:49 -0400 X-Spam-Score: -5.2 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.5 (------) > Date: Sun, 15 Aug 2010 12:21:37 +0200 > From: Jan Djärv > Cc: 6855@debbugs.gnu.org > > If the documentation states that one should use STRING, and somebody puts in > nil or a lambda expression or a symbol, that is a usage error. Being robust > against this kind of error by ignoring the faulty input just hides the error > and makes people think it is OK to misuse things. Better then to crash, that > way action is usually taken at once. Hidden errors can linger for years... Crash or hide are not the only alternatives. You can signal an error, for instance. Sometimes doing so is not a good idea, like in the middle of redisplay (because displaying the error message reenters redisplay again, and you have an infinite loop on your hands). For these situations, the solution is to display something prominent and acutely visible instead of the invalid data, so that it stands out and catches the user's eye. For example, if the menu item is bad, display something like "!!??GARBLED ITEM??!!" instead. In general, I agree with Andreas: it is better not to crash, if we can avoid that with a reasonable effort. From unknown Sun Aug 17 00:58:09 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6855: 24.0.50; Bug in tool bar label handling References: <877hjt1jue.fsf@gnu.org> In-Reply-To: <877hjt1jue.fsf@gnu.org> Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Aug 2010 23:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6855@debbugs.gnu.org Cc: 6835@debbugs.gnu.org, Andreas Schwab Received: via spool by 6855-submit@debbugs.gnu.org id=B6855.128191587525079 (code B ref 6855); Sun, 15 Aug 2010 23:45:02 +0000 Received: (at 6855) by debbugs.gnu.org; 15 Aug 2010 23:44:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkmsV-0006WR-KG for submit@debbugs.gnu.org; Sun, 15 Aug 2010 19:44:35 -0400 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkmsU-0006WJ-G7; Sun, 15 Aug 2010 19:44:35 -0400 Received: by wyb40 with SMTP id 40so4978522wyb.3 for ; Sun, 15 Aug 2010 16:45:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.68.207 with SMTP id w15mr3975845wbi.75.1281915931463; Sun, 15 Aug 2010 16:45:31 -0700 (PDT) Received: by 10.216.65.140 with HTTP; Sun, 15 Aug 2010 16:45:31 -0700 (PDT) Date: Sun, 15 Aug 2010 19:45:31 -0400 X-Google-Sender-Auth: A-1hu4b9PpUanxetqEs8XYwblms Message-ID: From: MON KEY Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.1 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) > I don't agree. Emacs should be robust against type mismatches, > crashing is the worst possible reaction. Unless of course that robustness is requested of `type-of', in which case presumably Andreas waffles and TRT is to simply not use a type macthing feature that may cause Emacs to crash, e.g. this recent comment re bug#6835: ,---- | | > `type-of' does consistently bring down my Emacs. | | Try without type-of. | | Andreas. | `---- http://lists.gnu.org/archive/html/bug-gnu-emacs/2010-08/msg00337.html :-P > Andreas. -- /s_P\