Skip to content

moqrelayserver crash observed while relaying multiple streams #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gmarzot opened this issue Mar 30, 2025 · 2 comments
Open

moqrelayserver crash observed while relaying multiple streams #48

gmarzot opened this issue Mar 30, 2025 · 2 comments

Comments

@gmarzot
Copy link
Contributor

gmarzot commented Mar 30, 2025

I am doing a lot of unfriendly things to the relay as i test w/ python here... abrupt termination of streams perhaps in the mix or overflowed/dropped messages.

gmarzot@typhoon:~/Projects/moq/upstream/moxygen$ git log
commit 1bb188edb01ddd02dd41658c46ea1ff168af7ef3 (HEAD -> main, origin/main, origin/HEAD)
Author: Open Source Bot <generatedunixname499836121@fb.com>
Date:   Sat Mar 15 09:33:05 2025 -0700
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./_build/bin/moqrelayserver...
[New LWP 811128]
[New LWP 811125]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./_build/bin/moqrelayserver -port 4433 -cert ./certs/fullchain.pem -key ./certs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  (anonymous namespace)::StreamPublisherImpl::writeToStream (this=0x7f51c00bf490, finStream=false)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/MoQSession.cpp:356
356       auto writeRes =
[Current thread is 1 (Thread 0x7f51c5894640 (LWP 811128))]
(gdb) bt
#0  (anonymous namespace)::StreamPublisherImpl::writeToStream (this=0x7f51c00bf490, finStream=false)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/MoQSession.cpp:356
#1  0x000055b468e6a8a5 in (anonymous namespace)::StreamPublisherImpl::objectPayload (
    this=0x7f51c00bf490, payload=..., finStream=false)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/MoQSession.cpp:461
#2  0x000055b468e1ca95 in moxygen::MoQForwarder::SubgroupForwarder::objectPayload(std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, bool)::{lambda(std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&, std::shared_ptr<moxygen::SubgroupConsumer> const&)#1}::operator()(std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&, std::shared_ptr<moxygen::SubgroupConsumer> const&) const (
    __closure=0x7f51c013f5e0,
    sub=std::shared_ptr<moxygen::MoQForwarder::Subscriber> (use count 2, weak count 0) = {...},
    subgroupConsumer=...)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/relay/MoQForwarder.h:552
#3  0x000055b468e0e91f in std::function<void (std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&)>::operator()(std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&) const (__args#0=...,
    this=0x7f51c588b4d0) at /usr/include/c++/13/bits/std_function.h:591
#4  moxygen::MoQForwarder::forEachSubscriber(std::function<void (std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&)>) (fn=..., this=<optimized out>)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/relay/MoQForwarder.h:221
#5  moxygen::MoQForwarder::SubgroupForwarder::forEachSubscriberSubgroup(std::function<void (std::shared_ptr<moxygen::MoQForwarder::Subscriber> const&, std::shared_ptr<moxygen::SubgroupConsumer> const&)>) (
    fn=..., this=0x7f51c00b8c80)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/relay/MoQForwarder.h:354
#6  moxygen::MoQForwarder::SubgroupForwarder::objectPayload (this=0x7f51c00b8c80, payload=...,
    finSubgroup=<optimized out>)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/relay/MoQForwarder.h:549
#7  0x000055b468e76dbd in moxygen::(anonymous namespace)::ObjectStreamCallback::invokeCallbackNoGroup<folly::Expected<moxygen::ObjectPublishStatus, moxygen::MoQPublishError> (moxygen::SubgroupConsumer::*)(std::unique_ptr<folly::IOBuf>, bool), folly::Expected<moxygen::ObjectPublishStatus, moxygen::MoQPublishError> (moxygen::FetchConsumer::*)(std::unique_ptr<folly::IOBuf>, bool), std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, bool> (
    fmethod=&virtual moxygen::FetchConsumer::objectPayload(std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, bool),
    smethod=&virtual moxygen::SubgroupConsumer::objectPayload(std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, bool), this=0x7f51c00b3de0) at /usr/include/c++/13/bits/unique_ptr.h:197
#8  moxygen::(anonymous namespace)::ObjectStreamCallback::onObjectPayload (this=0x7f51c00b3de0,
    payload=..., objectComplete=<optimized out>)
    at /home/gmarzot/Projects/moq/upstream/moxygen/moxygen/MoQSession.cpp:1588
#9  0x000055b468e51e02 in moxygen::MoQObjectStreamCodec::onIngress (this=<optimized out>, data=...,
    endOfStream=<optimized out>) at /usr/include/c++/13/bits/unique_ptr.h:197
#10 0x000055b468e75db5 in moxygen::MoQSession::unidirectionalReadLoop(_ZN7moxygen10MoQSession22unidirectionalReadLoopESt10shared_ptrIS0_EPN8proxygen12WebTransport16StreamReadHandleE.Frame *) (
    frame_ptr=0x7f51c00b3c30) at /usr/include/c++/13/bits/unique_ptr.h:197
#11 0x000055b468debe92 in std::__n4861::coroutine_handle<void>::resume (this=<synthetic pointer>)
    at /usr/include/c++/11/coroutine:126
#12 folly::resumeCoroutineWithNewAsyncStackRoot (h=..., frame=...)
    at /home/gmarzot/Projects/moq/upstream/moxygen/_build/deps/folly/folly/tracing/AsyncStack.cpp:201
#13 0x000055b468e0718c in folly::coro::detail::ViaCoroutinePromiseBase::executeContinuation (
    this=0x7f51c00c20a0)
    at /home/gmarzot/Projects/moq/upstream/moxygen/_build/deps/include/folly/coro/Coroutine.h:339
#14 folly::coro::detail::ViaCoroutinePromiseBase::scheduleContinuation()::{lambda()#1}::operator()() const (__closure=<optimized out>)
    at /home/gmarzot/Projects/moq/upstream/moxygen/_build/deps/include/folly/coro/ViaIfAsync.h:86
#15 folly::detail::function::call_<folly::coro::detail::ViaCoroutinePromiseBase::scheduleContinuation():```
@afrind
Copy link
Contributor

afrind commented Apr 14, 2025

Is it possible this is #39 ? If so, it should be fixed in main.

@gmarzot
Copy link
Contributor Author

gmarzot commented Apr 14, 2025

It's possible. I have not moved forward in a while. But when I do, will watch for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants