Skip to content

[BUG] setting/getting SRTO_STREAMID to group socket is broken in SRT 1.5.4 #3072

@maxtomilov

Description

@maxtomilov

When SRTO_STREAMID is set to group socket SRT lib fails on "SRT_ASSERT(opt_size == default_opt_size);" assertion on group.cpp:456 due to incorrect option size interpretation in importOption function (default_opt_size == sizeof(std::string) == 32 and opt_size returned from getOptDefault call on group.cpp:454 is std::string().size() == 0) so process crashes with the following error:

srt/srtcore/group.cpp:456: void srt::importOption(std::vectorsrt::CUDTGroup::ConfigItem&, SRT_SOCKOPT, const ValueType&) [with ValueType = std::__cxx11::basic_string; SRT_SOCKOPT = SRT_SOCKOPT]: Assertion `opt_size == default_opt_size' failed.

To Reproduce
Steps to reproduce the behavior:

  1. build SRT with --enable-debug=1
  2. create a group socket and set SRTO_STREAMID:

auto sock = srt_create_group(SRT_GTYPE_BROADCAST);
std::string stream_id = "live/stream";
srt_setsockopt(sock, 0, SRTO_STREAMID, stream_id.c_str(), stream_id.length());

  1. See error

assertion failure later trying using this socket later (srt_connect_group and srt_sendmsg)

tested on Ubuntu 22.04 / SRT 1.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: CriticalType: BugIndicates an unexpected problem or unintended behavior[core]Area: Changes in SRT library core

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions