facebookexperimental / facebookexperimental/moxygen

Segment fault on Linux build

Open
#92 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
111
Forks
35
Avg merge
4m
Merged PRs (30d)
1

Description

While running on linux, upon sending the first subgroup object, a segfault results. I only see this issue on Linux. MacOS seems to run okay. The clients and moxygen builds are the same.

Moxygen commit: 76dcfc1f18df01fb01b826d691c645db85c61762

Stack trace:

```
Reading symbols from ./_build/bin/moqrelayserver...
[New LWP 459010]
[New LWP 459009]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Core was generated by `./_build/bin/moqrelayserver -port 33435 -cert ./certs/certificate.pem -key ./ce'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 folly::IOBuf::next (this=0x0) at /ws/_build/deps/include/folly/io/IOBuf.h:900
900 const IOBuf* next() const noexcept { return next_; }
[Current thread is 1 (Thread 0xffff87c37600 (LWP 459010))]
(gdb) bt
#0 folly::IOBuf::next (this=0x0) at /ws/_build/deps/include/folly/io/IOBuf.h:900
#1 folly::io::CursorBase::canAdvance (amount=1, this=0xffff87c366b0) at /ws/_build/deps/include/folly/io/Cursor.h:245
#2 quic::follyutils::decodeQuicInteger (cursor=..., atMost=atMost@entry=8) at /ws/_build/deps/mvfst/quic/folly_utils/Utils.cpp:16
#3 0x0000aaaae39b8538 in moxygen::MoQFrameParser::parseSubgroupTypeAndAlias (this=this@entry=0xffff80046568, cursor=..., length=0) at /ws/moxygen/MoQFramer.cpp:560
#4 0x0000aaaae3a1bde4 in moxygen::MoQObjectStreamCodec::parseSubgroupTypeAndAlias (this=0xffff800464c0, data=std::unique_ptr = {...}, eom=true)
at /ws/moxygen/MoQCodec.cpp:146
#5 0x0000aaaae39e9778 in moxygen::MoQSession::headerParsed(_ZN7moxygen10MoQSession12headerParsedERNS_20MoQObjectStreamCodecERNS_6detail20ObjectStreamCallbackERN8proxygen12WebTransport10StreamDataE.Frame *) (frame_ptr=0xffff80048320) at /ws/moxygen/MoQSession.cpp:2370
#6 0x0000aaaae3ddc700 in std::__n4861::coroutine_handle::resume (this=) at /usr/include/c++/12/coroutine:135
#7 folly::resumeCoroutineWithNewAsyncStackRoot (h=..., frame=...) at /ws/_build/deps/folly/folly/tracing/AsyncStack.cpp:201
#8 0x0000aaaae396e1e0 in folly::coro::detail::ViaCoroutinePromiseBase::executeContinuation (this=) at /ws/_build/deps/include/folly/coro/Coroutine.h:339
#9 folly::coro::detail::ViaCoroutinePromiseBase::scheduleContinuation()::{lambda()#1}::operator()() const (__closure=) at /ws/_build/deps/include/folly/coro/ViaIfAsync.h:85
#10 folly::detail::function::call_(, folly::detail::function::Data&) (p=...)
at /ws/_build/deps/include/folly/Function.h:341
#11 0x0000aaaae3d7ebcc in folly::detail::function::FunctionTraits::operator()() (this=0xffff800474f0) at /ws/_build/deps/folly/folly/Function.h:370
#12 folly::EventBase::FunctionLoopCallback::runLoopCallback (this=0xffff800474c0) at /ws/_build/deps/folly/folly/io/async/EventBase.h:188
#13 0x0000aaaae3d78850 in folly::EventBase::runLoopCallbackList (this=this@entry=0xaaaae579a250, currentCallbacks=..., deadline=...)
at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:1003
#14 0x0000aaaae3d78a1c in folly::EventBase::runLoopCallbacks (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:1024
#15 0x0000aaaae3d7a924 in folly::EventBase::loopMain (this=this@entry=0xaaaae579a250, flags=flags@entry=0, options=...) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:650
#16 0x0000aaaae3d7b184 in folly::EventBase::loopBody (this=this@entry=0xaaaae579a250, flags=flags@entry=0, options=options@entry=...)
at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:535
#17 0x0000aaaae3d7b228 in folly::EventBase::loop (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:496
#18 0x0000aaaae3d7ce98 in folly::EventBase::loopForever (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:803
#19 0x0000aaaae3d95ee0 in folly::run (ebm=0xaaaae57bdc70, eb=0xaaaae579a250, stop=0xaaaae579a4d8, name=...) at /ws/_build/deps/folly/folly/io/async/ScopedEventBaseThread.cpp:40
#20 0x0000ffff87fee9dc in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#21 0x0000ffff87d02030 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
#22 0x0000ffff87d6bf1c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
(gdb)
#0 folly::IOBuf::next (this=0x0) at /ws/_build/deps/include/folly/io/IOBuf.h:900
#1 folly::io::CursorBase::canAdvance (amount=1, this=0xffff87c366b0) at /ws/_build/deps/include/folly/io/Cursor.h:245
#2 quic::follyutils::decodeQuicInteger (cursor=..., atMost=atMost@entry=8) at /ws/_build/deps/mvfst/quic/folly_utils/Utils.cpp:16
#3 0x0000aaaae39b8538 in moxygen::MoQFrameParser::parseSubgroupTypeAndAlias (this=this@entry=0xffff80046568, cursor=..., length=0) at /ws/moxygen/MoQFramer.cpp:560
#4 0x0000aaaae3a1bde4 in moxygen::MoQObjectStreamCodec::parseSubgroupTypeAndAlias (this=0xffff800464c0, data=std::unique_ptr = {...}, eom=true)
at /ws/moxygen/MoQCodec.cpp:146
#5 0x0000aaaae39e9778 in moxygen::MoQSession::headerParsed(_ZN7moxygen10MoQSession12headerParsedERNS_20MoQObjectStreamCodecERNS_6detail20ObjectStreamCallbackERN8proxygen12WebTransport10StreamDataE.Frame *) (frame_ptr=0xffff80048320) at /ws/moxygen/MoQSession.cpp:2370
#6 0x0000aaaae3ddc700 in std::__n4861::coroutine_handle::resume (this=) at /usr/include/c++/12/coroutine:135
#7 folly::resumeCoroutineWithNewAsyncStackRoot (h=..., frame=...) at /ws/_build/deps/folly/folly/tracing/AsyncStack.cpp:201
#8 0x0000aaaae396e1e0 in folly::coro::detail::ViaCoroutinePromiseBase::executeContinuation (this=) at /ws/_build/deps/include/folly/coro/Coroutine.h:339
#9 folly::coro::detail::ViaCoroutinePromiseBase::scheduleContinuation()::{lambda()#1}::operator()() const (__closure=) at /ws/_build/deps/include/folly/coro/ViaIfAsync.h:85
#10 folly::detail::function::call_(, folly::detail::function::Data&) (p=...)
at /ws/_build/deps/include/folly/Function.h:341
#11 0x0000aaaae3d7ebcc in folly::detail::function::FunctionTraits::operator()() (this=0xffff800474f0) at /ws/_build/deps/folly/folly/Function.h:370
#12 folly::EventBase::FunctionLoopCallback::runLoopCallback (this=0xffff800474c0) at /ws/_build/deps/folly/folly/io/async/EventBase.h:188
#13 0x0000aaaae3d78850 in folly::EventBase::runLoopCallbackList (this=this@entry=0xaaaae579a250, currentCallbacks=..., deadline=...)
at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:1003
#14 0x0000aaaae3d78a1c in folly::EventBase::runLoopCallbacks (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:1024
#15 0x0000aaaae3d7a924 in folly::EventBase::loopMain (this=this@entry=0xaaaae579a250, flags=flags@entry=0, options=...) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:650
#16 0x0000aaaae3d7b184 in folly::EventBase::loopBody (this=this@entry=0xaaaae579a250, flags=flags@entry=0, options=options@entry=...)
at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:535
#17 0x0000aaaae3d7b228 in folly::EventBase::loop (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:496
#18 0x0000aaaae3d7ce98 in folly::EventBase::loopForever (this=this@entry=0xaaaae579a250) at /ws/_build/deps/folly/folly/io/async/EventBase.cpp:803
#19 0x0000aaaae3d95ee0 in folly::run (ebm=0xaaaae57bdc70, eb=0xaaaae579a250, stop=0xaaaae579a4d8, name=...) at /ws/_build/deps/folly/folly/io/async/ScopedEventBaseThread.cpp:40
#20 0x0000ffff87fee9dc in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#21 0x0000ffff87d02030 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
#22 0x0000ffff87d6bf1c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
```

Log before the segfault

```
V0114 21:58:46.663348 459010 MoQRelay.cpp:110] publish ns=perf/video/0
V0114 21:58:46.663362 459010 MoQSession.cpp:3887] publishOk reqID=0 sess=0xffff80041b60
V0114 21:58:46.663409 459010 MoQCodec.cpp:362] parsing frame type=29
V0114 21:58:46.663415 459010 MoQSession.cpp:2865] onPublish reqID=2 sess=0xffff80041b60
V0114 21:58:46.663421 459010 MoQRelay.cpp:110] publish ns=perf/audio/0
V0114 21:58:46.663428 459010 MoQSession.cpp:3887] publishOk reqID=2 sess=0xffff80041b60
V0114 21:58:51.697148 459010 MoQSession.cpp:4585] onNewUniStream sess=0xffff80041b60
V0114 21:58:51.697166 459010 MoQSession.cpp:2419] unidirectionalReadLoop id=2 sess=0xffff80041b60
V0114 21:58:51.697190 459010 MoQSession.cpp:4585] onNewUniStream sess=0xffff80041b60
V0114 21:58:51.697197 459010 MoQSession.cpp:2419] unidirectionalReadLoop id=6 sess=0xffff80041b60
*** Aborted at 1768427931 (Unix time, try 'date -d @1768427931') ***
*** Signal 11 (SIGSEGV) (0x20) received by PID 459009 (pthread TID 0xffff87c37600) (linux TID 459010) (code: address not mapped to object), stack trace: ***
./_build/bin/moqrelayserver(+0x576e83)[0xaaaae3e16e83]
./_build/bin/moqrelayserver(+0x5543b7)[0xaaaae3df43b7]
./_build/bin/moqrelayserver(+0x551e57)[0xaaaae3df1e57]
linux-vdso.so.1(+0x7bb)[0xffff88a247bb]
./_build/bin/moqrelayserver(+0x3d8f24)[0xaaaae3c78f24]
./_build/bin/moqrelayserver(+0x118537)[0xaaaae39b8537]
./_build/bin/moqrelayserver(+0x17bde3)[0xaaaae3a1bde3]
./_build/bin/moqrelayserver(+0x149777)[0xaaaae39e9777]
./_build/bin/moqrelayserver(+0x53c6ff)[0xaaaae3ddc6ff]
./_build/bin/moqrelayserver(+0xce1df)[0xaaaae396e1df]
./_build/bin/moqrelayserver(+0x4debcb)[0xaaaae3d7ebcb]
./_build/bin/moqrelayserver(+0x4d884f)[0xaaaae3d7884f]
./_build/bin/moqrelayserver(+0x4d8a1b)[0xaaaae3d78a1b]
./_build/bin/moqrelayserver(+0x4da923)[0xaaaae3d7a923]
./_build/bin/moqrelayserver(+0x4db183)[0xaaaae3d7b183]
./_build/bin/moqrelayserver(+0x4db227)[0xaaaae3d7b227]
./_build/bin/moqrelayserver(+0x4dce97)[0xaaaae3d7ce97]
./_build/bin/moqrelayserver(+0x4f5edf)[0xaaaae3d95edf]
/lib/aarch64-linux-gnu/libstdc++.so.6(+0xce9db)[0xffff87fee9db]
/lib/aarch64-linux-gnu/libc.so.6(+0x8202f)[0xffff87d0202f]
/lib/aarch64-linux-gnu/libc.so.6(+0xebf1b)[0xffff87d6bf1b]
./_build/bin/moqrelayserver(+0x554434)[0xaaaae3df4434]
./_build/bin/moqrelayserver(+0x554434)[0xaaaae3df4434]
./_build/bin/moqrelayserver(+0x551e58)[0xaaaae3df1e58]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffff88a247bc]
./_build/bin/moqrelayserver(+0x118538)[0xaaaae39b8538]
./_build/bin/moqrelayserver(+0x118538)[0xaaaae39b8538]
./_build/bin/moqrelayserver(+0x17bde4)[0xaaaae3a1bde4]
./_build/bin/moqrelayserver(+0x149778)[0xaaaae39e9778]
./_build/bin/moqrelayserver(+0x14b0cc)[0xaaaae39eb0cc]
./_build/bin/moqrelayserver(+0x53c700)[0xaaaae3ddc700]
./_build/bin/moqrelayserver(+0x14b9b4)[0xaaaae39eb9b4]
./_build/bin/moqrelayserver(+0xbbb5c)[0xaaaae395bb5c]
(safe mode, symbolizer not available)

*** Check failure async stack trace: ***
*** First async stack root: 0xffff87c369b0, normal stack frame pointer holding async stack root: 0xffff87c36980, return address: 0xaaaae396e1e0 ***
*** First async stack frame pointer: 0xffff80048348, return address: 0xaaaae39eb0cc, async stack trace: ***
(safe mode, symbolizer not available)
Segmentation fault (core dumped)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.