openfhe-development icon indicating copy to clipboard operation
openfhe-development copied to clipboard

Investigate memory problem while running unit tests linked with Emscripten

Open dsuponitskiy opened this issue 2 years ago • 0 comments

  1. Link OpenFHE with Emscripten and -DNATIVE_SIZE=64
  2. Run node ./unittest/pke_tests.js on a Ubuntu machine with 16GB or 32GB RAM

Unittests in src/pke/unittest/utckksrns/UnitTestCKKSrns.cpp (EVAL_FAST_ROTATION_41 and all others after it) and src/pke/unittest/utckksrns/UnitTestCKKSrnsSerialize.cpp (CONTEXT_WITH_SERTYPE) fail because of lack of memory. Example: "Exception thrown from UnitTest_EvalFastRotation(): std::bad_alloc" for EVAL_FAST_ROTATION_41.

It is most likely because of the cryptocontext memory not cleared after the previous test cases (could be cryptocontext's static data members).

dsuponitskiy avatar Nov 30 '22 22:11 dsuponitskiy