Skip to content

[Bug]: SIGSEGV in MemcpyWorkerPool::workerThread under TCP transport with concurrent put/get #1986

Description

@Dogacel

Bug Report

Summary

On a TCP-only host, MC_STORE_MEMCPY auto-enables and creates a MemcpyWorkerPool. Under concurrent put/get from a multi-threaded Python client, a worker thread segfaults inside glibc __memcpy_avx512_unaligned_erms. Setting MC_STORE_MEMCPY=0 reliably avoids the crash.

Regression PR: #1936

Reproduction

  1. Run a multi-process workload where one Mooncake client puts host buffers and another gets them concurrently over TCP.
  2. After a few seconds (first batches arriving), a memcpy worker thread crashes.

I've used https://github.com/torchspec-project/TorchSpec's Qwen 8B training pipeline.

Crash signature

gdb on a core dump shows the crashing thread:

#0  __memcpy_avx512_unaligned_erms ()
    at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:265
#1  mooncake::MemcpyWorkerPool::workerThread ()
    from .../site-packages/mooncake/store.so
#2  std::execute_native_thread_routine
#3  start_thread
#4  clone3

Workaround

export MC_STORE_MEMCPY=0

This bypasses MemcpyWorkerPool and the crash disappears completely. Switching transport to RDMA also avoids it (RDMA path doesn't use the pool).


Environment

  • mooncake-transfer-engine 0.3.10.post2 (pip)
  • Python 3.12.13 (miniconda)
  • Ubuntu, kernel 6.8.0-1043-aiext, glibc default, system libstdc++.so.6
  • Transport: TCP only (RDMA hardware available but not selected)
  • Workload: speculative-decoding training pipeline (TorchSpec). Inference workers call put_from, trainer workers call get_into host buffers concurrently.
  • Host buffer pool size: 8 × 1 GB; segment size 16 GB; local buffer 4 GB
  • MC_STORE_MEMCPY not set → log shows: auto-detected: TCP-only environment, memcpy enabled

Before submitting...

  • Ensure you searched for relevant issues and read the [documentation]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions