From cccbef736b758b7ceb9de857f63ee695a3daef39 Mon Sep 17 00:00:00 2001 From: momo <2438833481@qq.com> Date: Sat, 18 Oct 2025 11:04:58 +0800 Subject: [PATCH 1/2] add check to avoid thread issue Signed-off-by: momo <2438833481@qq.com> --- src/cmd/sim_main.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmd/sim_main.cc b/src/cmd/sim_main.cc index f3b2552413..534e60a6dd 100644 --- a/src/cmd/sim_main.cc +++ b/src/cmd/sim_main.cc @@ -459,7 +459,13 @@ int main(int argc, char** argv) app.formatter(std::make_shared(&app)); CLI11_PARSE(app, argc, argv); - + // check for invalid combination to avoid thread issue + if (!opt->file.empty() && !opt->playback.empty()) + { + gzerr << "Both an SDF file and playback flag are specified." + << "Only specify one." << std::endl; + return -1; + } std::string parsedSdfFile; if(!opt->launchServer && !opt->launchGui) { From 3c3c2405bd1f956ed4ee6110e0c1922748f75bf5 Mon Sep 17 00:00:00 2001 From: Oscmoar07 <108773152+XINJIANGMO@users.noreply.github.com> Date: Sat, 18 Oct 2025 12:09:55 +0800 Subject: [PATCH 2/2] update error message Co-authored-by: Ian Chen Signed-off-by: Oscmoar07 <108773152+XINJIANGMO@users.noreply.github.com> --- src/cmd/sim_main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/sim_main.cc b/src/cmd/sim_main.cc index 534e60a6dd..ba468e1898 100644 --- a/src/cmd/sim_main.cc +++ b/src/cmd/sim_main.cc @@ -462,8 +462,8 @@ int main(int argc, char** argv) // check for invalid combination to avoid thread issue if (!opt->file.empty() && !opt->playback.empty()) { - gzerr << "Both an SDF file and playback flag are specified." - << "Only specify one." << std::endl; + gzerr << "Both an SDF file and the playback flag (--playback) are specified. " + << "Specify only one of these arguments." << std::endl; return -1; } std::string parsedSdfFile;