This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79821] [7 regression] SEGV in cc1plus compiling 64-bit stdc++.h.gch/O2g.gch
- From: "ro at CeBiTec dot Uni-Bielefeld.DE" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Mar 2017 11:55:03 +0000
- Subject: [Bug c++/79821] [7 regression] SEGV in cc1plus compiling 64-bit stdc++.h.gch/O2g.gch
- Auto-submitted: auto-generated
- References: <bug-79821-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79821
--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #6)
[...]
> Ah, so it will be most likely that
> DW_AT_const_value: floating-point or vector constant
>
> We have:
> dw_vec_const GTY ((tag ("dw_val_class_vec"))) val_vec;
> and
> struct GTY(()) dw_vec_const {
> unsigned char * GTY((atomic)) array;
> unsigned length;
> unsigned elt_size;
> };
>
> If we are calling strlen on that array, that is obviously incorrect, because
> the array contains random bytes.
> We need some way to tell GC that the array has length * elt_size size.
I'd already wondered about this:
(gdb) display/i $pc
1: x/i $pc
=> 0xfed6c634 <strlen+148>: ld [ %o2 ], %o1
(gdb) p/x $o2
$1 = 0xf9400000
#1 0x009e0208 in gt_pch_note_object (obj=0xf93ffff8,
note_ptr_cookie=0xf93ffff8,
note_ptr_fn=0xcfe544 <gt_pch_p_S(void*, void*, void (*)(void*, void*),
void*)>) at /var/gcc/reghunt/trunk/gcc/ggc-common.c:285
285 (*slot)->size = strlen ((const char *)obj) + 1;
(gdb) p obj
$2 = (void *) 0xf93ffff8
(gdb) p (char *)obj
$4 = 0xf93ffff8 "\001\257\257\257\257\257\257\257"<error: Cannot access memory
at address 0xf9400000>
where obj doesn't look like a string ;-)