From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 6ed1994d27: Prevent crashes from illegal locale coding systems Date: Tue, 15 Feb 2022 16:07:26 +0200 Message-ID: <8335kk440x.fsf@gnu.org> References: <83czjqrkew.fsf@gnu.org> <874k52kiu4.fsf@yahoo.com> <837d9yribj.fsf@gnu.org> <87v8xii83e.fsf@yahoo.com> <83r186p1h8.fsf@gnu.org> <878ruehx6n.fsf@yahoo.com> <83h791pmnl.fsf@gnu.org> <87iltheyeu.fsf@yahoo.com> <83wnhwol2o.fsf@gnu.org> <87tud0ybhj.fsf@yahoo.com> <837d9w450e.fsf@gnu.org> <87czjow7x1.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 15 15:10:37 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJyXM-000096-PX for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Feb 2022 15:10:37 +0100 Original-Received: from localhost ([::1]:54244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJyXL-00061q-27 for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Feb 2022 09:10:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJyUF-00034M-T7 for emacs-devel@gnu.org; Tue, 15 Feb 2022 09:07:23 -0500 Original-Received: from [2001:470:142:3::e] (port=56802 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJyUF-0003yN-Co; Tue, 15 Feb 2022 09:07:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nh2Xy9JqqoPbpCD5tpe+XIgVPhYDTSI+bkdpfrBahbs=; b=bRVnzggRtwhG CUMKtrtfju8ocvHDqat7O+37gyTli0Mg9FkHxoMEJB0T3/lkGQ6nGjw/9bEHvygg2N2feNzWc8EBM AjhfZY8a2vY+Yya0IaOWbiGrG+DvZsus4MGK3WPQhU3rAuAQMpoqA8I3BRNONaEU5RODUMPcB/82e oX8hgSOc7dQPMWSV//DzTdLrnitAfxSwINXI6XflDPC1F4yfJiWVGjfqDa6rxF05NbDAwSuMg7d2T Qg9GRskaU5Yljmh/0ywPLv3TAUJMF3iInteMBrPkz87YXu7RZZnUqcou0oLj6569ELwSqy2vlP4S9 pNiv1hOfPkc93B53b9cKjA==; Original-Received: from [87.69.77.57] (port=4694 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJyUE-0007q2-So; Tue, 15 Feb 2022 09:07:23 -0500 In-Reply-To: <87czjow7x1.fsf@yahoo.com> (message from Po Lu on Tue, 15 Feb 2022 21:55:54 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286331 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Tue, 15 Feb 2022 21:55:54 +0800 > > > But this means we cannot call the decoding stuff there at all, because > > some coding-systems call into Lisp, and Lisp can signal an error. So > > we probably should take the raw bytes in that place, record them in > > the event queue, and then decode it later, when it's safe. > > What safe place would you find appropriate for the job? Where we read input in keyboard.c, for example. Basically, any time we are in the "normal" context of the main thread and in the Emacs command loop. > And I'm not sure if we have a mechanism in place to record the raw > bytes that way, so one will have to be devised. The event queue has members that are Lisp objects; can't you use them to record unibyte strings?