SChernykh / p2pool

Decentralized pool for Monero mining
GNU General Public License v3.0
1.04k stars 124 forks source link

Get error "segmentation fault ./p2pool" when run on macOS Big Sur(MacBook Pro(13-inch, Late 2013)) #309

Open shoguncao opened 1 week ago

shoguncao commented 1 week ago

I download latest p2pool-v4.0-macos-x64.tar.gz from https://github.com/SChernykh/p2pool/releases/download/v4.0/p2pool-v4.0-macos-x64.tar.gz. When I run p2pool, I receive error "segmentation fault". My Mac and system is old(macOS Big Sur(MacBook Pro(13-inch, Late 2013))). But MacBook Pro Late 2013 can't install lastest system.

企业微信截图_77c405f4-d6c5-4152-87bd-bbfc03034e58
SChernykh commented 1 week ago

Can you add --loglevel 6 to the command line and see what P2Pool prints? The binary was compiled for macOS 10.13 or newer, so it should work on your system. I suspect that it can be some bug with LTO (Link time optimization) in the compiler that I used, I'll build a binary without it.

SChernykh commented 1 week ago

Can you try this binary? Don't pay attention for "macos-13" in the name - it was built on macOS 13, but built for macOS 10.13+

shoguncao commented 1 week ago

Can you try this binary? Don't pay attention for "macos-13" in the name - it was built on macOS 13, but built for macOS 10.13+

I have tried this binary, and add --loglevel 6, but still get the same error. And the prints ars same, no details log.

企业微信截图_b406d867-2f59-4637-86b1-3ace127edbc2
SChernykh commented 1 week ago

Hmm, what is the exact model of CPU in your Mac?

shoguncao commented 1 week ago

Hmm, what is the exact model of CPU in your Mac?

Here is the output of uname -a Darwin 192.168.0.150 20.6.0 Darwin Kernel Version 20.6.0: Thu Jul 6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64 x86_64

SChernykh commented 1 week ago

And what's the output of sysctl -a | grep machdep.cpu?

shoguncao commented 1 week ago

sysctl -a | grep machdep.cpu

Here is the output of sysctl -a | grep machdep.cpu

machdep.cpu.address_bits.physical: 39
machdep.cpu.address_bits.virtual: 48
machdep.cpu.arch_perf.events: 0
machdep.cpu.arch_perf.events_number: 7
machdep.cpu.arch_perf.fixed_number: 3
machdep.cpu.arch_perf.fixed_width: 48
machdep.cpu.arch_perf.number: 4
machdep.cpu.arch_perf.version: 3
machdep.cpu.arch_perf.width: 48
machdep.cpu.cache.L2_associativity: 8
machdep.cpu.cache.linesize: 64
machdep.cpu.cache.size: 256
machdep.cpu.mwait.extensions: 3
machdep.cpu.mwait.linesize_max: 64
machdep.cpu.mwait.linesize_min: 64
machdep.cpu.mwait.sub_Cstates: 286531872
machdep.cpu.thermal.ACNT_MCNT: 1
machdep.cpu.thermal.core_power_limits: 1
machdep.cpu.thermal.dynamic_acceleration: 1
machdep.cpu.thermal.energy_policy: 1
machdep.cpu.thermal.fine_grain_clock_mod: 1
machdep.cpu.thermal.hardware_feedback: 0
machdep.cpu.thermal.invariant_APIC_timer: 1
machdep.cpu.thermal.package_thermal_intr: 1
machdep.cpu.thermal.sensor: 1
machdep.cpu.thermal.thresholds: 2
machdep.cpu.tlb.data.small: 64
machdep.cpu.tlb.data.small_level1: 64
machdep.cpu.tlb.inst.large: 8
machdep.cpu.tlb.shared: 1024
machdep.cpu.tsc_ccc.denominator: 0
machdep.cpu.tsc_ccc.numerator: 0
machdep.cpu.xsave.extended_state: 7 832 832 0
machdep.cpu.xsave.extended_state1: 1 0 0 0
machdep.cpu.brand: 0
machdep.cpu.brand_string: Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
machdep.cpu.core_count: 2
machdep.cpu.cores_per_package: 8
machdep.cpu.extfamily: 0
machdep.cpu.extfeature_bits: 142473169152
machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT RDTSCP TSCI
machdep.cpu.extmodel: 4
machdep.cpu.family: 6
machdep.cpu.feature_bits: 9221959987971750911
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
machdep.cpu.leaf7_feature_bits: 10155 0
machdep.cpu.leaf7_feature_bits_edx: 2617247232
machdep.cpu.leaf7_features: RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 SMEP BMI2 ERMS INVPCID FPU_CSDS MDCLEAR IBRS STIBP L1DF SSBD
machdep.cpu.logical_per_package: 16
machdep.cpu.max_basic: 13
machdep.cpu.max_ext: 2147483656
machdep.cpu.microcode_version: 38
machdep.cpu.model: 69
machdep.cpu.processor_flag: 6
machdep.cpu.signature: 263761
machdep.cpu.stepping: 1
machdep.cpu.thread_count: 4
machdep.cpu.vendor: GenuineIntel
SChernykh commented 1 week ago

I thought it crashed because it didn't support BMI1, but it is a Haswell CPU with BMI1 support. Not LTO, not BMI1 that v4.0 started using, so it must be something else.

You'll have to build your own binary and run it under debugger to get a crash callstack... https://github.com/SChernykh/p2pool?tab=readme-ov-file#macos

shoguncao commented 1 week ago

I thought it crashed because it didn't support BMI1, but it is a Haswell CPU with BMI1 support. Not LTO, not BMI1 that v4.0 started using, so it must be something else.

You'll have to build your own binary and run it under debugger to get a crash callstack... https://github.com/SChernykh/p2pool?tab=readme-ov-file#macos

Yeah, my Mac is too old. After half a day, I build from source follow https://github.com/SChernykh/p2pool?tab=readme-ov-file#macos, I was able to run p2pool now. Thanks.

SChernykh commented 1 week ago

P2Pool uses CPUID x86 instruction to detect BMI1 support, it will not use BMI1 on older CPUs.

SChernykh commented 1 week ago

Release binaries are built for macOS 10.13 and newer versions. If they don't work, then it's a bug. You can build your own binary using instructions from README.MD

SChernykh commented 1 week ago

You can add -DWITH_GRPC=OFF to cmake command line (clean build folder first), or use a newer compiler version.

SChernykh commented 1 week ago

What is your compiler version? p2pool binary should show this information in the first few lines of the log when you start it. Or you can run clang --version in command line. If I know the version I can try to fix your original compile error.

SChernykh commented 1 week ago

@richardk80 Ah, see https://github.com/SChernykh/p2pool?tab=readme-ov-file#prerequisites I doubt that an older macOS knows about C++17.

SChernykh commented 1 week ago

You can try to install newer clang version (don't ask me how, I'm not a Mac user). GRPC is required for merge mining with Tari, it's not used otherwise.

SChernykh commented 1 week ago

Yes it will work after October. GRPC is required for Tari specifically.