返回

c++-RTC_DCHECK_IS_ON 时的 WebRTC std::deque 迭代器异常

发布时间:2022-05-28 21:52:47 362
# golang

最近,由于 lib-WebRTC 的 M83 和 M84 版本,当我在 Visual Studio 上的 Windows x64 调试配置 (RTC_DCHECK_IS_ON) 中运行我的主机程序时遇到一个奇怪的错误:

在 WebRTC 库中创建视频频道时,出现异常

_Deque_const_iterator& operator++() {
        #if _ITERATOR_DEBUG_LEVEL != 0
            const auto _Mycont = static_cast(this->_Getcont());
            _STL_VERIFY(_Mycont, "cannot increment value-initialized deque iterator");
here---->   _STL_VERIFY(this->_Myoff < _Mycont->_Myoff + _Mycont->_Mysize, "cannot increment deque iterator past end");**
        #endif // _ITERATOR_DEBUG_LEVEL != 0

        ++_Myoff;
        return *this;
}

因为 _Myoff 是 NULL ...

这个 ++operator 是从 WebRTC 库中的 rtc_base/thread.cc 调用的:

void ThreadManager::RegisterSendAndCheckForCycles(Thread* source,
                                              Thread* target) {
    CritScope cs(&crit_);
    std::deque<Thread*> all_targets({target});
        // We check the pre-existing who-sends-to-who graph for any path from target
        // to source. This loop is guaranteed to terminate because per the send graph
        // invariant, there are no cycles in the graph.
    for (auto it = all_targets.begin(); it != all_targets.end(); ++it) {
        const auto& targets = send_graph_[*it];
        all_targets.insert(all_targets.end(), targets.begin(), targets.end());
    }

    ... 

它来自 std::deque< rtc::Thread* > 的 ++it

我真的不知道可能是什么问题,但似乎迭代器有问题。

Visual Studio 调试

也许我在编译的 webrtc.lib 和我的项目之间存在某种配置不匹配,但例如 WebRTC M79 或 M81 没有任何问题。而且,由于 WebRTC 确实是一个巨大的项目,我不知道从哪里开始我的调查。

任何的想法 ?

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(2)
按点赞数排序
用户头像