Skip to content

Fix null-pointer crash when a STREAMING object isn't a manifest - #67

Closed
jordijoangimenez wants to merge 1 commit into
5G-MAG:developmentfrom
jordijoangimenez:pr/fix-streaming-manifest-null-crash
Closed

jordijoangimenez wants to merge 1 commit into
5G-MAG:developmentfrom
jordijoangimenez:pr/fix-streaming-manifest-null-crash

Conversation

@jordijoangimenez

Copy link
Copy Markdown
Contributor

Summary

ManifestHandlerFactory::makeManifestHandler() correctly returns nullptr for non-manifest media types (e.g. audio/mp4, video/mp4 media segments), but ObjectStreamingController (used for STREAMING operating mode) stored that result without checking it, crashing on the first subsequent manifestHandler()->... call.

Adds the same null-check ObjectCarouselController (used for CAROUSEL mode) already has for this exact case: log and forward the object to the packager instead of trying to track it as a manifest.

Test plan

  • Rebuilt and confirmed the fix compiles cleanly
  • Reproduced the crash before the fix (STREAMING/PULL ingest session with real DASH audio/video segments) and confirmed it no longer occurs afterward, in a full end-to-end run against a live rt-mbs-function + rt-mbs-client

ManifestHandlerFactory::makeManifestHandler() correctly returns
nullptr for non-manifest media types (e.g. audio/mp4, video/mp4 media
segments), but ObjectStreamingController stored that result without
checking it, crashing on the first subsequent manifestHandler()->...
call. Add the same null-check ObjectCarouselController already has
for this exact case: log and forward the object to the packager
instead of trying to track it as a manifest.
@dsilhavy dsilhavy added this to the Version 1.4.1 milestone Jul 29, 2026
@dsilhavy dsilhavy added the bug Something isn't working label Jul 29, 2026

@dsilhavy dsilhavy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jordijoangimenez , one finding by Fable that I consider worth checking:

2. Object-store retention leak: By the time this branch runs, check_if_object_added_is_manifest() has already called metadata.keepAfterSend(true) on the object. Since ObjectController::processEvent() only deletes objects after send when keepAfterSend() is false, every non-manifest object taking this path is kept in the ObjectStore forever — unbounded growth in a long-running STREAMING session (exactly the scenario in your test plan). Suggest resetting keepAfterSend(false) in the new branch.

@davidjwbbc davidjwbbc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this goes some of the way to handling a bad manifest, the other parts of the code should be changed to handle the manifest handler being a nullptr, instead of assuming that it will always be set.

The ObjectCarouselController throws a std::runtime_error if the manifest handler cannot be made, rather than just reporting the error. We'd have to check if throwing the exception here is a better solution (may avoid other calls to the manifest handler and deal with the error more gracefully).

@dsilhavy has a point about an unknown manifest hanging around, there should probably be a object->second.keepAfterSend(false); in there somewhere (and maybe in ObjectCarouselController.cc too).

@dsilhavy

dsilhavy commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

We need a PR that addresses both issues including #66.

@dsilhavy dsilhavy closed this Aug 7, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Done in 5MBS: User Services initial release Aug 7, 2026
@rjb1000

rjb1000 commented Aug 7, 2026

Copy link
Copy Markdown

Replaced by issue #70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

4 participants