Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Perfetto SDK fails with SIGABORT when statically linked + build time warning #549

@qais-yousef

Description

@qais-yousef

When I link my application statically, the SDK SIGABORTs with the following call stack

Thread 1 "sched-analyzer" received signal SIGABRT, Aborted.
0x000000000065e9c8 in raise ()
(gdb) bt
#0  0x000000000065e9c8 in raise ()
#1  0x0000000000400e1c in abort ()
#2  0x00000000005afbe4 in __gnu_cxx::__verbose_terminate_handler() ()
#3  0x00000000005ae7e4 in __cxxabiv1::__terminate(void (*)()) ()
#4  0x00000000005ae838 in std::terminate() ()
#5  0x00000000005b9dc0 in std::condition_variable::wait(std::unique_lock<std::mutex>&) ()
#6  0x0000000000448e74 in std::condition_variable::wait<perfetto::base::ThreadTaskRunner::ThreadTaskRunner(const string&)::<lambda()> > (__p=..., __lock=..., this=0xffffffffea80)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:7442
#7  perfetto::base::ThreadTaskRunner::ThreadTaskRunner (this=0x7ff970, name=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:7442
#8  0x0000000000448fc8 in perfetto::base::ThreadTaskRunner::CreateAndStart (name=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:7231
#9  perfetto::(anonymous namespace)::PlatformPosix::CreateTaskRunner (this=<optimised out>, args=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:7230
#10 0x00000000005157a0 in perfetto::internal::TracingMuxerImpl::TracingMuxerImpl (this=0x7ff870, args=...)
    at /usr/include/c++/9/bits/move.h:99
#11 0x0000000000515d40 in perfetto::internal::TracingMuxerImpl::InitializeInstance (args=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:49423
#12 0x0000000000515e94 in perfetto::Tracing::InitializeInternal (args=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.cc:50982
#13 0x000000000042c554 in perfetto::Tracing::Initialize (args=...)
    at ~/src/sched-analyzer/perfetto/sdk/perfetto.h:8221
#14 init_perfetto () at perfetto_wrapper.cc:39
#15 0x0000000000400fb8 in main (argc=<optimised out>, argv=<optimised out>) at sched-analyzer.c:250

Without static linking everything works fine.

Also I get this warning when statically linking

/usr/bin/ld: libperfetto.a(perfetto.o): in function `perfetto::base::(anonymous namespace)::MakeSockAddr(perfetto::base::SockFamily, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
~/src/sched-analyzer/perfetto/sdk/perfetto.cc:73789: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

My little app if you want to try reproduce is here: https://github.com/qais-yousef/sched-analyzer

make static to build statically. I am on v36.1 of the SDK.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions