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

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

Closed
jserv opened this issue Feb 16, 2019 · 6 comments
Closed

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

jserv opened this issue Feb 16, 2019 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jserv
Copy link
Member

jserv commented Feb 16, 2019

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
@jserv
Copy link
Member Author

jserv commented Feb 16, 2019

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

@jserv jserv added the bug Something isn't working label Feb 16, 2019
@jserv jserv added this to the sprint-201902 milestone Feb 16, 2019
@marktwtn
Copy link
Collaborator

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.

@jserv
Copy link
Member Author

jserv commented Feb 21, 2019

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.

@marktwtn
Copy link
Collaborator

marktwtn commented Feb 22, 2019

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.

@marktwtn
Copy link
Collaborator

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.

@jserv
Copy link
Member Author

jserv commented Feb 22, 2019

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.

marktwtn added a commit to marktwtn/dcurl that referenced this issue Feb 22, 2019
If the thread finds the legal nonce value,
it should always return a positive or zero value.
Otherwise, it should always return a negative value.

Close DLTcollab#108.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants