Skip to content

Commit

Permalink
move 済み関数を呼び出してしまうのを修正するパッチを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Oct 18, 2024
1 parent cf5d300 commit 92905b9
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 2 deletions.
10 changes: 10 additions & 0 deletions patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,13 @@ rtc_use_perfetto=false した時にコンパイルエラーになる問題を修
M126 で perfetto を使うようになったけど、これは rtc_use_perfetto=false で無効にできるため試してみたところ、必要な部分が ifdef で囲まれていなかったためコンパイルエラーになった。
このパッチはその問題を修正するもの。
## fix_moved_function_call.patch
SesseionDescription のコールバック実行中に PeerConnection が破棄された時にクラッシュする問題を修正するパッチ。
https://github.com/shiguredo/sora-cpp-sdk/blob/e1257a3e358e62512c0c77db5ba82f90e2e26353/src/session_description.cpp#L84-L94
ここの中で sleep して、その間に SoraSignaling を破棄すると発生する。
多分パッチを送った方がいいやつ。
40 changes: 40 additions & 0 deletions patches/fix_moved_function_call.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/p2p/base/port.cc b/p2p/base/port.cc
index 25105dcdb0..cb7d60b629 100644
--- a/p2p/base/port.cc
+++ b/p2p/base/port.cc
@@ -673,7 +673,8 @@ bool Port::MaybeIceRoleConflict(const rtc::SocketAddress& addr,
}
break;
default:
- RTC_DCHECK_NOTREACHED();
+ // RTC_DCHECK_NOTREACHED();
+ break;
}
return ret;
}
diff --git a/pc/webrtc_session_description_factory.cc b/pc/webrtc_session_description_factory.cc
index 9919260aa3..f8849f2cd0 100644
--- a/pc/webrtc_session_description_factory.cc
+++ b/pc/webrtc_session_description_factory.cc
@@ -179,8 +179,9 @@ WebRtcSessionDescriptionFactory::~WebRtcSessionDescriptionFactory() {
// will be cancelled. If we don't protect them, they might trigger after peer
// connection is destroyed, which might be surprising.
while (!callbacks_.empty()) {
- std::move(callbacks_.front())();
+ auto f = std::move(callbacks_.front());
callbacks_.pop();
+ std::move(f)();
}
}

@@ -414,8 +415,9 @@ void WebRtcSessionDescriptionFactory::Post(
// Callbacks are pushed from the same thread, thus this task should
// corresond to the first entry in the queue.
RTC_DCHECK(!callbacks.empty());
- std::move(callbacks.front())();
+ auto f = std::move(callbacks.front());
callbacks.pop();
+ std::move(f)();
}
});
}
43 changes: 41 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def get_depot_tools(source_dir, fetch=False):
"h265.patch",
"fix_perfetto.patch",
"fix_windows_boringssl_string_util.patch",
"fix_moved_function_call.patch",
],
"windows_arm64": [
"4k.patch",
Expand All @@ -212,6 +213,7 @@ def get_depot_tools(source_dir, fetch=False):
"h265.patch",
"fix_perfetto.patch",
"fix_windows_boringssl_string_util.patch",
"fix_moved_function_call.patch",
],
"macos_arm64": [
"add_deps.patch",
Expand All @@ -227,6 +229,7 @@ def get_depot_tools(source_dir, fetch=False):
"arm_neon_sve_bridge.patch",
"dav1d_config_change.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ios": [
"add_deps.patch",
Expand All @@ -244,6 +247,7 @@ def get_depot_tools(source_dir, fetch=False):
"arm_neon_sve_bridge.patch",
"dav1d_config_change.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"android": [
"add_deps.patch",
Expand All @@ -259,6 +263,7 @@ def get_depot_tools(source_dir, fetch=False):
"h265.patch",
"h265_android.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"raspberry-pi-os_armv6": [
"nacl_armv6_2.patch",
Expand All @@ -269,6 +274,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"raspberry-pi-os_armv7": [
"add_deps.patch",
Expand All @@ -278,6 +284,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"raspberry-pi-os_armv8": [
"add_deps.patch",
Expand All @@ -287,6 +294,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-20.04_armv8": [
"add_deps.patch",
Expand All @@ -296,6 +304,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-22.04_armv8": [
"add_deps.patch",
Expand All @@ -305,6 +314,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-24.04_armv8": [
"add_deps.patch",
Expand All @@ -314,6 +324,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-20.04_x86_64": [
"add_deps.patch",
Expand All @@ -323,6 +334,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-22.04_x86_64": [
"add_deps.patch",
Expand All @@ -332,6 +344,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
"ubuntu-24.04_x86_64": [
"add_deps.patch",
Expand All @@ -341,6 +354,7 @@ def get_depot_tools(source_dir, fetch=False):
"ssl_verify_callback_with_native_handle.patch",
"h265.patch",
"fix_perfetto.patch",
"fix_moved_function_call.patch",
],
}

Expand Down Expand Up @@ -391,7 +405,19 @@ def apply_patches(target, patch_dir, src_dir, patch_until, commit_patch):
apply_patch(os.path.join(patch_dir, patch), src_dir, 1)
if patch == patch_until and not commit_patch:
break
cmd(["gclient", "recurse", "git", "add", "--", ":!*.orig", ":!*.rej"])
cmd(
[
"gclient",
"recurse",
"git",
"add",
"--",
":!*.orig",
":!*.rej",
":!:__config_site",
":!:__assertion_handler",
]
)
cmd(
[
"gclient",
Expand Down Expand Up @@ -479,7 +505,20 @@ def diff_webrtc(source_dir, webrtc_source_dir):

src_dir = os.path.join(webrtc_source_dir, "src")
with cd(src_dir):
cmd(["gclient", "recurse", "git", "add", "-N", "--", ":!*.orig", ":!*.rej"])
cmd(
[
"gclient",
"recurse",
"git",
"add",
"-N",
"--",
":!*.orig",
":!*.rej",
":!:__config_site",
":!:__assertion_handler",
]
)
dirs = _deps_dirs(src_dir)
for dir in dirs:
with cd(dir):
Expand Down

0 comments on commit 92905b9

Please sign in to comment.