DLTcollab / dcurl

Hardware-accelerated Multi-threaded IOTA PoW, drop-in replacement for ccurl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion `ret_trits->data[i] == 0' failed on ARM64

jserv opened this issue · comments

I managed to build dcurl on Cavium ThunderX (aarch64) machine. However, it failed to pass the test suite:

$ make BUILD_STAT=1 check
...
*** Validating build/test-dcurl ***
test-dcurl: tests/test-dcurl.c:67: main: Assertion `ret_trits->data[i] == 0' failed.
Aborted (core dumped)
mk/common.mk:27: recipe for target 'build/test-dcurl.done' failed

int is signed on x86-gcc and unsigned on arm/aarch64-gcc by default.
Hint: contact @yillkid for shell access to Arm servers.

The SSE and AVX version work well.
However, the pure C version of test-dcurl and test-pow always fail.

I checked the previous commit and found out that this failure happened after the libtuv had integrated.

And there is something more interesting.
I checked out to the commit before integrating the libtuv. The test-pow worked well.
However, the test-dcurl failed occasionally.

This bug implies the lacking of diverse CI pipeline in current Travis-CI. At present, only SSE backend is checked, but both AVX and generic backend are not.

By using CGDB, I found out that dcurl does not use as many threads as it expected.
On my desktop, it should use 7 threads to do the PoW.
However, the default activated threads in threadpool of libtuv is 4.

But it did not explain why dcurl passes test in SSE and AVX version but not in generic C version.
The reason is the wrong returned value of thread execution.
The returned value should be positive or 0 if it finds the correct nonce value, otherwise it should be negative.
Even if the thread is not working as expected(like the dcurl and libtuv thread number mismatching mentioned before), it should follow the same rule.
In generic C version, a line of wrong code breaks this rule.

I'll send a pull request to fix it.
It also fixes the occasional failure of test-dcurl.


About the mismatching thread problem, let us leave it to the issue #102.

This bug implies the lacking of diverse CI pipeline in current Travis-CI. At present, only SSE backend is checked, but both AVX and generic backend are not.

The different backend checking has been added to our buildkite CI system.

By using CGDB, I found out that dcurl does not use as many threads as it expected.
On my desktop, it should use 7 threads to do the PoW.
However, the default activated threads in threadpool of libtuv is 4.

Describe and explain in directory docs/ as well.