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

make check failures: assert() and then several unable to execute bc: No such file or directory #2

Open
pulmark opened this issue Nov 12, 2018 · 4 comments

Comments

@pulmark
Copy link

pulmark commented Nov 12, 2018

make check command fails at

addremove.c:64: main: Assertion `p == &allocation_packets[i]' failed.

There are also lot of errors as:

check/z/shift
unable to execute bc: No such file or directory
unable to receive result from bc: Success

Below is a copy of the make check command output:

check/alloc/addremove
addremove: check/alloc/addremove.c:64: main: Assertion `p == &allocation_packets[i]' failed.
runtests.sh: line 13: 17777 Aborted (core dumped) $1
check/alloc/fixed
check/p/pcmp
check/p/pcopy
check/p/pmove
check/p/pnorm
check/p/pzero
check/p/negnot
check/p/strings
check/z/getset
check/z/shift
unable to execute bc: No such file or directory
unable to receive result from bc: Success
check/z/zcmp
unable to execute bc: No such file or directory
unable to receive result from bc: Success
check/z/zcmpmag
unable to execute bc: No such file or directory
unable to receive result from bc: Success
....

@suiginsoft
Copy link
Owner

Hi, thanks for trying it out. What compiler, OS, and user environment are you using to build hebimath?

bc(1) is required to run the unit tests (it uses it as a test oracle), and it looks like it's failing to find it in your PATH. Please make sure to install it through your package manager as not all distros have it available by default. I should add a check to runtests.sh for bc so that is fails more gracefully.

It's been a couple of years since I've worked on this project, but I'm looking at dedicating some time over the next couple of months to take it to the next level. A few things I have planned are to shorten the namespace prefix from hebi_ to hm_ and implement function variants using the mulx/adx instruction extensions now that I have a new workstation with a CPU that supports it. Also take care of everything on the TODO list.

@pulmark
Copy link
Author

pulmark commented Nov 14, 2018 via email

@suiginsoft
Copy link
Owner

suiginsoft commented Nov 19, 2018

I tried out OpenSUSE Leap, it didn't repro the issue. I then updated to Tumbleweed and suddenly got the same error as yourself, which is promising. I will attempt to debug and fix it tomorrow.

Hebimath is as fast or faster than GNU MP on most operations for large integers under 4096 bits, but GNU MP is quite a bit faster with dividing and multiplying very large integers due to it using more complex algorithms that scale more efficiently. If you're interested, the author of libzahl put together a benchmark with an older version of Hebimath, GMP and Tom's Fast Math. Since then, Hebimath has borrowed many of the tricks that libzahl used to beat GMP.

Hebimath doesn't try to be fast on older hardware or 32-bit hardware. I'm only interested in implementing modern x86-64 and ARM64 optimized assembly backends.

@suiginsoft
Copy link
Owner

Turns out the problem was a false positive and is simpler to fix than I thought it might be. Looks like GCC 8.2 now optimizes away that equality checks on return values from functions marked with the malloc function attribute, so all of the assertions on pointers returned from hebi_alloc or hebi_allocfp were being turned into false conditions. I'll get a fix for affected unit test submitted sometime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants