Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV error on release build (nightly) #125354

Closed
jnickg opened this issue May 21, 2024 · 10 comments
Closed

SIGSEGV error on release build (nightly) #125354

jnickg opened this issue May 21, 2024 · 10 comments
Labels
C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware

Comments

@jnickg
Copy link

jnickg commented May 21, 2024

Code

Failure occurs on this commit of a crate I am working on when running cargo +nightly build --examples --release. Running cargo +stable build --examples --release works without issue

Meta

lscpu

Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          46 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   32
  On-line CPU(s) list:    0-31
Vendor ID:                GenuineIntel
  Model name:             Intel(R) Core(TM) i9-14900K
    CPU family:           6
    Model:                183
    Thread(s) per core:   2
    Core(s) per socket:   24
    Socket(s):            1
    Stepping:             1
    CPU(s) scaling MHz:   17%
    CPU max MHz:          6000.0000
    CPU min MHz:          800.0000
    BogoMIPS:             6376.00
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonsto
                          p_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowpr
                          efetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xge
                          tbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear
                           serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization features:  
  Virtualization:         VT-x
Caches (sum of all):      
  L1d:                    896 KiB (24 instances)
  L1i:                    1.3 MiB (24 instances)
  L2:                     32 MiB (12 instances)
  L3:                     36 MiB (1 instance)
NUMA:                     
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-31
Vulnerabilities:          
  Gather data sampling:   Not affected
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Not affected
  Reg file data sampling: Mitigation; Clear Register File
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
  Srbds:                  Not affected
  Tsx async abort:        Not affected

rustc --version --verbose:

rustc 1.80.0-nightly (b1ec1bd65 2024-05-18)
binary: rustc
commit-hash: b1ec1bd65f89c1375d2cf2fb733a87ef390276d3
commit-date: 2024-05-18
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4

Error output

See backtrace for more info

[<output>](error: rustc interrupted by SIGSEGV)
Backtrace

error: rustc interrupted by SIGSEGV, printing backtrace

/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x311c2c6)[0x74d06c11c2c6]
/usr/lib/libc.so.6(+0x3ce20)[0x74d068e58e20]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x6013385)[0x74d067413385]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x60109a2)[0x74d0674109a2]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0xa8f)[0x74d067135b0f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x2f)[0x74d067134fc5]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x260)[0x74d06769df60]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(LLVMRustWriteOutputFile+0x190)[0x74d06e0b75d0]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x50b71e8)[0x74d06e0b71e8]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x50b4e6f)[0x74d06e0b4e6f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x50b4b45)[0x74d06e0b4b45]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x50b2e5d)[0x74d06e0b2e5d]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-19928b511f4c0fd8.so(+0x50b241b)[0x74d06e0b241b]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libstd-de48b8168d6cf4fa.so(rust_metadata_std_66d359a9a7bc158b+0xc378b)[0x74d06f68078b]
/usr/lib/libc.so.6(+0x8e1cf)[0x74d068eaa1cf]
/usr/lib/libc.so.6(+0x10f6ec)[0x74d068f2b6ec]

@jnickg jnickg added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 21, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 21, 2024
@jwong101
Copy link
Contributor

Hmm, I can't seem to reproduce it. I'm building on commit f25633a51a321a2090b7d5c41608c24c12df217e with the exact same rustc version:

rustc --version --verbose
rustc 1.80.0-nightly (b1ec1bd65 2024-05-18)
binary: rustc
commit-hash: b1ec1bd65f89c1375d2cf2fb733a87ef390276d3
commit-date: 2024-05-18
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4

Could you try building with the latest nightly? There was a recent LLVM update that fixed a reported segfault, although that one was on an M1 Macbook.

@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label May 22, 2024
@jnickg
Copy link
Author

jnickg commented May 22, 2024

Updating to the latest changes behavior. The same segfault occurs, plus I get a new one!

rustc --version --verbose

rustc 1.80.0-nightly (791adf759 2024-05-21)
binary: rustc
commit-hash: 791adf759cc065316f054961875052d5bc03e16c
commit-date: 2024-05-21
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

New stack trace for existing segfault:

/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x310eb66)[0x7554dc30eb66]
/usr/lib/libc.so.6(+0x3ce20)[0x7554d9058e20]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm19simplifyInstructionEPNS_11InstructionERKNS_13SimplifyQueryE+0xdc)[0x7554d72de526]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5cecf82)[0x7554d72ecf82]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5c19b12)[0x7554d7219b12]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x689)[0x7554d7221317]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm26CGSCCToFunctionPassAdaptor3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x36f)[0x7554d743e0c5]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5e3dd51)[0x7554d743dd51]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_13LazyCallGraph3SCCENS_15AnalysisManagerIS2_JRS1_EEEJS4_RNS_17CGSCCUpdateResultEEE3runERS2_RS5_S4_S7_+0x5c2)[0x7554d743c982]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm21DevirtSCCRepeatedPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x17d)[0x7554d743b889]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0xbaa)[0x7554d743a32a]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x629564d)[0x7554d789564d]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xe1)[0x7554d7895831]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm24ModuleInlinerWrapperPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x19c)[0x7554d789741c]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x629726f)[0x7554d789726f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xe1)[0x7554d7895831]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(LLVMRustOptimize+0x822)[0x7554de26e7ae]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x5070d3f)[0x7554de270d3f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(_RNvXs1_CsacbF25odv79_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCsaC23inXIoVy_17rustc_codegen_ssa6traits5write19WriteBackendMethods8optimize+0xe3)[0x7554de2aee23]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x50ad6c3)[0x7554de2ad6c3]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x50ad29b)[0x7554de2ad29b]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libstd-6701759d8343e913.so(rust_metadata_std_c7445a34834edf15+0xc24db)[0x7554df8ad4db]
/usr/lib/libc.so.6(+0x8e1cf)[0x7554d90aa1cf]
/usr/lib/libc.so.6(+0x10f6ec)[0x7554d912b6ec]

Now I also get a segfault on this commit of another project I am working on, when running cargo +nightly build --release

Stack trace:

/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x310eb66)[0x74f67e90eb66]
/usr/lib/libc.so.6(+0x3ce20)[0x74f67b658e20]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5c00b83)[0x74f679800b83]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm9AAResults13getModRefInfoEPKNS_11InstructionERKSt8optionalINS_14MemoryLocationEERNS_11AAQueryInfoE+0x444)[0x74f679859804]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm23MemoryDependenceResults27getNonLocalPointerDepFromBBEPNS_11InstructionERKNS_12PHITransAddrERKNS_14MemoryLocationEbPNS_10BasicBlockERNS_15SmallVectorImplINS_17NonLocalDepResultEEERNS_8DenseMapISA_PNS_5ValueENS_12DenseMapInfoISA_vEENS_6detail12DenseMapPairISA_SH_EEEEbb+0xdf1)[0x74f6798516bd]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm23MemoryDependenceResults27getNonLocalPointerDepFromBBEPNS_11InstructionERKNS_12PHITransAddrERKNS_14MemoryLocationEbPNS_10BasicBlockERNS_15SmallVectorImplINS_17NonLocalDepResultEEERNS_8DenseMapISA_PNS_5ValueENS_12DenseMapInfoISA_vEENS_6detail12DenseMapPairISA_SH_EEEEbb+0x656)[0x74f679850f22]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm23MemoryDependenceResults28getNonLocalPointerDependencyEPNS_11InstructionERNS_15SmallVectorImplINS_17NonLocalDepResultEEE+0x2d0)[0x74f679850890]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm7GVNPass19processNonLocalLoadEPNS_8LoadInstE+0x68)[0x74f67984fd42]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm7GVNPass12processBlockEPNS_10BasicBlockE+0x708)[0x74f6798ddc08]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm7GVNPass7runImplERNS_8FunctionERNS_15AssumptionCacheERNS_13DominatorTreeERKNS_17TargetLibraryInfoERNS_9AAResultsEPNS_23MemoryDependenceResultsERNS_8LoopInfoEPNS_25OptimizationRemarkEmitterEPNS_9MemorySSAE+0x211)[0x74f6798dd4d1]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm7GVNPass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE+0x25c)[0x74f67981b1dc]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5c1af73)[0x74f67981af73]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x689)[0x74f679821317]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm26CGSCCToFunctionPassAdaptor3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x36f)[0x74f679a3e0c5]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x5e3dd51)[0x74f679a3dd51]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_13LazyCallGraph3SCCENS_15AnalysisManagerIS2_JRS1_EEEJS4_RNS_17CGSCCUpdateResultEEE3runERS2_RS5_S4_S7_+0x5c2)[0x74f679a3c982]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm21DevirtSCCRepeatedPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x17d)[0x74f679a3b889]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0xbaa)[0x74f679a3a32a]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x629564d)[0x74f679e9564d]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xe1)[0x74f679e95831]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm24ModuleInlinerWrapperPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x19c)[0x74f679e9741c]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(+0x629726f)[0x74f679e9726f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.80.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xe1)[0x74f679e95831]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(LLVMRustOptimize+0x822)[0x74f68086e7ae]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x5070d3f)[0x74f680870d3f]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x5070894)[0x74f680870894]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(_RNvXs1_CsacbF25odv79_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCsaC23inXIoVy_17rustc_codegen_ssa6traits5write19WriteBackendMethods13optimize_thin+0x61e)[0x74f6808b2cb4]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x50adc79)[0x74f6808adc79]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-937479a9c8b72905.so(+0x50ad29b)[0x74f6808ad29b]
/home/jnickg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libstd-6701759d8343e913.so(rust_metadata_std_c7445a34834edf15+0xc24db)[0x74f681e564db]
/usr/lib/libc.so.6(+0x8e1cf)[0x74f67b6aa1cf]
/usr/lib/libc.so.6(+0x10f6ec)[0x74f67b72b6ec]

@jnickg
Copy link
Author

jnickg commented May 22, 2024

This is highly problematic for me as I need to be able to write/run bench tests which, as far as I know, require #![feature(test)]

@jwong101
Copy link
Contributor

Hmm, unfortunately I can't seem to reproduce the segfault with this commit either.

❯ rustc --version --verbose
rustc 1.80.0-nightly (791adf759 2024-05-21)
binary: rustc
commit-hash: 791adf759cc065316f054961875052d5bc03e16c
commit-date: 2024-05-21
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Do you happen to have any extra rustflags set in your Cargo's config.toml? Also, what's the last command that ends up running with cargo +nightly build --release --verbose before it segfaults?

@jnickg
Copy link
Author

jnickg commented May 23, 2024

I don't see any relevant config.toml files anywhere (checking from the repo clone where I ran the cargo command, back up to my home directory; only my home directory has a .cargo folder, in which I did not find a config.toml file).

In the rust-explorations repo, my SIGSEGV consistently occurs here:

cargo +nightly build --release --verbose --examples

       Fresh idna v0.2.3
error: rustc interrupted by SIGSEGV, printing backtrace

And in the image-pyramid repo:

cargo +nightly build --release --verbose --examples

       Fresh toml_edit v0.19.15
error: rustc interrupted by SIGSEGV, printing backtrace

Is there any chance it is related to my specific CPU? I've occasionally seen SIGSEGV errors occur randomly in ways that were not reproducible, when building rust code. It seems more likely to crop up when building many crates at once, but when I run the same command to rebuild (after most crates built successfully), the crate that failed then succeeds without issue. Not worth filing a bug report for random failures, but I'm wondering if someone with an i9-14900K might have more luck reproducing it.

@nikic
Copy link
Contributor

nikic commented May 23, 2024

FWIW I also can't reproduce this (on znver2).

@ChrisDenton
Copy link
Member

It should be noted that compiling rust can exercise the CPU more than a lot of other things and any errors are likely to be fatal in one way or another.

It might be worth running a CPU test to see if there are any issues. You could also try downclocking to see if that helps.

@jwong101
Copy link
Contributor

Hmm, that could be it (I'm on znver3). I found a comment from someone that's also been experiencing segfaults when compiling rust code on an i9-14900k.

@jnickg
Copy link
Author

jnickg commented May 27, 2024

Just an update on my end: So far I have not found any faults in the CPU. The fact that stable has no issues AFAICT seems to also indicate this may be some kind of latent bug under the hood of the nightly compiler.

That said, I have also observed a few (very rare) system crashes. I always chalked it up to system instability (I'm running Manjaro and, besides Linux/Arch having hiccups like that occasionally, I also have a lot of compute-heavy things installed and running). But I wouldn't say I've fully proven that it's NOT the CPU (yet).

Any suggestions for good things to check related to finding potential CPU issues?

@workingjubilee
Copy link
Member

workingjubilee commented Jun 3, 2024

You have a recent Intel CPU which is known to have bugs. Please, at minimum, adjust the power settings in your motherboard BIOS after updating it. You can choose to either follow your motherboard manufacturer's recommendations or listen to Intel.

Several motherboard manufacturers have released BIOS profiles labeled ‘Intel Baseline Profile’. However, these BIOS profiles are not the same as the 'Intel Default Settings' recommendations that Intel has recently shared with its partners regarding the instability issues reported on 13th and 14th gen K SKU processors.

These ‘Intel Baseline Profile’ BIOS settings appear to be based on power delivery guidance previously provided by Intel to manufacturers describing the various power delivery options for 13th and 14th Generation K SKU processors based on motherboard capabilities.

Intel is not recommending motherboard manufacturers to use ‘baseline’ power delivery settings on boards capable of higher values.

Intel’s recommended ‘Intel Default Settings’ are a combination of thermal and power delivery features along with a selection of possible power delivery profiles based on motherboard capabilities.

Intel recommends customers to implement the highest power delivery profile compatible with each individual motherboard design as noted in the table below:
Intel's settings table which recommends, if the motherboard supports it, enabling all of CEP, eTVB, TVB, TVB Voltage Optimizations, and C-states, disabling the ICCMAX Unlimited Bit, setting TjMax Offset: 0, setting the AC Load Line so it has a max value of 1.1mOhm, matching the DC Load Line, VR, and BIOS Load Line values, and setting the Power Delivery profile to, for the 14900K, if the motherboard supports it, either N/A or, for the Performance profile, ICCmax: 307A, ICCmax_App: 245A, PL1: 125W, PL2: 253W, and PL4: 380W

This has also been fixed by downclocking the CPU. You can, of course, also attempt to get Intel, the motherboard manufacturer, or the vendor that sold you these things, to accept a return of their faulty merchandise.

Closing this until it repros without a dodgy CPU.

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@saethlin saethlin added C-discussion Category: Discussion or questions that doesn't represent real issues. C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. C-discussion Category: Discussion or questions that doesn't represent real issues. labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-defective-hardware Category: Issue that was filed as a possible software bug but is actually defective hardware
Projects
None yet
Development

No branches or pull requests

8 participants