From unknown Wed Aug 20 02:47:00 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#43409 <43409@debbugs.gnu.org> To: bug#43409 <43409@debbugs.gnu.org> Subject: Status: 28.0.50; Segfault on non-UTF-8 path Reply-To: bug#43409 <43409@debbugs.gnu.org> Date: Wed, 20 Aug 2025 09:47:00 +0000 retitle 43409 28.0.50; Segfault on non-UTF-8 path reassign 43409 emacs submitter 43409 Lars Ingebrigtsen severity 43409 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 14 20:16:47 2020 Received: (at submit) by debbugs.gnu.org; 15 Sep 2020 00:16:47 +0000 Received: from localhost ([127.0.0.1]:56679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHyeN-0006MG-3Y for submit@debbugs.gnu.org; Mon, 14 Sep 2020 20:16:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:35386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHyeK-0006M8-KR for submit@debbugs.gnu.org; Mon, 14 Sep 2020 20:16:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHyeK-0003VV-Cb for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 20:16:44 -0400 Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:55556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHyeI-0006ZN-KT for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 20:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding: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=9qWJTZLlN+MLcI/cJS0lS+xwdaqs1ejPo67Ec4Vm2oc=; b=JuDSYadZ8+Tnx4lk7k2EMHUfM2 8FK8bfpgNqy5QXrVNOesemJxQRhSkdSOL2V8/rHcK0jZz6y5laGkrr3XkRg265ULLzFii7jl8ZIXl cVGGJ2IfkDsxzAiPRrfXHsDEIfViC+6vAHQQRfeXFDBtiq48yf6FTr+XnMkLtuRH0bOk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHyeD-0000TY-Fr for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 02:16:40 +0200 From: Lars Ingebrigtsen To: bug-gnu-emacs@gnu.org Subject: 28.0.50; Segfault on non-UTF-8 path Date: Tue, 15 Sep 2020 02:16:36 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: On Debian bullseye, with a file looking like this in a dired buffer: Hitting RET on that kills Emacs. Running under gdb, I get this backtrace: #0 terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:378 #1 0x00005555555984fe in emacs_abort () at sysdep.c:2280 #2 0x0000555555596a9a in multibyte_chars_ [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain On Debian bullseye, with a file looking like this in a dired buffer: --=-=-= Content-Type: image/png Content-Disposition: inline Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAtIAAAAcBAMAAAC+OUV0AAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEUaGhoAAAD///+HzvoA //+p4fWkAAAAAWJLR0QCZgt8ZAAAABBjYU52AAAGQAAABLAAAAAFAAABOkAB+tUAAAKfSURBVGje 7ZmLccMgDIbTESBZwP8GOSbInfefqSAeEhgc8qhTWtSEIgsE+YwxiNPpSyXRi4ZNbA5WnLp4NVo3 KgukG1KjK/rIentWympQF6JVNg6FvF3RDapKio4VhdW45HwNif2adN1Y1V00TqEihoqdTaprfA0T ynt7yhtfiLwYcrWVkyRtf0UAQD1kHpHlRhVV3b3hnAZ0cAUs3VZBOt2RWI8SW1gj+wWA7IEgTU7Z saNhrPjEpldBWhliZ68FK1mukbQzUI0zVSO1Qpq8mHR/9kiPIDiwLdNdkp+RlkzSe5gn6UPk3Jhw J+n3D2rzUOHrXyM9qkzSk/Qk3RLeQGDZK7ZrbToVC+PCmu+JsnLZSp0bXtcsGY40li2efXg9ThOn pVKPmuR2XU6W85uvZLV/l5vNXG72HyfDkdb7pHWntbweLagsOqhJbpdyshzqpFf3scnN54YjjV6W T5OuN8ntoti/65K0p5xIq0FJ32H53OzB3NB0tWkXgnyNtEqk1WdJI4wFCLWw9pAOwaDFx5DKuaVp bZH23ilmpHGXtEYMkmkRf1LKTx8uXS9ryFXftT9NOsTZaEpzCasuV1ObpGk8satua4s08fDw8jDp hnQMBlJcTxRGJKsc5JVehi5XfdceMqZF2LjysLd7VRlb0dUD1iZpFcO4ciaukOZBHJ8DSVrFkRym aJvDQRv8Fmm9vEZap2AxzQ/d1jbp9Cztk0b2gNZJ+3k6vBRHJ50dG6DfWvoUFigU9CukpafamI7D mZNJOieNTtLIe4TfTzq97l4m/eA5YjF9ZHvE8hyxSVqHQ0T5UARPa7lH/PAbkZvvJf2uc8TW7auc IxZLIKEm0mIJl0iXcY9PrPKGEAzW30l6kp6kJ+n/RnpUmaSPkm/4pOEvIPaO4wAAAABJRU5ErkJg gg== --=-=-= Content-Type: text/plain Hitting RET on that kills Emacs. Running under gdb, I get this backtrace: #0 terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:378 #1 0x00005555555984fe in emacs_abort () at sysdep.c:2280 #2 0x0000555555596a9a in multibyte_chars_in_text (ptr=, ptr@entry=0x5555565f0870 "f\363o", nbytes=nbytes@entry=3) at character.c:447 #3 0x00005555555d412b in display_mode_element (it=, depth=, field_width=, precision=, elt=, props=, risky=) at xdisp.c:25644 #4 0x00005555555d54b0 in display_mode_element (it=0x7fffffffb840, depth=2, field_width=-1, precision=-1, elt=, props=XIL(0), risky=) at lisp.h:1423 #5 0x00005555555d63c2 in gui_consider_frame_title (frame=XIL(0x555555f64c45)) at lisp.h:1007 #6 0x00005555555e15d9 in prepare_menu_bars () at xdisp.c:12666 #7 redisplay_internal () at xdisp.c:15514 #8 0x000055555568baeb in read_char (commandflag=1, map=XIL(0x5555563fb2b3), prev_event=XIL(0), used_mouse_menu=0x7fffffffe52b, end_time=0x0) at keyboard.c:2493 #9 0x000055555568e9c4 in read_key_sequence (keybuf=, prompt=XIL(0), dont_downcase_last=, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=) at keyboard.c:9547 #10 0x000055555569034c in command_loop_1 () at lisp.h:1007 #11 0x00005555556fbf17 in internal_condition_case (bfun=bfun@entry=0x555555690170 , handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x555555686ad0 ) at eval.c:1356 #12 0x0000555555681504 in command_loop_2 (ignore=ignore@entry=XIL(0)) at lisp.h:1007 #13 0x00005555556fbe71 in internal_catch (tag=tag@entry=XIL(0xd200), func=func@entry=0x5555556814e0 , arg=arg@entry=XIL(0)) at eval.c:1117 #14 0x00005555556814ab in command_loop () at lisp.h:1007 #15 0x00005555556866e6 in recursive_edit_1 () at keyboard.c:714 #16 0x0000555555686a12 in Frecursive_edit () at keyboard.c:786 #17 0x000055555559fb54 in main (argc=2, argv=) at emacs.c:2047 This is with [larsi@stories ~]$ echo $LANG en_US.UTF-8 In GNU Emacs 28.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0) of 2020-09-14 built on stories Repository revision: e408f2fab24ea81f74d9b84dc83ee67d562846dc Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: https://lars.ingebrigtsen.no --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 10:15:12 2020 Received: (at 43409) by debbugs.gnu.org; 15 Sep 2020 14:15:12 +0000 Received: from localhost ([127.0.0.1]:59981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIBjk-0005Ww-Hw for submit@debbugs.gnu.org; Tue, 15 Sep 2020 10:15:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIBjf-0005WW-EX for 43409@debbugs.gnu.org; Tue, 15 Sep 2020 10:15:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45649) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIBjY-0008FI-Ld; Tue, 15 Sep 2020 10:15:02 -0400 Received: from [176.228.60.248] (port=4264 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kIBjX-0005HV-0Y; Tue, 15 Sep 2020 10:14:59 -0400 Date: Tue, 15 Sep 2020 17:15:06 +0300 Message-Id: <834knz9led.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: (message from Lars Ingebrigtsen on Tue, 15 Sep 2020 02:16:36 +0200) Subject: Re: bug#43409: 28.0.50; Segfault on non-UTF-8 path References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43409 Cc: 43409@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Tue, 15 Sep 2020 02:16:36 +0200 > > Hitting RET on that kills Emacs. Running under gdb, I get this > backtrace: > > #0 terminate_due_to_signal > (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:378 > #1 0x00005555555984fe in emacs_abort () at sysdep.c:2280 > #2 0x0000555555596a9a in multibyte_chars_in_text (ptr=, > ptr@entry=0x5555565f0870 "f\363o", nbytes=nbytes@entry=3) > at character.c:447 > #3 0x00005555555d412b in display_mode_element > (it=, depth=, field_width=, precision=, elt=, props=, risky=) at xdisp.c:25644 My bad, sorry: I used a wrong API for the job. Does the below solve the problem? diff --git a/src/xdisp.c b/src/xdisp.c index 10ddb53dba..615f0ca7cf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25641,8 +25641,10 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, /* Non-ASCII characters in SPEC should cause mode-line element be displayed as a multibyte string. */ ptrdiff_t nbytes = strlen (spec); - if (multibyte_chars_in_text ((const unsigned char *)spec, - nbytes) != nbytes) + ptrdiff_t nchars, mb_nbytes; + parse_str_as_multibyte ((const unsigned char *)spec, nbytes, + &nchars, &mb_nbytes); + if (!(nbytes == nchars || nbytes != mb_nbytes)) multibyte = true; switch (mode_line_target) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 11:12:28 2020 Received: (at 43409) by debbugs.gnu.org; 15 Sep 2020 15:12:28 +0000 Received: from localhost ([127.0.0.1]:60178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kICdA-00075Y-4i for submit@debbugs.gnu.org; Tue, 15 Sep 2020 11:12:28 -0400 Received: from quimby.gnus.org ([95.216.78.240]:46468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kICcz-000758-S2 for 43409@debbugs.gnu.org; Tue, 15 Sep 2020 11:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=T5L8QWqSmY7XeyxsL9C2znhwFyIVdw/R+zcJHF4NZwc=; b=N/n3sq88N0tq4wcULvHrmwNGqz n9o9i7fOvJbfK7Y0Y//5KCIloIN7FP2sHXBE4C8mKUExxk/hyC8X2F21MtUN+WStKTQ0I/d3BqYkT DHj4sJ1v8ESIs7AngCcp7aF48/hC0S/GsSVTJfM5ReiovIO8Qz1cVeD0gHupTjXDH3ck=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kICcr-0001gX-Ds; Tue, 15 Sep 2020 17:12:11 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#43409: 28.0.50; Segfault on non-UTF-8 path References: <834knz9led.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQAAAAB/ecQqAAAABGdBTUEAALGPC/xhBQAAAAJi S0dEAAHdihOkAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH5AkPCzUmaBspuQAAABBJREFU GNNj+A8GDKMUdSgAT1Qe8M8TmhgAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDktMTVUMTE6NTM6 MzgrMDA6MDBIuYtMAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA5LTE1VDExOjUzOjM4KzAwOjAw OeQz8AAAAABJRU5ErkJggg== X-Now-Playing: Saito Koji's _433-1_: "433_048" Date: Tue, 15 Sep 2020 17:12:08 +0200 In-Reply-To: <834knz9led.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 15 Sep 2020 17:15:06 +0300") Message-ID: <87r1r36pmf.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > My bad, sorry: I used a wrong API for the job. Does the below solve > the problem? Yup, that fixes the problem. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43409 Cc: 43409@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > My bad, sorry: I used a wrong API for the job. Does the below solve > the problem? Yup, that fixes the problem. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 15 11:45:06 2020 Received: (at 43409-done) by debbugs.gnu.org; 15 Sep 2020 15:45:06 +0000 Received: from localhost ([127.0.0.1]:60330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kID8k-0003zS-44 for submit@debbugs.gnu.org; Tue, 15 Sep 2020 11:45:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kID8h-0003tl-PL for 43409-done@debbugs.gnu.org; Tue, 15 Sep 2020 11:45:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47804) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kID8c-0005PC-Ee; Tue, 15 Sep 2020 11:44:58 -0400 Received: from [176.228.60.248] (port=1843 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kID8a-0005RO-Vg; Tue, 15 Sep 2020 11:44:57 -0400 Date: Tue, 15 Sep 2020 18:45:03 +0300 Message-Id: <83k0wv82o0.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87r1r36pmf.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 15 Sep 2020 17:12:08 +0200) Subject: Re: bug#43409: 28.0.50; Segfault on non-UTF-8 path References: <834knz9led.fsf@gnu.org> <87r1r36pmf.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43409-done Cc: 43409-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: 43409@debbugs.gnu.org > Date: Tue, 15 Sep 2020 17:12:08 +0200 > > Eli Zaretskii writes: > > > My bad, sorry: I used a wrong API for the job. Does the below solve > > the problem? > > Yup, that fixes the problem. Thanks, installed. From unknown Wed Aug 20 02:47:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 14 Oct 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator