From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127052 invoked by alias); 1 Apr 2015 11:53:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 127043 invoked by uid 89); 1 Apr 2015 11:53:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Apr 2015 11:53:10 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id B7042A80970; Wed, 1 Apr 2015 13:53:07 +0200 (CEST) Date: Wed, 01 Apr 2015 11:53:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: Re: [patch/cygwin] Remove dependency on __COPY_CONTEXT_SIZE Message-ID: <20150401115307.GS13285@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20150330100454.GA8372@calimero.vinschen.de> <551A9443.5010907@redhat.com> <20150331143643.GA10846@calimero.vinschen.de> <551AB630.4010800@redhat.com> <20150331154215.GL13285@calimero.vinschen.de> <551ACB9E.2080902@redhat.com> <20150331183239.GA14520@calimero.vinschen.de> <551BCC1E.90306@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UOYwgDhKKQYesrzQ" Content-Disposition: inline In-Reply-To: <551BCC1E.90306@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00023.txt.bz2 --UOYwgDhKKQYesrzQ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2264 On Apr 1 11:44, Pedro Alves wrote: > On 03/31/2015 07:32 PM, Corinna Vinschen wrote: > > On Mar 31 17:30, Pedro Alves wrote: > >> I think it's bad to hard code > >> the size of the CONTEXT structure, but won't argue further. Patch > >> is OK if you'd really like to apply it as is. > >=20 > > Thanks. But incidentally I retract the patch. It seems we made a > > mistake both, on 32 and 64 bit Cygwin as far as the definition of > > __COPY_CONTEXT_SIZE is concerned. Changing that to sizeof(CONTEXT) now > > would potentially break backward compatibility with all Cygwin versions > > up to today. Oh well. >=20 > Not sure I understand what you mean, but OK. I was a bit unclear, sorry. What I was trying to say is this. Only yesterday in a discussion on IRC it turned out that the definition of __COPY_CONTEXT_SIZE was never identical to sizeof(CONTEXT). The definition of __COPY_CONTEXT_SIZE was based on an underlying datatype, almost, but not quite identical to CONTEXT (i.e. a bug). As a result, __COPY_CONTEXT_SIZE < sizeof(CONTEXT). Worse, Cygwin itself up to the current version 1.7.35 (fixed in the git repo) only stored the leading __COPY_CONTEXT_SIZE bytes of the signal CONTEXT to=20 internal storage for GDB's digestion. Assuming we change GDB now to copy sizeof(CONTEXT), and assuming we're running under a Cygwin <=3D 1.7.35. GDB would copy random data following the leading __COPY_CONTEXT_SIZE bytes of a CONTEXT to its own CONTEXT. Thus, when later calling SetThreadContext with this data, it would copy random data into the OSes thread context. Which sounds like a really, really bad idea to me. Therefore, for backward compat reasons we should keep this up for a while, until we decide not to support Cygwin versions <=3D 1.7.35 in GDB any longer. Given that only the leading part of the signal context (actually, basically only the content of Eip/Rip) is really important here, nothing much is lost. I hope I could clarify the situation. If you have another idea how we could handle this a bit..., well, more correct or something, please do tell. > > Sorry for the longish discussion for nothing :( >=20 > Sounds like it wasn't for nothing then. Indeed :) Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --UOYwgDhKKQYesrzQ Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVG9wjAAoJEPU2Bp2uRE+gao0P/3IRs+cQezIuUcBl2pNT2wRD 0ydVPYsB2TlWyCEbX2iV9fduifhfvbwXPxav/zqFaqfM9KfrJsQIJKakBz0sFdBO /W1vWpIg0tUmTV91SrCF0kvzDX44lOSPJM+M36XiiXwTc15GBirdUzVfkGcsKlJJ 2164ThF6LI0/NFxguaqgymi84Gq3EnHBpTSnF0Q1zyEN+O8ZQHaUujERk2B71vgy nZSn0wsEwSfT0omwfkx4rHK5Mhh6NCktgZeloBVHghzT6vhkevuPz0JRNBAMheQJ +ghnnRNzg3BdD+xnJXjeWCJe/jasRBifleYhijKyZjQtuaHMIckrEJFpDqAMVzhR JHQKW/Ixo91IWX5h4bOBnV6//HRah5wNLeEKy5ZmnOdq4oUa0dzR1hqVWWlM9uH1 yoHvCq/zOfwou1rxAVTsopIQENzOGGMAGKXQkIdlPYKjD3nRAXLNpyxXLQwqqt1h JFw+vOBhtjwOoWuUX07dQy+9n75D3vULwb3d+9BAWxfgavUnsmEzLY1eTX6aPUNM 3y34W5wMkjKmdK24HNsVNW+EwwyVz6uX10i6MvoWfHChTdLZ53imeZJN0h9x8A01 m+c/t1DNDhHBlkqpP26zxuDdtQpc73dA59K7xhgLZfYmUpfPlTLJJg8hMjduto49 mwyM0AsEuDt47Cc7REdk =Q4kh -----END PGP SIGNATURE----- --UOYwgDhKKQYesrzQ--