# Crash with "abort signal" when loading device

**URL:** <https://mediasoup.discourse.group/t/crash-with-abort-signal-when-loading-device/5464>\
**Category:** mediasoup libraries\
**Created:** [August 31, 2023, 12:06pm UTC](https://mediasoup.discourse.group/t/crash-with-abort-signal-when-loading-device/5464 "2023-08-31T12:06:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lehuan5062](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/lehuan5062/32/2326_2.png) [@lehuan5062](https://mediasoup.discourse.group/u/lehuan5062)\
**Post date:** [August 31, 2023, 12:06pm UTC](https://mediasoup.discourse.group/t/crash-with-abort-signal-when-loading-device/5464/1 "2023-08-31T12:06:51Z")

</div>

I’m building a plugin to integrate `libmediasoupclient` into `Unreal Engine`.

When I load mediasoup device, it crashes with this report:

```auto
Abort signal received

ucrtbase
ucrtbase
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::webrtc_checks_impl::UnreachableCodeReached()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::webrtc_checks_impl::FatalLog()
UnrealEditor_ShibuChat_Win64_DebugGame!cricket::WebRtcVoiceEngine::Init()
UnrealEditor_ShibuChat_Win64_DebugGame!cricket::CompositeMediaEngine::Init()
UnrealEditor_ShibuChat_Win64_DebugGame!cricket::ChannelManager::Create()
UnrealEditor_ShibuChat_Win64_DebugGame!std::vector<std::unique_ptr<cricket::VoiceChannel,std::default_delete<cricket::VoiceChannel> >,std::allocator<std::unique_ptr<cricket::VoiceChannel,std::default_delete<cricket::VoiceChannel> > > >::erase()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::Thread::Restart()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::Thread::QueuedTaskHandler::OnMessage()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::Thread::Dispatch()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::Thread::ProcessMessages()
UnrealEditor_ShibuChat_Win64_DebugGame!rtc::Thread::PreRun()
kernel32
ntdll

```

From the report, I think it fails at `cricket::WebRtcVoiceEngine::Init()`. I think this might be similar to this issue: [After removing the sound card and adding it again, Device::Load crashes](https://mediasoup.discourse.group/t/after-removing-the-sound-card-and-adding-it-again-device-load-crashes/5417).

This is the function I use to load device:

```auto
static decltype(auto) CreateAndLoadDevice(const FString& InRtpCapabilityJsonString) noexcept
{
	mediasoupclient::Device device;
	device.Load(nlohmann::json::parse(StringCast<ANSICHAR>(*InRtpCapabilityJsonString).Get()));
	return device;
}

```

I use the RTP capabilities below for the input. I get them with `socket.io`, similar to this thread: [Problem with mediasoup-client load](https://mediasoup.discourse.group/t/problem-with-mediasoup-client-load/1484).

```auto
{
    "codecs":
    [
        {
            "channels": 2,
            "clockRate": 48000,
            "kind": "audio",
            "mimeType": "audio/opus",
            "parameters": {},
            "preferredPayloadType": 100,
            "rtcpFeedback":
            [
                {
                    "parameter": "",
                    "type": "transport-cc"
                }
            ]
        },
        {
            "clockRate": 90000,
            "kind": "video",
            "mimeType": "video/VP8",
            "parameters":
            {
                "x-google-start-bitrate": 1000
            },
            "preferredPayloadType": 101,
            "rtcpFeedback":
            [
                {
                    "parameter": "",
                    "type": "nack"
                },
                {
                    "parameter": "pli",
                    "type": "nack"
                },
                {
                    "parameter": "fir",
                    "type": "ccm"
                },
                {
                    "parameter": "",
                    "type": "goog-remb"
                },
                {
                    "parameter": "",
                    "type": "transport-cc"
                }
            ]
        },
        {
            "clockRate": 90000,
            "kind": "video",
            "mimeType": "video/rtx",
            "parameters":
            {
                "apt": 101
            },
            "preferredPayloadType": 102,
            "rtcpFeedback": []
        }
    ],
    "headerExtensions":
    [
        {
            "direction": "sendrecv",
            "kind": "audio",
            "preferredEncrypt": false,
            "preferredId": 1,
            "uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 1,
            "uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
        },
        {
            "direction": "recvonly",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 2,
            "uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id"
        },
        {
            "direction": "recvonly",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 3,
            "uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
        },
        {
            "direction": "sendrecv",
            "kind": "audio",
            "preferredEncrypt": false,
            "preferredId": 4,
            "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 4,
            "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
        },
        {
            "direction": "recvonly",
            "kind": "audio",
            "preferredEncrypt": false,
            "preferredId": 5,
            "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 5,
            "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 6,
            "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 7,
            "uri": "urn:ietf:params:rtp-hdrext:framemarking"
        },
        {
            "direction": "sendrecv",
            "kind": "audio",
            "preferredEncrypt": false,
            "preferredId": 10,
            "uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 11,
            "uri": "urn:3gpp:video-orientation"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 12,
            "uri": "urn:ietf:params:rtp-hdrext:toffset"
        },
        {
            "direction": "sendrecv",
            "kind": "audio",
            "preferredEncrypt": false,
            "preferredId": 13,
            "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time"
        },
        {
            "direction": "sendrecv",
            "kind": "video",
            "preferredEncrypt": false,
            "preferredId": 13,
            "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time"
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![lehuan5062](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/lehuan5062/32/2326_2.png) [@lehuan5062](https://mediasoup.discourse.group/u/lehuan5062)\
**Post date:** [September 1, 2023, 3:40am UTC](https://mediasoup.discourse.group/t/crash-with-abort-signal-when-loading-device/5464/2 "2023-09-01T03:40:49Z")

</div>

I found that the crash happens at line 93 of `libmediasoupclient`’s `PeerConnection.cpp` [https://github.com/versatica/libmediasoupclient/blob/48768ba90dee235e045e8dfbf364365504e2c4ce/src/PeerConnection.cpp#L93](https://github.com/versatica/libmediasoupclient/blob/48768ba90dee235e045e8dfbf364365504e2c4ce/src/PeerConnection.cpp#L93)
