From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Unicode Lisp reader escapes Date: Mon, 08 May 2006 11:32:48 -0400 Message-ID: References: <17491.34779.959316.484740@parhasard.net> <17495.932.70900.796282@parhasard.net> <17495.57895.90438.848865@parhasard.net> <17498.28361.392872.954484@parhasard.net> <17503.21672.395920.94783@parhasard.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1147102401 25662 80.91.229.2 (8 May 2006 15:33:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 May 2006 15:33:21 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 08 17:33:18 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fd7jX-0007mB-L1 for ged-emacs-devel@m.gmane.org; Mon, 08 May 2006 17:33:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fd7jX-0005cm-3R for ged-emacs-devel@m.gmane.org; Mon, 08 May 2006 11:33:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fd7jH-0005bY-GQ for emacs-devel@gnu.org; Mon, 08 May 2006 11:32:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fd7jF-0005aT-3w for emacs-devel@gnu.org; Mon, 08 May 2006 11:32:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fd7jE-0005aL-SW for emacs-devel@gnu.org; Mon, 08 May 2006 11:32:56 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fd7k6-0004LK-As for emacs-devel@gnu.org; Mon, 08 May 2006 11:33:50 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 755C12CF46F; Mon, 8 May 2006 11:32:56 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id D34B0445C; Mon, 8 May 2006 11:32:48 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id B83BA716B9; Mon, 8 May 2006 11:32:48 -0400 (EDT) Original-To: Aidan Kehoe In-Reply-To: <17503.21672.395920.94783@parhasard.net> (Aidan Kehoe's message of "Mon, 8 May 2006 16:24:40 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:54098 Archived-At: >> > In the calling sequence of >> > Fread-> read_internal_start->read0->read1, I see no place >> > where the original `tem' is GCPROed. Do I overlook >> > something? >>=20 >> Why would it need to be protected? it's not used afterwards. > It can theoretically disappear in the middle of being used. With my patch, > if the string consisted of "\u20AC one two", Lisp will be called, the > garbage collector may be invoked, and the string overwritten, since to the > GC it=E2=80=99s not in use. Then the READCHAR -> retry loop may end up re= ading > incorrect data.=20 That's of not concern to Fcall_interactively. It's Fread should GCPRO its argument when needed. So it seems the bug is that read_internal_start calls read0 (which can GC) and uses `stream' afterwards without having GCPRO'd it. Stefan