Bug 18484 - Fix crash on cv-qualified self-reference
Summary: Fix crash on cv-qualified self-reference
Status: RESOLVED INVALID
Alias: None
Product: gdb
Classification: Unclassified
Component: compile (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.10
Assignee: Jan Kratochvil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 18:56 UTC by Jan Kratochvil
Modified: 2015-07-08 12:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2015-06-03 18:56:44 UTC
[patchv2] compile: Fix crash on cv-qualified self-reference
https://sourceware.org/ml/gdb-patches/2015-05/msg00434.html
Message-ID: <20150516132555.GB17266@host1.jankratochvil.net>

compile code struct_object.selffield = &struct_object
./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
A problem internal to GDB has been detected,

Fix+testcase is in the mail.

This is not a regression.
Comment 2 Jan Kratochvil 2015-07-04 17:12:36 UTC
Reopening just for the info message GDB addition patch for 7.10:
[patchv3] compile: Fix crash on cv-qualified self-reference
https://sourceware.org/ml/gdb-patches/2015-07/msg00105.html
Comment 3 cvs-commit@gcc.gnu.org 2015-07-08 12:45:45 UTC
The master branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=084641963dba63283bf2eca227f4f77c2598b172

commit 084641963dba63283bf2eca227f4f77c2598b172
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 8 14:42:19 2015 +0200

    compile: Warn for old GCC on cv-qualified self-reference
    
    GDB could:
    
    compile code struct_object.selffield = &struct_object
    ./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal
    error)
    
    The bug was not in GDB but in the GCC part interfacing with GDB.
    
    Alexandre Oliva has fixed it the right way:
    	https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commitdiff;h=072dfdba0ea62abb65514cb3a90cdf3868efe286
    	git://gcc.gnu.org/git/gcc.git
    	aoliva/libcp1
    
    Attaching this GDB testsuite update + info to user s/he should upgrade GCC.
    After Alex upstreams the fix I can update the message to contain the specific
    GCC release.
    
    gdb/ChangeLog
    2015-07-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR compile/18484
    	* compile/compile-c-types.c (insert_type): Change gdb_assert to error.
    
    gdb/testsuite/ChangeLog
    2015-07-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR compile/18484
    	* gdb.compile/compile.c (struct struct_type): Add volatile to
    	selffield's type.
    	* gdb.compile/compile.exp
    	(compile code struct_object.selffield = &struct_object): Skip further
    	struct_object tests if this one xfails.
Comment 4 cvs-commit@gcc.gnu.org 2015-07-08 12:51:10 UTC
The gdb-7.10-branch branch has been updated by Jan Kratochvil <jkratoch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=91affdd27ee8e244df417686ead2b546ee1449bf

commit 91affdd27ee8e244df417686ead2b546ee1449bf
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 8 14:42:19 2015 +0200

    compile: Warn for old GCC on cv-qualified self-reference
    
    GDB could:
    
    compile code struct_object.selffield = &struct_object
    ./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal
    error)
    
    The bug was not in GDB but in the GCC part interfacing with GDB.
    
    Alexandre Oliva has fixed it the right way:
    	https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commitdiff;h=072dfdba0ea62abb65514cb3a90cdf3868efe286
    	git://gcc.gnu.org/git/gcc.git
    	aoliva/libcp1
    
    Attaching this GDB testsuite update + info to user s/he should upgrade GCC.
    After Alex upstreams the fix I can update the message to contain the specific
    GCC release.
    
    gdb/ChangeLog
    2015-07-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR compile/18484
    	* compile/compile-c-types.c (insert_type): Change gdb_assert to error.
    
    gdb/testsuite/ChangeLog
    2015-07-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR compile/18484
    	* gdb.compile/compile.c (struct struct_type): Add volatile to
    	selffield's type.
    	* gdb.compile/compile.exp
    	(compile code struct_object.selffield = &struct_object): Skip further
    	struct_object tests if this one xfails.
Comment 5 Jan Kratochvil 2015-07-08 12:53:27 UTC
[commit] [patchv3] compile: Fix crash on cv-qualified self-reference
https://sourceware.org/ml/gdb-patches/2015-07/msg00204.html

GCC fix to be landed later.
Comment 6 Jan Kratochvil 2015-07-08 12:53:57 UTC
->GCC