diff mbox

fix #69251 - [6 Regression] ICE in unify_array_domain on a flexible array member

Message ID 20160204110515.GK3017@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 4, 2016, 11:05 a.m. UTC
On Tue, Feb 02, 2016 at 06:21:04PM -0700, Martin Sebor wrote:
> gcc/cp/ChangeLog:
> 2016-02-02  Martin Sebor  <msebor@redhat.com>
> 
> 	PR c++/69251
> 	PR c++/69253
> 	PR c++/69290
> 	PR c++/69277
> 	PR c++/69349
> 	* class.c (walk_subobject_offsets): Avoid testing the upper bound
> 	of a flexible array member for equality to null.
> 	(find_flexarrays): Remove spurious whitespace introduced in r231665.
> 	(diagnose_flexarrays): Avoid checking the upper bound of arrays.
> 	(check_flexarrays): Same.

This broke bootstrap, I've committed following fix as obvious:

2016-02-04  Jakub Jelinek  <jakub@redhat.com>

	* class.c (find_flexarrays): Don't declare dom variable.
	(diagnose_flexarray): Likewise.



	Jakub

Comments

Martin Sebor Feb. 4, 2016, 3:32 p.m. UTC | #1
On 02/04/2016 04:05 AM, Jakub Jelinek wrote:
> On Tue, Feb 02, 2016 at 06:21:04PM -0700, Martin Sebor wrote:
>> gcc/cp/ChangeLog:
>> 2016-02-02  Martin Sebor  <msebor@redhat.com>
>>
>> 	PR c++/69251
>> 	PR c++/69253
>> 	PR c++/69290
>> 	PR c++/69277
>> 	PR c++/69349
>> 	* class.c (walk_subobject_offsets): Avoid testing the upper bound
>> 	of a flexible array member for equality to null.
>> 	(find_flexarrays): Remove spurious whitespace introduced in r231665.
>> 	(diagnose_flexarrays): Avoid checking the upper bound of arrays.
>> 	(check_flexarrays): Same.
>
> This broke bootstrap, I've committed following fix as obvious:

Sorry. I fixed it twice in my own builds but then as I finally
committed the patch I must have applied the wrong version of it.

FWIW, I keep having trouble with the repository.  Git doesn't
work to check things in at all and I have only one svn repository
that does.  The other one keeps giving me the error below, so
every time I have to retest a patch I end up copying it from one
machine to another, which is obviously error prone.

$ svn switch --relocate svn://gcc.gnu.org/svn/gcc 
svn+ssh://msebor@gcc.gnu.org/svn/gcc
svn: E170013: Unable to connect to a repository at URL 
'svn+ssh://msebor@gcc.gnu.org/svn/gcc/trunk'
svn: E210002: To better debug SSH connection problems, remove the -q 
option from 'ssh' in the [tunnels] section of your Subversion 
configuration file.
svn: E210002: Network connection closed unexpectedly

Martin
Jason Merrill Feb. 4, 2016, 4:38 p.m. UTC | #2
On 02/04/2016 10:32 AM, Martin Sebor wrote:
> FWIW, I keep having trouble with the repository.  Git doesn't
> work to check things in at all

The instructions here aren't working for you?

https://gcc.gnu.org/wiki/GitMirror#Commit_upstream_.28git-svn.29

> and I have only one svn repository
> that does.  The other one keeps giving me the error below, so
> every time I have to retest a patch I end up copying it from one
> machine to another, which is obviously error prone.
>
> $ svn switch --relocate svn://gcc.gnu.org/svn/gcc
> svn+ssh://msebor@gcc.gnu.org/svn/gcc
> svn: E170013: Unable to connect to a repository at URL
> 'svn+ssh://msebor@gcc.gnu.org/svn/gcc/trunk'
> svn: E210002: To better debug SSH connection problems, remove the -q
> option from 'ssh' in the [tunnels] section of your Subversion
> configuration file.
> svn: E210002: Network connection closed unexpectedly

Seems like you have ssh setup issues.

Jason
Martin Sebor Feb. 4, 2016, 5:03 p.m. UTC | #3
On 02/04/2016 09:38 AM, Jason Merrill wrote:
> On 02/04/2016 10:32 AM, Martin Sebor wrote:
>> FWIW, I keep having trouble with the repository.  Git doesn't
>> work to check things in at all
>
> The instructions here aren't working for you?
>
> https://gcc.gnu.org/wiki/GitMirror#Commit_upstream_.28git-svn.29

It doesn't (or didn't the last time I tried).  I don't recall
the error but ever since my last attempt my local copy is in
a state where each time I pull I get asked to merge.  When I
try to run git svn rebase the command never finishes.

I use Git to check out code and to manage my local branches
(usually one per bug) but when it comes time to test on another
machine I create a patch, copy it to the other machine, apply
it, test it, tweak it, and then copy it back, apply it to the
SVN copy, retest it lightly, and then check it in.  That's
obviously too many steps where things can and do go wrong.
I just haven't found a good way to avoid them.  IIUC, with
Git, I should be able to share/clone my work branch across
all the machines I test on, and also be able to push the final
changes to the origin.  I just haven't figured out a way to do
it.


>> and I have only one svn repository
>> that does.  The other one keeps giving me the error below, so
>> every time I have to retest a patch I end up copying it from one
>> machine to another, which is obviously error prone.
>>
>> $ svn switch --relocate svn://gcc.gnu.org/svn/gcc
>> svn+ssh://msebor@gcc.gnu.org/svn/gcc
>> svn: E170013: Unable to connect to a repository at URL
>> 'svn+ssh://msebor@gcc.gnu.org/svn/gcc/trunk'
>> svn: E210002: To better debug SSH connection problems, remove the -q
>> option from 'ssh' in the [tunnels] section of your Subversion
>> configuration file.
>> svn: E210002: Network connection closed unexpectedly
>
> Seems like you have ssh setup issues.

Right.  I just figured it out. I had to generate a new pair of ssh
keys on the machine and upload the public key from the machine that
can connect by running

   ssh msebor@gcc.gnu.org append-key < new-keyfile

There's a mention of doing this in the "Tips&Tricks around your
account" section way at the bottom of the Read-write SVN access
page but it's not explicit enough for my dense brain.

Martin
Mike Stump Feb. 4, 2016, 5:39 p.m. UTC | #4
On Feb 4, 2016, at 7:32 AM, Martin Sebor <msebor@gmail.com> wrote:
> FWIW, I keep having trouble with the repository.

> $ svn switch --relocate svn://gcc.gnu.org/svn/gcc svn+ssh://msebor@gcc.gnu.org/svn/gcc
> svn: E170013: Unable to connect to a repository at URL 'svn+ssh://msebor@gcc.gnu.org/svn/gcc/trunk'
> svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
> svn: E210002: Network connection closed unexpectedly

You forgot to do:

  ssh -oPubkeyAcceptedKeyTypes=+ssh-dss YOUR_ID@gcc.gnu.org append-key <~/.ssh/id_rsa.pub

Isn’t that obvious?  Be sure you have an id_rsa key first, of course.  Once you do this, then, you can use svn as normal.

If you want to double check first before doing the above, you can add:

ssh = /usr/bin/ssh -oPubkeyAcceptedKeyTypes=+ssh-dss

right after:

  [tunnels]

in ~/.subversion/config, and then do an svn up ChangeLog, and see if it works.  If it does, then you will want to do the first command.  Once you do the first, you will then want to comment out the line you just added to the ~/.subversion/config file, if you added it.  If it does not work, you will want to use:

ssh = /usr/bin/ssh -v

and then have an expert read through the 50 lines of goop and figure it out for you.  If you use some other ssh, and not the one in /usr/bin, you will want to update the full path to ssh above to use the one you actually use.  For example, I happen to use:

ssh = /opt/local/bin/ssh

If you do email the ssh -v output, don’t send to the full list, you can send it to me privately, if you don’t know where to go from there.
Martin Sebor Feb. 4, 2016, 6:23 p.m. UTC | #5
On 02/04/2016 10:39 AM, Mike Stump wrote:
> On Feb 4, 2016, at 7:32 AM, Martin Sebor <msebor@gmail.com> wrote:
>> FWIW, I keep having trouble with the repository.
>
>> $ svn switch --relocate svn://gcc.gnu.org/svn/gcc svn+ssh://msebor@gcc.gnu.org/svn/gcc
>> svn: E170013: Unable to connect to a repository at URL 'svn+ssh://msebor@gcc.gnu.org/svn/gcc/trunk'
>> svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
>> svn: E210002: Network connection closed unexpectedly
>
> You forgot to do:
>
>    ssh -oPubkeyAcceptedKeyTypes=+ssh-dss YOUR_ID@gcc.gnu.org append-key <~/.ssh/id_rsa.pub
>
> Isn’t that obvious?  Be sure you have an id_rsa key first, of course.  Once you do this, then, you can use svn as normal.

Yes, I sure did!  (But no, it wasn't obvious to me.  I recently
upgraded this machine and did it differently than I normally do,
so things are, well, different than I expected.  FWIW, it would
be nice to mention this as the first step at the top in the
Authenticated access section: "remember to upload your public
ssh key before accessing SVN via SSH! Doh!")

>
> If you want to double check first before doing the above, you can add:
>
> ssh = /usr/bin/ssh -oPubkeyAcceptedKeyTypes=+ssh-dss
>
> right after:
>
>    [tunnels]
>
> in ~/.subversion/config, and then do an svn up ChangeLog, and see if it works.  If it does, then you will want to do the first command.  Once you do the first, you will then want to comment out the line you just added to the ~/.subversion/config file, if you added it.  If it does not work, you will want to use:
>
> ssh = /usr/bin/ssh -v
>
> and then have an expert read through the 50 lines of goop and figure it out for you.  If you use some other ssh, and not the one in /usr/bin, you will want to update the full path to ssh above to use the one you actually use.  For example, I happen to use:
>
> ssh = /opt/local/bin/ssh
>
> If you do email the ssh -v output, don’t send to the full list, you can send it to me privately, if you don’t know where to go from there.

Thanks. I have Subversion working now.  Git's another story.

Martin
Mike Stump Feb. 4, 2016, 7:32 p.m. UTC | #6
On Feb 4, 2016, at 10:23 AM, Martin Sebor <msebor@gmail.com> wrote:
> Yes, I sure did!  (But no, it wasn't obvious to me.  I recently
> upgraded this machine and did it differently than I normally do,
> so things are, well, different than I expected.  FWIW, it would
> be nice to mention this as the first step at the top in the
> Authenticated access section: "remember to upload your public
> ssh key before accessing SVN via SSH! Doh!”)

But, you can’t upload a key without first uploading a key.  This whole thing is because ssh removed an authentication method, and that is the method that lots of people use.  This happens once every 10 or 20 years, and isn’t a normal occurrence.
diff mbox

Patch

--- gcc/cp/class.c.jj	2016-02-04 10:00:26.000000000 +0100
+++ gcc/cp/class.c	2016-02-04 12:01:38.341794819 +0100
@@ -6683,7 +6683,7 @@  find_flexarrays (tree t, flexmems_t *fme
 	continue;
 
       /* Determine the upper bound of the array if it has one.  */
-      if (tree dom = TYPE_DOMAIN (fldtype))
+      if (TYPE_DOMAIN (fldtype))
 	{
 	  if (fmem->array)
 	    {
@@ -6694,7 +6694,7 @@  find_flexarrays (tree t, flexmems_t *fme
 	      if (!fmem->after)
 		fmem->after = fld;
 	    }
-	  else if (integer_all_onesp (TYPE_MAX_VALUE (dom)))
+	  else if (integer_all_onesp (TYPE_MAX_VALUE (TYPE_DOMAIN (fldtype))))
 	    /* Remember the first zero-length array unless a flexible array
 	       member has already been seen.  */
 	    fmem->array = fld;
@@ -6732,7 +6732,7 @@  diagnose_flexarrays (tree t, const flexm
 
   const char *msg = 0;
 
-  if (const_tree dom = TYPE_DOMAIN (TREE_TYPE (fmem->array)))
+  if (TYPE_DOMAIN (TREE_TYPE (fmem->array)))
     {
       if (fmem->after)
 	msg = G_("zero-size array member %qD not at end of %q#T");