Skip to content

fix(simulator): improve grouped signal handling and runtime reliability - #12

Open
matthewrossi wants to merge 5 commits into
avoid-disabling-aslrfrom
fix-simulator-issues
Open

fix(simulator): improve grouped signal handling and runtime reliability#12
matthewrossi wants to merge 5 commits into
avoid-disabling-aslrfrom
fix-simulator-issues

Conversation

@matthewrossi

Copy link
Copy Markdown
Collaborator
  • Scope uprobes to the target model process and pin ptrace setup to a single OS thread.
  • Support up to 16 signals in grouped reads, writes, and live perturbations.
  • Correct group-cookie encoding and write-trajectory indexing.
  • Configure eBPF signal-map capacities before loading the maps.
  • Prevent monitoring hangs when ring-buffer records are lost or the model exits early.
  • Improve process cleanup and monitoring error propagation.

  Start the model before attaching its uprobes and keep it stopped while
  runtime addresses are resolved and installed. Attach read, write, and
  timer probes using the target PID, then detach from ptrace.

  This prevents other instances of the same executable from triggering
  probes configured with process-specific runtime addresses.
  Lock the simulator goroutine to its OS thread before starting the
  ptraced model and keep it pinned through address resolution, uprobe
  attachment, and detachment.

  Release the thread immediately after ptrace synchronization completes
  and ensure early error paths also unlock it.
  Encode group sizes as size minus one to support 1–16 signals with the
  four-bit uprobe cookie field. Reject empty groups and configurations
  with more than 16 read or write signals.

  Expand eBPF and userspace injection buffers and loops to handle 16
  signals consistently. Split write processing into unrolled eight-entry
  chunks to avoid verifier failures, and correct live perturbation
  trajectory indexing when read signals precede writes.
  Terminate the model once the configured cycle limit is reached even if
  the final ring-buffer reservation fails, and retry termination after
  the cycle counter advances beyond the limit.

  Track and reap the model process during monitoring, use userspace
  cancellation as a termination fallback, and report incomplete traces
  instead of waiting indefinitely for missing records. Also propagate
  monitoring errors correctly in perturbation modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant