Skip to content

[Bazel + MacOS] Some tests fail with mutex deadlock in Protobuf #3273

@shameekganguly

Description

@shameekganguly

Environment

  • OS Version: MacOS 15.7.3
  • Source or binary build? Bazel source build on gz-sim10 branch
$ bazel test  :AddedMass_TEST  --test_output streamed
...
(2026-01-20 17:51:40.230) [debug] [SimulationRunner.cc:1745] Additional plugins to load:
(2026-01-20 17:51:40.230) [debug] [SimulationRunner.cc:1748] gz::sim::systems::UserCommands gz-sim-user-commands-system
(2026-01-20 17:51:40.230) [debug] [SimulationRunner.cc:1748] gz::sim::systems::SceneBroadcaster gz-sim-scene-broadcaster-system
[mutex.cc : 1426] RAW: Potential Mutex deadlock: 
@ 0x105dafa70 absl::lts_20250127::DebugOnlyDeadlockCheck()
@ 0x105daf99c absl::lts_20250127::Mutex::Lock()
@ 0x105bc7424 absl::lts_20250127::MutexLock::MutexLock()
@ 0x105bc5ba0 absl::lts_20250127::MutexLock::MutexLock()
@ 0x105d3b6cc google::protobuf::internal::OnShutdownRun()
@ 0x105a72ebc google::protobuf::internal::OnShutdownDelete<>()
...
...
[mutex.cc : 1438] RAW: Acquiring absl::Mutex 0x600001d73b18 while holding  0x600001d73b18; a cycle in the historical lock ordering graph has been observed
[mutex.cc : 1439] RAW: Cycle: 
[mutex.cc : 1453] RAW: mutex@0x600001d73b18 stack: 
...

This crash happens at Server initialization, specifically when advertising services in a System plugin.

The hypothesis is that this occurs due to setting --dynamic_mode=off in .bazelrc, which results in two copies of protobuf and absl being linked into the main test binary and plugin binary respectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions