Arm64平台std::function触发SIGILL_ILLOPC崩溃求助
Arm64平台下
SIGILL_ILLOPC崩溃排查求助 运行环境为Arm64平台,使用gcc 6.4版本编译,程序在部分客户机器上持续在Task::Task构造函数处触发SIGILL_ILLOPC崩溃,相同ELF文件在其他机器运行正常,且无法复现该问题,但持续收到客户反馈。原以为ILLOPC仅在交叉编译出错时出现,本次并非如此。
相关代码逻辑
template <typename T, typename F, typename ...Args> Timer::registerTimerTask(T interval, F func, bool once, Args... args) { auto t = std::chrono::duration_cast<std::chrono::nanoseconds>(interval); auto f = [=]() mutable {func(args...);}; auto task = std::make_shared<Task>(f, t, once); addTask(task); } Task::Task(std::function<void()>func, std::chrono::nanoseconds timeout, bool once=false): mFunc(func), mTimeout(timeout), mOnce(once) {}
崩溃栈信息
Operating system: Linux 0.0.0 Linux 4.9.191 #1 SMP PREEMPT Mon Oct 31 06:32:31 UTC 2022 aarch64 CPU: arm64 4 CPUs GPU: UNKNOWN Crash reason: SIGILL / ILL_ILLOPC Crash address: 0x7f8e50dc14 Process uptime: not available Thread 20 (crashed) 0 myso.so!std::_Function_base::_Base_manager<Timer::registerTimerTask(T&&, F, bool, Args&& ...) [with T = std::chrono::duration<long int, std::ratio<1l, 1000l> >&; F = Impl::socket(std::__cxx11::string, std::__cxx11::string, std::shared_ptr<Listener<std::__cxx11::basic_string<char> > >)::<lambda()>; Args = {}]::<lambda()> >::_M_manager [functional : 1591 + 0x4] x0 = 0x0000007f6c002840 x1 = 0x0000007f767f5db8 x2 = 0x0000000000000002 x3 = 0x0000007f8e50dc10 x4 = 0x0000007f6c0054c0 x5 = 0x0000007f6c002b10 x6 = 0x0000000000000000 x7 = 0x0000007f8cf633c0 x8 = 0x0000007f767f5f48 x9 = 0x003b9aca00000000 x10 = 0x0101010101010101 x11 = 0x0000000000000023 x12 = 0x00000000767f6188 x13 = 0x00000003e8000000 x14 = 0x0001ab437f192700 x15 = 0x00006e641756376a x16 = 0x0000007f8e56a618 x17 = 0x0000007f8e4eb91c x18 = 0x0000000000000000 x19 = 0x0000007f6c002830 x20 = 0x0000007f6c002830 x21 = 0x0000007f767f5db8 x22 = 0x0000000000000001 x23 = 0x0000007f767f6188 x24 = 0x0000007f767f6137 x25 = 0x0000000000000003 x26 = 0x0000000000800000 x27 = 0x0000000000000000 x28 = 0x0000007f8c2a36f0 fp = 0x0000007f767f5cf0 lr = 0x0000007f8e50eb0c sp = 0x0000007f767f5cf0 pc = 0x0000007f8e50dc14 Found by: given as instruction pointer in context 1 myso.so!Task::Task(std::function<void ()>, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, bool) [task.h : 124 + 0x24] x19 = 0x0000007f6c002830 x20 = 0x0000007f6c002830 x21 = 0x0000007f767f5db8 x22 = 0x0000000000000001 x23 = 0x0000007f767f6188 x24 = 0x0000007f767f6137 x25 = 0x0000000000000003 x26 = 0x0000000000800000 x27 = 0x0000000000000000 x28 = 0x0000007f8c2a36f0 fp = 0x0000007f767f5d20 sp = 0x0000007f767f5d40 pc = 0x0000007f8e50e140 Found by: call frame info
无法理解该崩溃的触发原因,也未找到类似案例,特此求助。
内容的提问来源于stack exchange,提问作者陈泽霖
相关产品推荐
相关产品推荐

