pytorch - 💡(How to fix) Fix libshm/manager.cpp:49:8: error: ‘erase_if’ is not a member of ‘std’

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

/tmp/SBo/pytorch-v2.12.0/torch/lib/libshm/manager.cpp:49:8: error: ‘erase_if’ is not a member of ‘std’; did you mean ‘enable_if’? 49 | std::erase_if(pollfds, [fd](const struct pollfd& pfd) { return pfd.fd == fd; }); | ^~~~~~~~ | enable_if

Fix Action

Fix / Workaround

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 43 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0-63 Vendor ID: AuthenticAMD Model name: AMD Ryzen Threadripper 2990WX 32-Core Processor CPU family: 23 Model: 8 Thread(s) per core: 2 Core(s) per socket: 32 Socket(s): 1 Stepping: 2 Microcode version: 0x800820d Frequency boost: disabled CPU(s) scaling MHz: 72% CPU max MHz: 3000.0000 CPU min MHz: 2200.0000 BogoMIPS: 5999.26 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es Virtualization: AMD-V L1d cache: 1 MiB (32 instances) L1i cache: 2 MiB (32 instances) L2 cache: 16 MiB (32 instances) L3 cache: 64 MiB (8 instances) NUMA node(s): 4 NUMA node0 CPU(s): 0-7,32-39 NUMA node1 CPU(s): 16-23,48-55 NUMA node2 CPU(s): 8-15,40-47 NUMA node3 CPU(s): 24-31,56-63 Vulnerability Gather data sampling: Not affected Vulnerability Ghostwrite: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Old microcode: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Mitigation; untrained return thunk; SMT vulnerable Vulnerability Spec rstack overflow: Mitigation; Safe RET Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Code Example

/tmp/SBo/pytorch-v2.12.0/torch/lib/libshm/manager.cpp:49:8: error: ‘erase_if’ is not a member of ‘std’; did you mean ‘enable_if’?
   49 |   std::erase_if(pollfds, [fd](const struct pollfd& pfd) { return pfd.fd == fd; });
      |        ^~~~~~~~
      |        enable_if

---

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Slackware Linux  (x86_64)
GCC version: (GCC) 15.2.0
Clang version: 22.1.6
CMake version: version 4.3.3
Libc version: glibc-2.43

Python version: 3.12.13 (main, Mar  3 2026, 15:06:31) [GCC 15.2.0] (64-bit runtime)
Python platform: Linux-7.0.9-x86_64-AMD_Ryzen_Threadripper_2990WX_32-Core_Processor-with-glibc2.43
Is CUDA available: N/A
CUDA runtime version: 13.2.78
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: Quadro RTX 4000
Nvidia driver version: 595.58.03
cuDNN version: Could not collect
Is XPU available: N/A
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A
Caching allocator config: N/A

CPU:
Architecture:                            x86_64
CPU op-mode(s):                          32-bit, 64-bit
Address sizes:                           43 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  64
On-line CPU(s) list:                     0-63
Vendor ID:                               AuthenticAMD
Model name:                              AMD Ryzen Threadripper 2990WX 32-Core Processor
CPU family:                              23
Model:                                   8
Thread(s) per core:                      2
Core(s) per socket:                      32
Socket(s):                               1
Stepping:                                2
Microcode version:                       0x800820d
Frequency boost:                         disabled
CPU(s) scaling MHz:                      72%
CPU max MHz:                             3000.0000
CPU min MHz:                             2200.0000
BogoMIPS:                                5999.26
Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es
Virtualization:                          AMD-V
L1d cache:                               1 MiB (32 instances)
L1i cache:                               2 MiB (32 instances)
L2 cache:                                16 MiB (32 instances)
L3 cache:                                64 MiB (8 instances)
NUMA node(s):                            4
NUMA node0 CPU(s):                       0-7,32-39
NUMA node1 CPU(s):                       16-23,48-55
NUMA node2 CPU(s):                       8-15,40-47
NUMA node3 CPU(s):                       24-31,56-63
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Mitigation; untrained return thunk; SMT vulnerable
Vulnerability Spec rstack overflow:      Mitigation; Safe RET
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

Versions of relevant libraries:
[pip3] flake8==7.3.0
[pip3] numpy==2.3.2
[pip3] torch==2.11.0a0+gitunknown
[conda] Could not collect
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

I get this issue:

/tmp/SBo/pytorch-v2.12.0/torch/lib/libshm/manager.cpp:49:8: error: ‘erase_if’ is not a member of ‘std’; did you mean ‘enable_if’?
   49 |   std::erase_if(pollfds, [fd](const struct pollfd& pfd) { return pfd.fd == fd; });
      |        ^~~~~~~~
      |        enable_if

with https://github.com/pytorch/pytorch/blob/0cf995171d52b7607550ec586ccd46feee9ce65b/torch/lib/libshm/manager.cpp#L48-L51

Versions

<details><summary>collect_env.py output</summary> <p>
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Slackware Linux  (x86_64)
GCC version: (GCC) 15.2.0
Clang version: 22.1.6
CMake version: version 4.3.3
Libc version: glibc-2.43

Python version: 3.12.13 (main, Mar  3 2026, 15:06:31) [GCC 15.2.0] (64-bit runtime)
Python platform: Linux-7.0.9-x86_64-AMD_Ryzen_Threadripper_2990WX_32-Core_Processor-with-glibc2.43
Is CUDA available: N/A
CUDA runtime version: 13.2.78
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: Quadro RTX 4000
Nvidia driver version: 595.58.03
cuDNN version: Could not collect
Is XPU available: N/A
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A
Caching allocator config: N/A

CPU:
Architecture:                            x86_64
CPU op-mode(s):                          32-bit, 64-bit
Address sizes:                           43 bits physical, 48 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  64
On-line CPU(s) list:                     0-63
Vendor ID:                               AuthenticAMD
Model name:                              AMD Ryzen Threadripper 2990WX 32-Core Processor
CPU family:                              23
Model:                                   8
Thread(s) per core:                      2
Core(s) per socket:                      32
Socket(s):                               1
Stepping:                                2
Microcode version:                       0x800820d
Frequency boost:                         disabled
CPU(s) scaling MHz:                      72%
CPU max MHz:                             3000.0000
CPU min MHz:                             2200.0000
BogoMIPS:                                5999.26
Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sev sev_es
Virtualization:                          AMD-V
L1d cache:                               1 MiB (32 instances)
L1i cache:                               2 MiB (32 instances)
L2 cache:                                16 MiB (32 instances)
L3 cache:                                64 MiB (8 instances)
NUMA node(s):                            4
NUMA node0 CPU(s):                       0-7,32-39
NUMA node1 CPU(s):                       16-23,48-55
NUMA node2 CPU(s):                       8-15,40-47
NUMA node3 CPU(s):                       24-31,56-63
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Old microcode:             Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Mitigation; untrained return thunk; SMT vulnerable
Vulnerability Spec rstack overflow:      Mitigation; Safe RET
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; Retpolines; IBPB conditional; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

Versions of relevant libraries:
[pip3] flake8==7.3.0
[pip3] numpy==2.3.2
[pip3] torch==2.11.0a0+gitunknown
[conda] Could not collect
</p> </details>

cc @malfet @jbschlosser

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix libshm/manager.cpp:49:8: error: ‘erase_if’ is not a member of ‘std’