https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89260

--- Comment #2 from ohaiziejohwahkeezuoz at xff dot cz ---
The main problem is elsewhere (read_cgraph_and_symbols looks just like some
cascading assertion failure because of some other segfault). I recompiled gcc
with -Og -ggdb and managed to produce this backtrace:

Thread 6.1 "lto1-wpa" received signal SIGSEGV, Segmentation fault.
[Switching to process 20627]
0x000000000090c7ac in is_a_helper<cgraph_node*>::test<symtab_node>
(p=0x622e7365646f6e5f) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/cgraph.h:1953
1953      return p && p->type == SYMTAB_FUNCTION;
(gdb) bt
#0  0x000000000090c7ac in is_a_helper<cgraph_node*>::test<symtab_node>
(p=0x622e7365646f6e5f) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/cgraph.h:1953
#1  is_a<cgraph_node*, symtab_node> (p=0x622e7365646f6e5f) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/is-a.h:187
#2  dyn_cast<cgraph_node*, symtab_node> (p=0x622e7365646f6e5f) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/is-a.h:224
#3  input_node (file_data=file_data@entry=0x7ffff70ac000,
ib=ib@entry=0x19ca940, tag=LTO_symtab_unavail_node, nodes=nodes@entry=...)
    at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/lto-cgraph.c:1253
#4  0x0000000000910480 in input_cgraph_1
(file_data=file_data@entry=0x7ffff70ac000, ib=ib@entry=0x19ca940) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/lto-cgraph.c:1556
#5  0x0000000000910a25 in input_symtab () at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/lto-cgraph.c:1864
#6  0x00000000005f6962 in read_cgraph_and_symbols (nfiles=344,
fnames=0x1991aa0) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/lto/lto.c:2897
#7  0x00000000005f6db8 in lto_main () at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/lto/lto.c:3362
#8  0x0000000000a59b7a in compile_file () at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/toplev.c:455
#9  0x0000000000a5bba7 in do_compile () at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/toplev.c:2132
#10 0x0000000000a5c120 in toplev::main (this=this@entry=0x7fffffffd1e6,
argc=<optimized out>, argc@entry=29, argv=<optimized out>,
argv@entry=0x7fffffffd2e8)
    at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/toplev.c:2267
#11 0x00000000011c4c30 in main (argc=29, argv=0x7fffffffd2e8) at
/workspace/megous.com/apps-c/static-deps/toolchains/sources/gcc-8/gcc/main.c:39

(gdb) l
1948    template <>
1949    template <>
1950    inline bool
1951    is_a_helper <cgraph_node *>::test (symtab_node *p)
1952    {
1953      return p && p->type == SYMTAB_FUNCTION;
1954    }
1955    
1956    /* Report whether or not THIS symtab node is a vriable, aka
varpool_node.  */
1957    
(gdb) p p
$1 = (symtab_node *) 0x622e7365646f6e5f
(gdb) p *p
Cannot access memory at address 0x622e7365646f6e5f


Looks like some memory corruption bug.

Reply via email to