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

[Crash/Fuzzing] AssertionError during Deposit SSZ parsing. #895

Closed
pventuzelo opened this issue Apr 16, 2020 · 5 comments
Closed

[Crash/Fuzzing] AssertionError during Deposit SSZ parsing. #895

pventuzelo opened this issue Apr 16, 2020 · 5 comments

Comments

@pventuzelo
Copy link

pventuzelo commented Apr 16, 2020

Hi,

During fuzzing with beacon-fuzz, I triggered an AssertionError during parsing of Deposit ssz file with mainnet preset.

Error:
Error: unhandled exception: XXX/nim-beacon-chain/beacon_chain/spec/crypto.nim(290, 12) 'value.kind == Real' [AssertionError]

Reproducing

Download:
assert_nimbus_deposit.zip

commit: 96431bfd861be168ecc4cefb14fdb77d28108a24

Load the file using ncli_pretty:

$ cd ncli

$ ../env.sh nim c -d:const_preset=mainnet ncli_pretty

$ ./ncli_pretty --kind=deposit --file=assert_nimbus_deposit.ssz 
Traceback (most recent call last, using override)
XXX/nim-beacon-chain/vendor/nim-confutils/confutils.nim(981) confutils
XXX/nim-beacon-chain/vendor/nim-serialization/serialization.nim(41) CLI
XXX/nim-beacon-chain/vendor/nim-serialization/serialization.nim(27) encodeImpl
XXX/nim-beacon-chain/vendor/nim-serialization/serialization/object_serialization.nim(173) writeValue
XXX/nim-beacon-chain/vendor/nim-serialization/serialization/object_serialization.nim(173) writeValue
XXX/nim-beacon-chain/beacon_chain/spec/crypto.nim(290) writeValue
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/assertions.nim(29) failedAssertImpl
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/assertions.nim(22) raiseAssert
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/fatal.nim(51) sysFatal
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(407) reportUnhandledError
XXX/nim-beacon-chain/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(358) reportUnhandledErrorAux
Error: unhandled exception: XXX/nim-beacon-chain/beacon_chain/spec/crypto.nim(290, 12) `value.kind == Real`  [AssertionError]
@tersec
Copy link
Contributor

tersec commented Apr 16, 2020

I can reproduce this on 96431bfd861be168ecc4cefb14fdb77d28108a24 but not current devel -- 7b8d6ea

@pventuzelo
Copy link
Author

pventuzelo commented Apr 16, 2020

For devel branch, commit 7b8d6ea61c46ceb0edce1418a38275d7859f1334

Try with this sample:
assert_nimbus_devel_deposit.zip

@tersec
Copy link
Contributor

tersec commented Apr 16, 2020

Same lack of crash here on devel:

nim-beacon-chain/ncli$ ./ncli_pretty --kind=deposit --file=../../assert_nimbus_devel_deposit.ssz | head && echo exit value is 0
{
  "proof": [
    {
      "data": [
        0,
        0,
        0,
        0,
        0,
        0,
exit value is 0

I'm on commit:

commit 7b8d6ea61c46ceb0edce1418a38275d7859f1334 (HEAD -> devel, origin/devel)
Author: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
Date:   Thu Apr 16 00:20:27 2020 +0200

@pventuzelo
Copy link
Author

my bad, on devel it's good ;)

@tersec
Copy link
Contributor

tersec commented Apr 16, 2020

Good to know, and glad to have verified this was fixed.

@tersec tersec closed this as completed Apr 16, 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

2 participants