Skip to content

Link-Time-Optimized build segfault during static initialization #5

Open
@jevolk

Description

@jevolk

An optimized build with -flto crashes during execution. This does not occur in any other optimized build without -flto.

relevant portion of stacktrace:

(#0 ... #10 template jumble in /deps/boost/include/boost/spirit/home/karma/*)

#11 ircd::json::printer::operator()<boost::spirit::karma::rule<char*, ircd::string_view, boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const&, ircd::string_view const&>(ircd::buffer::mutable_buffer&, boost::spirit::karma::rule<char*, ircd::string_view, boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type> const&, ircd::string_view const&) const [clone .isra.1773] [clone .lto_priv.3466] (out=..., g=..., a#0=...) at json.cc:356
#12 0x00007ffff7b25b56 in ircd::json::serialized (v=...) at json.cc:2706
#13 0x00007ffff7b2634a in ircd::json::value::value (this=this@entry=0x7fffffffdd50, other=...) at json.cc:2985
#14 0x00007ffff7ab9973 in __base_ctor  (__y=..., __x=..., this=0x7fffffffdd50) at /usr/include/c++/6/bits/stl_pair.h:311
#15 ircd::json::member::member<char const (&) [30]>(ircd::string_view const&, char const (&) [30]) [clone .lto_priv.2021] (this=0x7fffffffdd50, key=..., v=...) at json/member.h:69
#16 0x00007ffff7ab96ae in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ircd.cc:26
#17 _GLOBAL__sub_I_ircd.cc.lto_priv.1875 () at ircd.cc:405
#18 0x00007ffff7adb82e in global constructors keyed to 65535_0_info.o.568086 () from /home/jason/charybdis/lib/libircd.so.3
#19 0x00007ffff7de76ba in call_init (l=<optimized out>, argc=argc@entry=3, argv=argv@entry=0x7fffffffde58, env=env@entry=0x7fffffffde78) at dl-init.c:72
#20 0x00007ffff7de77cb in call_init (env=0x7fffffffde78, argv=0x7fffffffde58, argc=3, l=<optimized out>) at dl-init.c:30
#21 _dl_init (main_map=0x7ffff7ffe168, argc=3, argv=0x7fffffffde58, env=0x7fffffffde78) at dl-init.c:120
#22 0x00007ffff7dd7c6a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#23 0x0000000000000003 in ?? ()
#24 0x00007fffffffe221 in ?? ()
#25 0x00007fffffffe245 in ?? ()
#26 0x00007fffffffe24e in ?? ()
#27 0x0000000000000000 in ?? ()

Link-Time-Optimization is not enabled by default due to [at least] this issue. To enable it manually configure with --enable-lto.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't right.buildRelated to compiling, linking, packaging and distribution.cause unknownThe root of the problem is not identified or sufficiently understood to fix.performanceImpacts performance or related to optimization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions