snucrypto / HEAAN

Other
359 stars 94 forks source link

Error while running tests "basic_string::_M_construct null not valid" #44

Closed TaihouKai closed 4 years ago

TaihouKai commented 4 years ago

Hi, I am new to HEAAN and I have just finished installing the lib and I was running tests in HEAAN/run.

I got this error:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
Aborted (core dumped)

Did I miss some dependencies?

KyoohyungHan commented 4 years ago

@TaihouKai I think this error is not related with HEAAN library. Can you give more information about compile environment?

TaihouKai commented 4 years ago

@TaihouKai I think this error is not related with HEAAN library. Can you give more information about compile environment?

I am compiling this test in WSL.

uname -r

4.4.0-19041-Microsoft

cat /etc/os-release

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

I don't know whether the problem is with the WSL...

KyoohyungHan commented 4 years ago

@TaihouKai Oh we did not test on WSL...

Can you check whether the NTL library is installed and tested correctly?

TaihouKai commented 4 years ago

@TaihouKai Oh we did not test on WSL...

Can you check whether the NTL library is installed and tested correctly?

I think yes. I runned make check after make (for both NTL and GMP).

KyoohyungHan commented 4 years ago

@TaihouKai I just want to make sure that you shoud given argument when running tests (e.g ./TestHEAAN Encrypt)

KyoohyungHan commented 4 years ago

@TaihouKai I tested HEAAN library on WSL and it works. I think this problem is from missing argument.

TaihouKai commented 4 years ago

@TaihouKai I tested HEAAN library on WSL and it works. I think this problem is from missing argument.

I tested it on Linux VM and it was still not working. I think it must be something wrong with my setting/argument.

root@vultr:~/workspace/HEAAN/HEAAN/run# ls
makefile  test.cpp
root@vultr:~/workspace/HEAAN/HEAAN/run# make
rm -rf TestHEAAN
Building target: TestHEAAN
Invoking: GCC C++ Linker
g++ test.cpp -o TestHEAAN -L/usr/local/lib ../lib/libHEAAN.a -lntl -lgmp -lm -std=c++11 -O2 -I/../src -pthread
Finished building target: TestHEAAN

root@vultr:~/workspace/HEAAN/HEAAN/run# ./TestHEAAN
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
Aborted (core dumped)
root@vultr:~/workspace/HEAAN/HEAAN/run#

I installed the dependencies (gmp & ntl) by:

$ ./configure SHARED=on
$ make
$ make check
$ install

... and added them to environment variables:

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
$ export LD_LIBRARY_PATH
TaihouKai commented 4 years ago

@TaihouKai I just want to make sure that you shoud given argument when running tests (e.g ./TestHEAAN Encrypt)

Ah, I see! Forgive me for such a stupid question. Thank you so much.

macknight commented 2 years ago

@TaihouKai I just want to make sure that you shoud given argument when running tests (e.g ./TestHEAAN Encrypt)

Ah, I see! Forgive me for such a stupid question. Thank you so much.

https://github.com/snucrypto/HEAAN/issues/26