From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-25 d4e1549: Guard terminal parameter in XTerm mouse mode Date: Wed, 23 Nov 2016 12:20:16 +0000 Message-ID: References: <20161122204222.29398.86534@vcs.savannah.gnu.org> <20161122204222.DBE712201C5@vcs.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11408008ff5ee10541f6e98c X-Trace: blaine.gmane.org 1479903674 10688 195.159.176.226 (23 Nov 2016 12:21:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2016 12:21:14 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 23 13:21:10 2016 Return-path: Envelope-to: ged-emacs-devel@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 1c9WY1-0001Gl-6K for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 13:21:09 +0100 Original-Received: from localhost ([::1]:33243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9WY4-0003Gl-Mg for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2016 07:21:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9WXP-0003GU-39 for emacs-devel@gnu.org; Wed, 23 Nov 2016 07:20:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9WXN-0002YV-Gr for emacs-devel@gnu.org; Wed, 23 Nov 2016 07:20:31 -0500 Original-Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:34027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9WXN-0002Xs-8s for emacs-devel@gnu.org; Wed, 23 Nov 2016 07:20:29 -0500 Original-Received: by mail-lf0-x22c.google.com with SMTP id o141so2358714lff.1 for ; Wed, 23 Nov 2016 04:20:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=UMcxQsPyLjZZScFTP1CiNdmLrqimhhs7ts2NJSfJ4a4=; b=ZgMaN5QLh5as31hqEEp8M0y8OLoDpasdO0bDGxMxDG2DPfg1cy4hPJKXJHBvr88MKJ /dstU4+d3vI83dDYmiHowixeKihD6G3O6jFtg/+M80frrCSEREZKY8gRLRsaUQXoKxGU w51c+pFaVpaKywL7gYIJvrUm7mv7zp9YOgbxwIUACcH47jvTgUvzx14r7XJIGxAM23nE 2lnh2xejfjzRaqypf7I/qIlpXUeJ7lJdxIDLWQHMg++wneWGObMxuhPyLkjVa/psWj7a WpvsqyI5N84MBU9iqjRvq9UKf805qanqBGw/EQ0bOwPji2JND0ShNwg6HFNY5hgFiUUx ULlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=UMcxQsPyLjZZScFTP1CiNdmLrqimhhs7ts2NJSfJ4a4=; b=a0o4MtE6aMYEvCcUTdB4Yt9LaUe3Rjdlr1nJUqNJhI1wLav7zTTN8Yo2jk92r3Ozn3 a+lvatv13Nnl2gcdlWtkVJ86URUSRj5jN5tFhj27vCwleY8+BGld/oNW8SpcPwLI9vzz cZqy8VntEy/xj5bYNVDTznUWayS21sAwPVxeL6wCd0UReDvWIZcSxCY6fM0usXa6eEFM p4qHwlRNLqisLvztU9WGBaICbPzOPhsYSKWrm19x4Og3HAZ06+0qbjS+4dZHqh9wBBPu PKtk4KNUKjb9rN9Gi/5F5kWNKYwqo3Sx3zr9AUqaakyFeyRyIT9F5R0YehBT+Pl9Rhen 2Omw== X-Gm-Message-State: AKaTC01M6WNAH6PhMwE8htkVKs0WsnuXFYlGhm2so+CDoFxS0430TaAy14hh4G+IKvpt41JdqyHfSMR4klCNLvoc X-Received: by 10.25.21.205 with SMTP id 74mr787270lfv.138.1479903627105; Wed, 23 Nov 2016 04:20:27 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209560 Archived-At: --001a11408008ff5ee10541f6e98c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stefan Monnier schrieb am Mi., 23. Nov. 2016 um 02:08 Uhr: > > + (setf (terminal-parameter nil 'xterm-mouse-last-down) > > + ;; EVENT might be handed back to the input queue, which > > + ;; might modify it. Copy it into the terminal parameter > > + ;; to guard against that. > > + (copy-sequence event)) > > Do you have further information about when/where events might be > modified in place? It sounds like a risky operation. > > I assume it's in the code that translates consecutive mouse-down events to mouse-movement events. It's easy to reproduce in HTerm: without the patch, dragging the mouse while holding a button causes "drag-mouse-0" events to be generated. These come from spurious mouse-movement events in xterm-mouse-last-down. Since nothing places these events explicitly there, the root cause must be that the event list is overwritten. Agreed that the input loop probably shouldn't modify event objects. But it might be a necessary optimization somewhere. Unfortunately I wasn't able to find the specific piece of code responsible for this modification. --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks. --001a11408008ff5ee10541f6e98c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Stefan= Monnier <monnier@iro.umontr= eal.ca> schrieb am Mi., 23. Nov. 2016 um 02:08=C2=A0Uhr:
> +=C2=A0 =C2=A0 =C2=A0(setf (terminal-para= meter nil 'xterm-mouse-last-down)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; EVENT might be ha= nded back to the input queue, which
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; might modify it.= =C2=A0 Copy it into the terminal parameter
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; to guard against = that.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (copy-sequence event= ))

Do you have further information about when/where events might be
modified in place?=C2=A0 It sounds like a risky operation.


I assume it's = in the code that translates consecutive mouse-down events to mouse-movement= events. It's easy to reproduce in HTerm: without the patch, dragging t= he mouse while holding a button causes "drag-mouse-0" events to b= e generated. These come from spurious mouse-movement events in =C2=A0xterm-= mouse-last-down. Since nothing places these events explicitly there, the ro= ot cause must be that the event list is overwritten.
Agreed that = the input loop probably shouldn't modify event objects. But it might be= a necessary optimization somewhere. Unfortunately I wasn't able to fin= d the specific piece of code responsible for this modification.
=
--

Google Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Ad= ressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absen= der und l=C3=B6schen Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank.

This e-mail is confidential. If you are not the right addres= see please do not forward it, please inform the sender, and please erase th= is e-mail including any attachments. Thanks.

--001a11408008ff5ee10541f6e98c--