tromp / cuckoo

a memory-bound graph-theoretic proof-of-work system
Other
822 stars 173 forks source link

mean30 terminates with illegal instruction (signal 4 - error 132) on virtualized Linux environment #31

Closed lucafavatella closed 6 years ago

lucafavatella commented 6 years ago

As per 6c78cec CI, that runs on virtualized Linux environment operated by Travis, fails:

$ if test demo30 = "${JOB:?}"; then ( cd src && env ${LIBV:?}="${LIBP:?}" make demo30; ); fi
g++ -march=native -m64 -std=c++11 -Wall -Wno-format -Wno-deprecated-declarations -D_POSIX_C_SOURCE=200112L -O3 -DPREFETCH -I.  -pthread -o mean30s -mavx2 -DSAVEEDGES -DNSIPHASH=8 -DEDGEBITS=29 mean_miner.cpp -L. -lblake2b
time ./mean30s -n 25
Looking for 42-cycle on cuckoo30("",25) with 50% edges
Using 3168MB bucket memory at 2ad301872010,
1x21MB thread memory at 2ad3c78b3010,
8-way siphash, and 128 buckets.
nonce 25 k0 k1 21db62abf2643353 f6603de05b29eab
Command terminated by signal 4
0.00user 0.68system 0:00.79elapsed 86%CPU (0avgtext+0avgdata 3268196maxresident)k
0inputs+0outputs (0major+3049minor)pagefaults 0swaps
make: *** [demo30] Error 132

This may be symptom of mean30 relying on undefined C/C++ behaviour, or similar other real issue.

lucafavatella commented 6 years ago

It may be for not up-to-date hence buggy compiler on Travis maybe? Relevant lines from Travis log:

Runtime kernel version: 4.9.6-040906-generic

Description:    Ubuntu 14.04.5 LTS

GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)

gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4

docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 16:58:30 2017
 OS/Arch:      linux/amd64

clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
lucafavatella commented 6 years ago

This ticket is specific to mean30 - not lean30 that seems more stable.

yeastplume commented 6 years ago

By default, mean miner runs needs a CPU that supports AVX2 instructions to run on, and a lot of slightly older processors don't support that instruction set. Building in that environment without the -mavx2 flag, as well as -DXBITS=0 and -DNSIPHASH=1 should allow it to run.

tromp commented 6 years ago

Building in that environment without the -mavx2 flag, as well as -DXBITS=0 and -DNSIPHASH=1 should get allow it to run.

XBITS has nothing to do with it though, and should not be changed.

regards, -John

yeastplume commented 6 years ago

I agree in theory, but I've found I needed to include the XBITS flag as well or it wouldn't compile. Try without first.

tromp commented 6 years ago

I agree in theory, but I've found I needed to include the XBITS flag as well or it wouldn't compile. Try without first.

XBITS=0 is needed for cuckoo16. cuckoo30 needs a much larger value like the default 7.

-John

yeastplume commented 6 years ago

Ah, of course, sorry.

lucafavatella commented 6 years ago

Outcome distilled in PR #33 (merged).