Otto Moerbeek <otto@drijf.net> wrote:
> I can only guess about powerdns_recursor here, ads I do not have a
> modern Intel machine: it's the context switch assembly in boot-md. I
> have no clue yet how to fix this, I did not follow the IBT
> developments closely. Sadly I'll also be leaving for a holiday for a
> week this weekend. So I'd be really grateful if somebody else could
> take a look at powerdns_recursor and boost-md.
>
> -Otto
Backtrace:
Program terminated with signal SIGILL, Illegal instruction.
#0 pdns_makecontext(pdns_ucontext_t&, std::__1::function<void ()>&) (ctx=..., start=...) at ./mtasker_fcontext.cc:239
239 ctx.uc_mcontext = res.fctx;
[Current thread is 1 (process 298693)]
(gdb) bt
#0 pdns_makecontext(pdns_ucontext_t&, std::__1::function<void ()>&) (ctx=..., start=...) at ./mtasker_fcontext.cc:239
#1 0x00000f1f7fa79595 in MTasker<std::__1::shared_ptr<PacketID>, std::__1::vector<unsigned char, noinit_adaptor<std::__1::allocator<unsigned char> > >, PacketIDCompare>::makeThread (this=0xf22481f1000, start=<optimized out>, val=<optimized out>) at ./mtasker.cc:303
#2 0x00000f1f7fafef34 in recLoop () at rec-main.cc:2592
#3 0x00000f1f7fad2a3c in recursorThread () at rec-main.cc:2787
#4 0x00000f1f7fb0af0b in RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0::operator()() const (this=<optimized out>)
at rec-main.cc:211
#5 std::__1::__invoke<RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0>(RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0&&) (__f=...) at /usr/include/c++/v1/type_traits:3918
#6 std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0>&, std::__1::__tuple_indices<>) (__t=...) at /usr/include/c++/v1/thread:280
#7 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, RecThreadInfo::start(unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<unsigned int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, std::__1::shared_ptr<Logr::Logger> const&)::$_0> >(void*) (__vp=0xf222cae4060) at /usr/include/c++/v1/thread:291
#8 0x00000f2196619025 in _rthread_start (v=<optimized out>) at /usr/src/lib/librthread/rthread.c:96
#9 0x00000f21f72db17a in __tfork_thread () at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:86
I ran into a similar backtrace with Taisei [0]. Most seemingly it needs
to USE_NOBTCFI=Yes as our Boost sits at 1.80.0, while CET was introduced
in boost::context at 1.81.0 and updating Boost is not an option at this
point.
I successfully tested it with USE_NOBTCFI.
[0]: https://github.com/taisei-project/koishi/issues/6#issue-1888944976
diff /usr/ports
commit - ee7b757b31af9f695e90108988182d450e1758e9
path + /usr/ports
blob - 3128ced143951b4ee2ac8ffdd1a0e8372d26bc28
file + net/powerdns_recursor/Makefile
--- net/powerdns_recursor/Makefile
+++ net/powerdns_recursor/Makefile
@@ -12,6 +12,9 @@ HOMEPAGE= https://www.powerdns.com/
# GPLv2 only, OpenSSL exemption
PERMIT_PACKAGE= Yes
+# SIGILL on startup because of boost::context.
+USE_NOBTCFI= Yes
+
WANTLIB+= ${COMPILER_LIBCXX} boost_context-mt boost_filesystem-mt
WANTLIB+= boost_system-mt boost_thread-mt c crypto curl fstrm m
WANTLIB+= sodium ssl z
No comments:
Post a Comment