Skip to content
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

Mythbackend crash v35-pre #955

Open
angelaschmid opened this issue Oct 20, 2024 · 4 comments
Open

Mythbackend crash v35-pre #955

angelaschmid opened this issue Oct 20, 2024 · 4 comments

Comments

@angelaschmid
Copy link
Contributor

angelaschmid commented Oct 20, 2024

  • Platform: Ubuntu 22.04.5 LTS (GNU/Linux 6.6.4 x86_64)

  • MythTV version: v35-pre, latest master 8258345

  • Package version: self compiled

  • Component: Mythbackend

What steps will reproduce the bug?

I had three crashes, one after some 10 minutes , 80 minutes and after 3 minutes. Thereafter it crashes immediately.
Recording has been working. But it seems at some point it crashes when starting a recording, and now after restart it wants to start a recording immediately and crashes.

EDIT: see next comment for logs and stack trace

@angelaschmid
Copy link
Contributor Author

It is like I said, DVB recording works, IPTV/UDP fails.
See attached logs and stack trace.
mythbackend_crash_20241020_001.zip

@kmdewaal
Copy link
Contributor

kmdewaal commented Nov 25, 2024

Do you happen to know the last MythTV version where it was still working OK?
OK this was August, you did mention this in #936 .
Question: exactly what did you use as signal source for this?
Looks to me like all IPTV channels I did test use http(s) or am I missing something?
It would be great if I can reproduce this.
If that is difficult, can you please provide a traceback from a build with debug?

@angelaschmid
Copy link
Contributor Author

I bisected the issue:

816a46d13ac7267a9fbacdc2131ccb4cf68f88a1 is the first bad commit
commit 816a46d13ac7267a9fbacdc2131ccb4cf68f88a1
Author: David Hampton <[email protected]>
Date:   Sun Jul 28 09:44:01 2024 -0400

    tidy: Use const reference for local variables when possible. (libs)

    Finds local variable declarations that are initialized using the copy
    constructor of a non-trivially-copyable type but it would suffice to
    obtain a const reference.

    All changes made by clang-tidy.

    https://clang.llvm.org/extra/clang-tidy/checks/performance/unnecessary-copy-initialization.html

 mythtv/libs/libmyth/standardsettings.cpp                                   | 2 +-
 mythtv/libs/libmyth/storagegroupeditor.cpp                                 | 4 ++--
 mythtv/libs/libmythbase/housekeeper.cpp                                    | 4 ++--
 mythtv/libs/libmythbase/http/mythwebsocketevent.cpp                        | 2 +-
 mythtv/libs/libmythbase/mythmiscutil.cpp                                   | 2 +-
 mythtv/libs/libmythbase/test/test_mythbinaryplist/test_mythbinaryplist.cpp | 2 +-
 mythtv/libs/libmythprotoserver/requesthandler/basehandler.cpp              | 4 ++--
 mythtv/libs/libmythprotoserver/requesthandler/fileserverhandler.cpp        | 2 +-
 mythtv/libs/libmythprotoserver/requesthandler/messagehandler.cpp           | 4 ++--
 mythtv/libs/libmythtv/HLS/httplivestreambuffer.cpp                         | 2 +-
 mythtv/libs/libmythtv/HLS/m3u.cpp                                          | 2 +-
 mythtv/libs/libmythtv/jobqueue.cpp                                         | 2 +-
 mythtv/libs/libmythtv/overlays/mythchanneloverlay.cpp                      | 2 +-
 mythtv/libs/libmythtv/overlays/mythnavigationoverlay.cpp                   | 2 +-
 mythtv/libs/libmythtv/recorders/rtp/packetbuffer.cpp                       | 2 +-
 mythtv/libs/libmythtv/transporteditor.cpp                                  | 2 +-
 mythtv/libs/libmythtv/tv_play.cpp                                          | 2 +-
 mythtv/libs/libmythtv/videosource.cpp                                      | 4 ++--
 mythtv/libs/libmythui/mythdialogbox.cpp                                    | 4 ++--
 mythtv/libs/libmythui/mythnotificationcenter.cpp                           | 2 +-
 mythtv/libs/libmythui/mythprogressdialog.cpp                               | 4 ++--
 mythtv/libs/libmythui/mythscreentype.cpp                                   | 2 +-
 mythtv/libs/libmythui/myththemedmenu.cpp                                   | 2 +-
 mythtv/libs/libmythui/mythuibutton.cpp                                     | 2 +-
 mythtv/libs/libmythui/mythuibuttonlist.cpp                                 | 4 ++--
 mythtv/libs/libmythui/mythuibuttontree.cpp                                 | 2 +-
 mythtv/libs/libmythui/mythuicheckbox.cpp                                   | 2 +-
 mythtv/libs/libmythui/mythuitextedit.cpp                                   | 2 +-
 mythtv/libs/libmythui/mythuiwebbrowser.cpp                                 | 6 +++---
 mythtv/libs/libmythui/mythvirtualkeyboard.cpp                              | 2 +-
 mythtv/libs/libmythui/platforms/mythscreensaverdbus.cpp                    | 2 +-
 mythtv/libs/libmythupnp/upnpcds.cpp                                        | 4 ++--
 mythtv/libs/libmythupnp/websocket.cpp                                      | 2 +-
 mythtv/libs/libmythupnp/xsd.cpp                                            | 2 +-
 34 files changed, 45 insertions(+), 45 deletions(-)

On current master 3f6def5 the following fixed the issue:

commit d650852c5f0f68cdf3f1efb1815b0f103db673b9 (HEAD -> master)
Author: angelaschmid <[email protected]>
Date:   Tue Nov 26 00:36:48 2024 +0100

    FIX: udp crash

diff --git a/mythtv/libs/libmythtv/recorders/rtp/packetbuffer.cpp b/mythtv/libs/libmythtv/recorders/rtp/packetbuffer.cpp
index 0346157e09..247e8c4af3 100644
--- a/mythtv/libs/libmythtv/recorders/rtp/packetbuffer.cpp
+++ b/mythtv/libs/libmythtv/recorders/rtp/packetbuffer.cpp
@@ -40,7 +40,7 @@ UDPPacket PacketBuffer::GetEmptyPacket(void)
         return UDPPacket(m_next_empty_packet_key++);
     }

-    const UDPPacket& packet(*it);
+    UDPPacket packet(*it);
     m_empty_packets.erase(it);

     return packet;

Maybe there exist other issues with the bad commit.

@kmdewaal
Copy link
Contributor

Yet another one of the clang-tidy introduced bugs... many thanks for bisecting and fixing.
Will be committed soon.

kmdewaal pushed a commit that referenced this issue Nov 26, 2024
The change of an UDP packet copy to a const reference in
rtp/packetbuffer.cpp by clang-tidy does cause a crash of the backend.
This change is from commit 816a46d
as found with a bisect.
Reverting the change in rtp/packetbuffer.cpp.

Refs #955
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