Skip to content

Heap corruption (SIGABRT) during PhysX stage attach of a replicated scene: unsynchronized push_back into omni.physx's profile-stats vector from parallel PhysXReplicator::replicate tasks #954

Backlog

Description

@jiaxuan0lin0

Environment

Isaac Sim 6.0.1 (pip: isaacsim 6.0.1.0, isaacsim-kernel 6.0.1.0)
Kit 110.1.2 (kit_version 110.1.2+production.326809.f9bf0dda.gl)
omni.physx 110.1.13+110.1.2 (omni.physx-110.1.13+110.1.2.lx64.r.cp312.u7f4)
libomni.physx.plugin.so sha256 ee99f1bdeb1b444a693019b40d62c1e8c23e64f9a614ddaa99e05e8d7f9b8257
Isaac Lab 3.0.0 (isaaclab extension 6.1.17)
Python 3.12.3
GPU / driver NVIDIA GeForce RTX 5090 (32 GB), driver 580.178.04
OS Ubuntu 24.04.4 LTS, kernel 7.0.0-28-generic, glibc 2.39

We see the same failure on a second machine, a multi-GPU Linux node with RTX 5090s running the same Isaac Sim build. There it happened during a 4-process (one process per GPU) training start.

Symptoms

  • An Isaac Lab environment build sometimes aborts with SIGABRT during the PhysX stage attach. This is the step where Isaac Lab replicates physics for the cloned environments (replicate_physics=True); the abort comes right after Isaac Lab prints Replicate physics: True.
  • glibc prints one of:
    • double free or corruption (!prev)
    • malloc(): unaligned tcache chunk detected
  • The abort is intermittent: identical builds usually succeed. In our setup the rate is about 8% per build, so multi-process starts fail often: about 28% of 4-process starts and about 49% of 8-process starts.
  • Python-level handlers print nothing useful because the abort happens on a native carb.tasking worker thread.

Mechanism (from the cores and the shipped binary; offsets are for the build above)

  • omni.physx keeps one global profile-stats container of {zone name, ms} records. Its "custom profiling" flag is on by default: the constructor writes it, and IPhysxBenchmarks.enable_profile() is the only other code that writes it. After a replicated attach, get_physx_benchmarks_interface().get_profile_stats() returns about 6 zones by default, and 0 with profiling disabled.
  • PhysXReplicator::replicate schedules task lambdas on carb.tasking workers; their zones are ...::addCollections and ...::proccessReplicationData. Each lambda ends with, in effect, if (profilingEnabled) stats.push_back(...), and no lock is taken.
    • The push sites are around libomni.physx.plugin.so+0x157149..0x157187.
    • The vector reallocation is +0x162630, called from +0x157279 and +0x157eef.
  • When two workers grow the vector at the same time, one of them frees the old buffer while the other is still writing into it. The result is either an immediate double free or a corrupted tcache that a later malloc detects.
  • Our scenes clone many different rigid-body prototypes; replication is called once per prototype. That produces many concurrent replicate tasks, which makes the race much more likely.

Representative backtraces (crashing thread)

Case 1: free during the vector growth, on a carb.tasking fiber (7 of 14 cores look like this).

#0  pthread_kill (libc.so.6 + 0x9ebec)
#1  raise (libc.so.6 + 0x4527e)
#2  abort (libc.so.6 + 0x2898f)
...
#7  __libc_free (libc.so.6 + 0xade8e)
#8  n/a (libomni.physx.plugin.so + 0x162714)
#9  n/a (libomni.physx.plugin.so + 0x157ef4)
#10 n/a (libcarb.tasking.plugin.so + 0x301d7)
#11 n/a (libcarb.tasking.plugin.so + 0x2231c)
#12 n/a (libcarb.tasking.plugin.so + 0x2233f)
#13 make_fcontext (libcarb.tasking.plugin.so + 0x36419)

Case 2: a later malloc in the same replicate task detects the corrupted heap (4 of 14 cores).

#5  malloc (libc.so.6 + 0xada2c)
#6  operator new(unsigned long) (libstdc++.so.6 + 0xbb904)
#7  std::vector<unsigned long>::_M_realloc_insert<unsigned long const&>(...) (libomni.physx.plugin.so + 0x13257e)
#8  n/a (libomni.physx.plugin.so + 0x1578e6)
#9  n/a (libcarb.tasking.plugin.so + 0x301d7)
#10 n/a (libcarb.tasking.plugin.so + 0x2231c)

The remaining 3 cores detect the corruption later: one in a deeper malloc inside libomni.physx.plugin.so, one in the cooking plugin, and one on the main thread inside forceLoadPhysicsFromUSD. That main-thread core is waiting in carb.tasking on PhysXReplicator::replicate. No core has the PhysX GPU library (libPhysXGpu_64.so) or user code on the crashing stack.

Abort rates: profiling on (default) vs off

Each run builds an Isaac Lab manager-based environment: one articulated robot plus about 100 different rigid-object prototypes cloned over the environments, replicate_physics=True. It then resets and steps 5 times. All runs are on one RTX 5090.

Condition Profiling on (default) Profiling off
128 envs, builds one after another 7 / 88 (8.0%, 95% CI 3.3–15.7%) 0 / 33
64 envs, one after another 0 / 10 0 / 10
64 envs, 4 processes at once 1 / 45 0 / 29
All 8 / 143 0 / 72
  • Fisher exact test, one-sided: p = 0.036. The chance of seeing 0 / 72 at the default rate is about 1.6%.
  • Running under glibc's malloc checking (MALLOC_CHECK_=3 via libc_malloc_debug.so.0) gave 0 / 24 aborts, presumably because it changes the timing.
  • Turning profiling off has no other effect we can measure:
    • the simulation state after the reset and 5 steps is bit-identical (same sha256, 2 builds each way);
    • the build takes the same time (25.4 s at 128 envs).

Workaround

Call this once per process, after the app is up and before the scene / environment is built:

from omni.physx import get_physx_benchmarks_interface

get_physx_benchmarks_interface().enable_profile(False)

Repro conditions (generic)

  • Isaac Lab scene cloning with replicate_physics=True, many heterogeneous rigid prototypes (about 100 distinct rigid-object USDs cloned across environments), 64–128 environments, GPU PhysX.
  • Repeat the build many times (about 8% per build at 128 envs in our setup). Fewer prototypes or environments lower the rate.
  • Nothing else is needed: the race is in the replication tasks themselves.

Suggested fix

Do any of the following:

  • protect the profile-stats container with a mutex;
  • record into per-thread buffers that are merged after the replicate tasks join;
  • skip profile recording inside the replicate tasks.

Separately, consider making custom profiling opt-in, since it is on by default and nothing reads it unless asked.

Activity

  1. vick-yu commented on Nov 29, 2026

    @vick-yu

    Thanks for the detailed report. The core dumps, the A/B table with profiling on and off, and the offsets made this easy to check.

    Your diagnosis is correct, and the racing code was removed in Isaac Sim 6.1.0 and later.

    What's happening

    In 6.0.1 (omni.physx 110.1.13), the PhysX replicator's two concurrent worker tasks each record a profile-stats entry (PhysXReplicator::replicate::addCollections and PhysXReplicator::replicate::proccessReplicationData) into one shared, unlocked container. Internal profiling is enabled by default. If both tasks append while the container is growing, one frees the old buffer while the other still writes into it. That gives the double free or corruption / malloc(): unaligned tcache chunk detected aborts you see. Because it only goes wrong when the two appends land on a reallocation at the same moment, it is intermittent, and heavier scenes with many replicate calls hit it more often.

    I confirmed that on 6.0.1, get_physx_benchmarks_interface().get_profile_stats() returns those two zones after a replicated attach, and returns nothing after enable_profile(False).

    Fix

    • Please test on Isaac Sim 6.2.0 (with Isaac Lab 3.0.0, which you are already using). The replicator no longer records those two entries from its worker tasks in 6.1.0 and later. I checked this on 6.1.0 (the same replicated attach returns 8 stats records instead of 10, and the two racing zones are gone). The 6.2.0 binary also no longer contains those two zone names, but I only inspected it, I did not run a replicated attach on it. Since your failure rate is about 8% per build, a clean run of a few dozen builds with profiling left at its default would be good confirmation.
    • Stay on 6.0.1: your workaround is the right one. Run it once per process, before the scene is built:
    from omni.physx import get_physx_benchmarks_interface
    
    get_physx_benchmarks_interface().enable_profile(False)

    Nothing in the simulation depends on these stats unless you read them (via get_profile_stats() or a profile-stats subscription), and your bit-identical state check matches that.

    Notes

    • I could not trigger the abort with a synthetic scene of 100-400 identical cube prototypes on an aarch64 GB10 box (70 builds, none aborted). Those prototypes are much cheaper to process than your real scenes, so the two tasks rarely overlap there. This doesn't contradict your data; I only verified the mechanism, not the crash.
    • Isaac Lab PR #6559 fixed a separate multi-GPU double free in the same replicate path for fully heterogeneous layouts. Your report has a different trigger, but the symptom looks similar, so check which one you are hitting if you see this on a newer Isaac Lab build.

    Let us know if you still see aborts on 6.2.0 with profiling left at its default, since that would point to a different cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions