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

Improve runtime error message when not enough memory is available when saving ciphertexts #117

Closed
codedust opened this issue Jan 20, 2020 · 3 comments

Comments

@codedust
Copy link
Contributor

When trying to save a ciphertext to a byte-array less than the size needed to export the ciphertext, a generic "I/O error" gets thrown instead of some more descriptive error message like "not enough space to save the ciphertext".

Pseudo-code:

std::byte ciphertext_exported[4242];
ciphertext.save(ciphertext_exported, 4242);

Generic error message:

terminate called after throwing an instance of 'std::runtime_error'
  what():  I/O error
@codedust codedust changed the title Improve runtime error message when not enough memory is available on when saving ciphertexts Improve runtime error message when not enough memory is available when saving ciphertexts Jan 20, 2020
@WeiDaiWD
Copy link
Contributor

Let's me try to reproduce that and trace down why the error condition is skipped in our error messaging logic.

@fionser
Copy link
Contributor

fionser commented Apr 22, 2020

Also, I think the exception throw by SEAL is so information-less, and hard to trace down the point that throws the exception...

@kimlaine
Copy link
Contributor

This issue will be fixed in SEAL 3.5: the message will clearly indicate an insufficient buffer size.

@fionser: overall, the error messaging of SEAL is indeed problematic. There are many runtime errors (decryption, decoding, etc.) that are hard to trace back to their causes. We are working on compiler tools to help with this. Then there are logic errors that are in principle easily explainable, e.g. the user setting bad parameters and SEALContext validation failing, which then causes some confusing issues with KeyGenerator etc. creation failing. We'll address this specific issue in SEAL 3.5. In the future we'll definitely want to make all errors/exceptions easier to understand.

kimlaine added a commit that referenced this issue Apr 28, 2020
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

4 participants