public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Try to fix recently introduced crashes in ggc_collect
@ 2017-05-18 15:22 Bernd Edlinger
  2017-05-18 15:36 ` Richard Biener
  0 siblings, 1 reply; 20+ messages in thread
From: Bernd Edlinger @ 2017-05-18 15:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek, Richard Biener, Jeff Law

[-- Attachment #1: Type: text/plain, Size: 2862 bytes --]

Hi,


this attempts to fix occasional segmentation faults that are present in
the current snapshot, while previous snapshot was stable.

I observed numerous crashes but all were non-reproducible,
like the following example:

In file included from 
/home/ed/gnu/gcc-build-1/x86_64-pc-linux-gnu/libstdc++-v3/include/string:52:0,
                  from 
/home/ed/gnu/gcc-8-20170514-1/gcc/testsuite/g++.dg/asan/asan_test_config.h:19,
                  from 
/home/ed/gnu/gcc-8-20170514-1/gcc/testsuite/g++.dg/asan/asan_test_utils.h:17,
                  from 
/home/ed/gnu/gcc-8-20170514-1/gcc/testsuite/g++.dg/asan/asan_globals_test.cc:12,
                  from 
/home/ed/gnu/gcc-8-20170514-1/gcc/testsuite/g++.dg/asan/asan_globals_test-wrapper.cc:2:
/home/ed/gnu/gcc-build-1/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:6277:22: 
internal compiler error: Segmentation fault
0xd7e17f crash_signal
         ../../gcc-8-20170514-1/gcc/toplev.c:337
0x8f23fe ggc_set_mark(void const*)
         ../../gcc-8-20170514-1/gcc/ggc-page.c:1546
0x7e6a5f gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:133
0x7e8c7a gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:235
0x7e8882 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:365
0x81b26d gt_ggc_mx_cp_binding_level(void*)
         ./gt-cp-name-lookup.h:72
0x7e6d85 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:648
0x7e8ad2 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:221
0x7e8eeb gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:337
0x7e8a3c gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:441
0x7e7304 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:606
0x81b352 gt_ggc_mx_cxx_binding(void*)
         ./gt-cp-name-lookup.h:60
0x7e6d85 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:648
0x7e8ef5 gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:336
0x7e8a3c gt_ggc_mx_lang_tree_node(void*)
         ./gt-cp-tree.h:441
0xb2edbe void gt_ggc_mx<tree_node*>(vec<tree_node*, va_gc, vl_embed>*)
         ../../gcc-8-20170514-1/gcc/vec.h:1110
0xb2edbe gt_ggc_mx_vec_tree_va_gc_(void*)
         /home/ed/gnu/gcc-build-1/gcc/gtype-desc.c:1737
0xac59f5 ggc_mark_root_tab
         ../../gcc-8-20170514-1/gcc/ggc-common.c:77
0xac5c50 ggc_mark_roots()
         ../../gcc-8-20170514-1/gcc/ggc-common.c:94
0x8f2de7 ggc_collect()
         ../../gcc-8-20170514-1/gcc/ggc-page.c:2206
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.


The following patch fixes one rather suspicious static tree
object that did not have the GTY attribute, and was therefore
apparently not in the GC root set.


Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


Thanks
Bernd.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-ggc-crash.diff --]
[-- Type: text/x-patch; name="patch-ggc-crash.diff", Size: 1714 bytes --]

gcc/c-family:
2017-05-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* c-format.c (local_tree_type_node): Add GTY attribute.

gcc/c:
2017-05-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* config-lang.in (gtfiles): Add c-family/c-format.c.


--- gcc/c-family/c-format.c.jj	2017-05-09 04:47:14.000000000 +0200
+++ gcc/c-family/c-format.c	2017-05-18 13:57:15.235153933 +0200
@@ -54,7 +54,7 @@
 };
 
 /* Initialized in init_dynamic_diag_info.  */
-static tree local_tree_type_node;
+static GTY(()) tree local_tree_type_node;
 
 static bool decode_format_attr (tree, function_format_info *, int);
 static int decode_format_type (const char *);
@@ -4211,3 +4211,5 @@
 } // namespace selftest
 
 #endif /* CHECKING_P */
+
+#include "gt-c-family-c-format.h"
--- gcc/c/config-lang.in.jj	2017-01-01 13:07:43.000000000 +0100
+++ gcc/c/config-lang.in	2017-05-18 14:16:46.469924118 +0200
@@ -29,4 +29,4 @@
 
 target_libs=
 
-gtfiles="\$(srcdir)/c/c-lang.c \$(srcdir)/c/c-tree.h \$(srcdir)/c/c-decl.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/c/c-objc-common.c \$(srcdir)/c/c-parser.h \$(srcdir)/c/c-parser.c \$(srcdir)/c/c-lang.h"
+gtfiles="\$(srcdir)/c/c-lang.c \$(srcdir)/c/c-tree.h \$(srcdir)/c/c-decl.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/c-family/c-format.c \$(srcdir)/c/c-objc-common.c \$(srcdir)/c/c-parser.h \$(srcdir)/c/c-parser.c \$(srcdir)/c/c-lang.h"

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [PATCH] Try harder to fix recently introduced crashes in ggc_collect
@ 2017-05-19 17:25 Dominique d'Humières
  2017-05-19 17:31 ` Bernd Edlinger
  0 siblings, 1 reply; 20+ messages in thread
From: Dominique d'Humières @ 2017-05-19 17:25 UTC (permalink / raw)
  To: bernd.edlinger; +Cc: gcc-patches

Hi Bernd,

Your patches are causing troubles when I try to do "incremental updates »:

After revision r248290 it fails with

../../work/gcc/cp/init.c:4916:10: fatal error: gt-cp-init.h: No such file or directory
 #include "gt-cp-init.h »

and after r248242 with

../../work/gcc/c-family/c-format.c:4215:10: fatal error: gt-c-family-c-format.h: No such file or directory
 #include "gt-c-family-c-format.h »

Note that after r248242 a full bootstrap succeeded (don’t know yet for r248290).

Is there a way to fix that?

TIA

Dominique


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-05-24 19:28 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18 15:22 [PATCH] Try to fix recently introduced crashes in ggc_collect Bernd Edlinger
2017-05-18 15:36 ` Richard Biener
2017-05-18 20:51   ` [PATCH] Try harder " Bernd Edlinger
2017-05-19  0:16     ` Nathan Sidwell
2017-05-19  7:58     ` Richard Biener
2017-05-19 11:06       ` Nathan Sidwell
2017-05-19 14:10       ` Bernd Edlinger
2017-05-19 14:15         ` Nathan Sidwell
2017-05-19 14:34           ` Bernd Edlinger
2017-05-24 11:21           ` Trevor Saunders
2017-05-24 19:12             ` Jason Merrill
2017-05-24 19:29               ` Nathan Sidwell
2017-05-18 20:58   ` [PATCH] Try " Bernd Edlinger
2017-05-19 17:25 [PATCH] Try harder " Dominique d'Humières
2017-05-19 17:31 ` Bernd Edlinger
2017-05-19 18:14   ` Dominique d'Humières
2017-05-22  7:36     ` Richard Biener
2017-05-22 16:55   ` Martin Sebor
2017-05-22 18:32     ` Jason Merrill
2017-05-22 20:43       ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).