Skip to content

Run all_tests instead of seperate parts tests#831

Open
kdeme wants to merge 1 commit into
masterfrom
run-all-tests
Open

Run all_tests instead of seperate parts tests#831
kdeme wants to merge 1 commit into
masterfrom
run-all-tests

Conversation

@kdeme
Copy link
Copy Markdown
Contributor

@kdeme kdeme commented Nov 27, 2025

Triggers locally a runtime error on the orc build

MPT trie proof verification Error: execution of an external program failed: '/home/deme/repos/nimbus-eth1/vendor/nim-eth/build/all_tests'
stack trace: (most recent call last)
./nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(427, 18)
./nimbus-eth1/vendor/nim-eth/eth.nimble(68, 3) testTask
,/nimbus-eth1/vendor/nim-eth/eth.nimble(44, 3) run
./nimbus-eth1/vendor/nim-eth/eth.nimble(39, 3) build
./nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(264, 7) exec
./nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(264, 7) Error: unhandled exception: FAILED: nim c  --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --nimcache:build/nimcache -f -d:chronicles_log_level=TRACE --threads:on -d:release  --mm:orc -r --outdir:build/ tests/all_tests [OSError]

@tersec
Copy link
Copy Markdown
Contributor

tersec commented Nov 27, 2025

As in, the status quo triggers this? or the changes here trigger this?

It's worth looking into the runtime error.

@kdeme
Copy link
Copy Markdown
Contributor Author

kdeme commented Nov 27, 2025

As in, the status quo triggers this? or the changes here trigger this?

It's worth looking into the runtime error.

The changes trigger it locally for me, I want to see if the same occurs in CI.
Compiling and running the MPT trie proof verification alone with orc enabled does not crash. But in the full all_tests.nim it does.

@kdeme
Copy link
Copy Markdown
Contributor Author

kdeme commented Nov 27, 2025

Better stacktrace:

MPT trie proof verification Traceback (most recent call last, using override)
/home/deme/repos/nimbus-eth1/vendor/nim-metrics/metrics.nim(443) main
/home/deme/repos/nimbus-eth1/vendor/nim-metrics/metrics.nim(434) NimMain
/home/deme/repos/nimbus-eth1/vendor/nim-metrics/metrics.nim(419) PreMain
/home/deme/repos/nimbus-eth1/vendor/nim-metrics/metrics.nim(386) PreMainInner
/home/deme/repos/nimbus-eth1/vendor/nim-unittest2/unittest2.nim(1170) atmtrieatstest_hexary_proofdotnim_Init000
/home/deme/repos/nimbus-eth1/vendor/nim-unittest2/unittest2.nim(1090) _ZN9unittest29runDirectEN9unittest24TestE
/home/deme/repos/nimbus-eth1/vendor/nim-eth/tests/trie/test_hexary_proof.nim(38) _ZN17test_hexary_proof18runTestX60gensym3_E6string6string
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth/trie/hexary_proof_verification.nim(219) _ZN25hexary_proof_verification14verifyMptProofE3seqI3seqI5uInt8EEN6hashes6Hash32E9openArrayI5uInt8E9openArrayI5uInt8E
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth/trie/hexary_proof_verification.nim(176) _ZN25hexary_proof_verification11verifyProofE3refIN2db31TrieDatabaseRefcolonObjectType_EEN6hashes6Hash32E9openArrayI5uInt8E
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth/rlp.nim(177) _ZN25hexary_proof_verification11getNextNodeEN3rlp3RlpEN7nibbles10NibblesBufE
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system.nim(934) _ZN7options10eqdestroy_E3varIN7options6OptionEE
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/alloc.nim(1063) _ZN6system10rawDeallocE3varIN6system9MemRegionEE7pointer.constprop.0
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/alloc.nim(815) _ZN6system28addToSharedFreeListBigChunksE3varIN6system9MemRegionEE3ptrIN6system8BigChunkEE
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(652) signalHandler
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/excpt.nim(334) _ZN6system18rawWriteStackTraceE3varI6stringE
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/stacktraces.nim(59) _ZN11stacktraces30auxWriteStackTraceWithOverrideE3varI6stringE
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/home/deme/repos/nimbus-eth1/vendor/nim-eth/build/all_tests'
stack trace: (most recent call last)
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(427, 18)
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth.nimble(68, 3) testTask
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth.nimble(44, 3) run
/home/deme/repos/nimbus-eth1/vendor/nim-eth/eth.nimble(39, 3) build
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(264, 7) exec
/home/deme/repos/nimbus-eth1/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(264, 7) Error: unhandled exception: FAILED: nim c  --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --nimcache:build/nimcache -f -d:chronicles_log_level=TRACE --threads:on -d:release  --mm:orc -r --outdir:build/ tests/all_tests [OSError]

@tersec
Copy link
Copy Markdown
Contributor

tersec commented Nov 27, 2025

I tried nim c --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --nimcache:build/nimcache -f -d:chronicles_log_level=TRACE --threads:on -d:release --mm:orc -r --outdir:build/ tests/all_tests on Nim v2.2.4, v2.2.6, version-2-2 (800384176e8b2cf51c77f14b70f2916d764c8c0d), and devel (66560840043d2ea8a96b4ce46ab55f0faed37349) without any local errors.

gcc version is

gcc (Debian 15.2.0-9) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@kdeme
Copy link
Copy Markdown
Contributor Author

kdeme commented Nov 28, 2025

I tried nim c --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --nimcache:build/nimcache -f -d:chronicles_log_level=TRACE --threads:on -d:release --mm:orc -r --outdir:build/ tests/all_tests on Nim v2.2.4, v2.2.6, version-2-2 (800384176e8b2cf51c77f14b70f2916d764c8c0d), and devel (66560840043d2ea8a96b4ce46ab55f0faed37349) without any local errors.

I tried the same for a standalone nim-eth repo and there was no crash either on my machine.

I hit the crash originally by running the tests from inside a nimbus-eth1/vendor/nim-eth with ../../env.sh nim c ....

This means either used vendor modules differences or nim configs should be causing this difference in behaviour.

I did not see an immediate suspect on the vendor modules, so I played around with the nimbus-eth1 config.nims (https://github.com/status-im/nimbus-eth1/blob/master/config.nims#L222) and so far it seems the crash does not occur when I change put("secp256k1.always", "-fno-lto -fomit-frame-pointer") to put("secp256k1.always", "-fomit-frame-pointer") .

Note that this put is done twice in that config file so one needs to be removed or overwritten. I'll remove one of those in the nimbus-eth1 repo.

@tersec
Copy link
Copy Markdown
Contributor

tersec commented Nov 29, 2025

I tried nim c --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --nimcache:build/nimcache -f -d:chronicles_log_level=TRACE --threads:on -d:release --mm:orc -r --outdir:build/ tests/all_tests on Nim v2.2.4, v2.2.6, version-2-2 (800384176e8b2cf51c77f14b70f2916d764c8c0d), and devel (66560840043d2ea8a96b4ce46ab55f0faed37349) without any local errors.

I tried the same for a standalone nim-eth repo and there was no crash either on my machine.

I hit the crash originally by running the tests from inside a nimbus-eth1/vendor/nim-eth with ../../env.sh nim c ....

This means either used vendor modules differences or nim configs should be causing this difference in behaviour.

I did not see an immediate suspect on the vendor modules, so I played around with the nimbus-eth1 config.nims (https://github.com/status-im/nimbus-eth1/blob/master/config.nims#L222) and so far it seems the crash does not occur when I change put("secp256k1.always", "-fno-lto -fomit-frame-pointer") to put("secp256k1.always", "-fomit-frame-pointer") .

Note that this put is done twice in that config file so one needs to be removed or overwritten. I'll remove one of those in the nimbus-eth1 repo.

Can reproduce this now with Nim v2.2.4, v2.2.6, version-2-2 (800384176e8b2cf51c77f14b70f2916d764c8c0d), and devel (66560840043d2ea8a96b4ce46ab55f0faed37349), yes, using the exact command I provided but in nimbus-eth1/vendor/nim-eth with ../../env.sh.

@tersec
Copy link
Copy Markdown
Contributor

tersec commented Nov 30, 2025

Replace eth/enr/enr.nim with

import
  std/[net, sequtils],
  unittest2,
  ../common/keys,
  ../common/hashes,
  ../trie/[hexary, db, hexary_proof_verification]

discard PrivateKey.fromHex("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")

suite "MPT trie proof verification":
  test "Validate proof for existing value":
    block:
      var db = newMemoryDB()
      var trie = initHexaryTrie(db)

      const bytes = @[0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
      trie.put(bytes, bytes)

      for _ in [0]:
        let
          proof = @[@[248'u8, 67, 161, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] # trie.getBranch(bytes)
          root = Hash32([0x04'u8, 0xf4, 0xd4, 0x00, 0x43, 0x78, 0xc7, 0x62, 0xb2, 0xd8, 0xe0, 0x8f, 0x4b, 0x7c, 0xd6, 0xf2, 0xce, 0x43, 0x98, 0xb5, 0x7f, 0x3c, 0x62, 0xf4, 0x49, 0x0f, 0xc7, 0x3b, 0x7a, 0x0b, 0x2f, 0x4c]) # trie.rootHash()
          res = verifyMptProof(proof, root, bytes, bytes)

        doAssert res.isValid()
        check: res.value == bytes

    block:
      var db = newMemoryDB()
      var trie = initHexaryTrie(db)

      const bytes = @[0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
      trie.put(bytes, bytes)

      let
        nonExistingKey = toSeq([0'u8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2])
        proof = trie.getBranch(nonExistingKey)
        # proof = @[@[248'u8, 67, 161, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] # trie.getBranch(nonExistingKey)
        root = Hash32([0x04'u8, 0xf4, 0xd4, 0x00, 0x43, 0x78, 0xc7, 0x62, 0xb2, 0xd8, 0xe0, 0x8f, 0x4b, 0x7c, 0xd6, 0xf2, 0xce, 0x43, 0x98, 0xb5, 0x7f, 0x3c, 0x62, 0xf4, 0x49, 0x0f, 0xc7, 0x3b, 0x7a, 0x0b, 0x2f, 0x4c]) # trie.rootHash()
        res = verifyMptProof(proof, root, nonExistingKey, nonExistingKey)

      doAssert res.isMissing()

and config.nims with

switch("passL", "-Wno-stringop-overflow")
switch("passC", "-flto")
switch("passL", "-flto")
put("secp256k1.always", "-fno-lto")

And then

rm ~/.cache/nim/ -rf && ~/nim224/bin/nim c -f -d:release --verbosity:0 -r eth/enr/enr; ~/nim226/bin/nim c -f -d:release --verbosity:0 -r eth/enr/enr; ~/nim227/bin/nim c -f -d:release --verbosity:0 -r eth/enr/enr; ~/nim23/bin/nim c -f -d:release --verbosity:0 -r eth/enr/enr

results in

lto-wrapper: warning: using serial compilation of 5 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
MPT trie proof verification SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault
Error: execution of an external program failed: '/home/user/nim-eth/eth/enr/enr'
lto-wrapper: warning: using serial compilation of 5 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
MPT trie proof verification SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault
Error: execution of an external program failed: '/home/user/nim-eth/eth/enr/enr'
lto-wrapper: warning: using serial compilation of 5 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
MPT trie proof verification SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault
Error: execution of an external program failed: '/home/user/nim-eth/eth/enr/enr'
lto-wrapper: warning: using serial compilation of 5 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
MPT trie proof verification SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault
Error: execution of an external program failed: '/home/user/nim-eth/eth/enr/enr'

Using

gcc (Debian 15.2.0-9) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

with any of

Nim Compiler Version 2.2.4 [Linux: amd64]
Compiled at 2025-11-29
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: f7145dd26efeeeb6eeae6fff649db244d81b212d
active boot switches: -d:release
Nim Compiler Version 2.2.6 [Linux: amd64]
Compiled at 2025-11-29
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: ab00c56904e3126ad826bb520d243513a139436a
active boot switches: -d:release
Nim Compiler Version 2.2.7 [Linux: amd64]
Compiled at 2025-11-29
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 800384176e8b2cf51c77f14b70f2916d764c8c0d
active boot switches: -d:release
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-11-29
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 66560840043d2ea8a96b4ce46ab55f0faed37349
active boot switches: -d:release

Running valgrind results in

$ valgrind --track-origins=yes /tmp/enr 
==98071== Memcheck, a memory error detector
==98071== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==98071== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info
==98071== Command: /tmp/enr
==98071== 
MPT trie proof verification ==98071== Conditional jump or move depends on uninitialised value(s)
==98071==    at 0x401FBB3: eqdestroy___system_u3679 (in /tmp/enr)
==98071==    by 0x4049DB4: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071==    by 0x404C94B: runTestX60gensym22___enr_u243 (in /tmp/enr)
==98071==    by 0x4003A0F: main (in /tmp/enr)
==98071==  Uninitialised value was created by a stack allocation
==98071==    at 0x4048F41: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071== 
==98071== Use of uninitialised value of size 8
==98071==    at 0x401FBB5: eqdestroy___system_u3679 (in /tmp/enr)
==98071==    by 0x4049DB4: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071==    by 0x404C94B: runTestX60gensym22___enr_u243 (in /tmp/enr)
==98071==    by 0x4003A0F: main (in /tmp/enr)
==98071==  Uninitialised value was created by a stack allocation
==98071==    at 0x4048F41: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071== 
==98071== Invalid read of size 1
==98071==    at 0x401FBB5: eqdestroy___system_u3679 (in /tmp/enr)
==98071==    by 0x4049DB4: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071==    by 0x404C94B: runTestX60gensym22___enr_u243 (in /tmp/enr)
==98071==    by 0x4003A0F: main (in /tmp/enr)
==98071==  Address 0x6d is not stack'd, malloc'd or (recently) free'd
==98071== 
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
==98071== 
==98071== Process terminating with default action of signal 11 (SIGSEGV)
==98071==    at 0x4A6595C: __pthread_kill_implementation (pthread_kill.c:44)
==98071==    by 0x4A10CC1: raise (raise.c:26)
==98071==    by 0x4A10DEF: ??? (in /usr/lib/x86_64-linux-gnu/libc.so.6)
==98071==    by 0x401FBB4: eqdestroy___system_u3679 (in /tmp/enr)
==98071==    by 0x4049DB4: verifyProof__OOZtrieZhexary95proof95verification_u807 (in /tmp/enr)
==98071==    by 0x404C94B: runTestX60gensym22___enr_u243 (in /tmp/enr)
==98071==    by 0x4003A0F: main (in /tmp/enr)
==98071== 
==98071== HEAP SUMMARY:
==98071==     in use at exit: 1,024 bytes in 1 blocks
==98071==   total heap usage: 1 allocs, 0 frees, 1,024 bytes allocated
==98071== 
==98071== LEAK SUMMARY:
==98071==    definitely lost: 0 bytes in 0 blocks
==98071==    indirectly lost: 0 bytes in 0 blocks
==98071==      possibly lost: 0 bytes in 0 blocks
==98071==    still reachable: 1,024 bytes in 1 blocks
==98071==         suppressed: 0 bytes in 0 blocks
==98071== Rerun with --leak-check=full to see details of leaked memory
==98071== 
==98071== For lists of detected and suppressed errors, rerun with: -s
==98071== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
Segmentation fault         valgrind --track-origins=yes /tmp/enr

It looks almost exactly like:

and I'd note that secp256k1 is the exact same library I had to keep no-lto to keep those repros working too, until it got reduced/minimized away.

I've already with mixed success tracked this one down to somewhere between 1-2k lines of C code.

One difference with this one is that this one doesn't seem to depend on -finline-limit=1000, so it might be a variation worth pursuing. The rest is the same, structually: a mix of LTO/non-LTO, gcc but not clang, and that pattern of valgrind output where the first issue visible is the Conditional jump or move depends on uninitialised value(s) in an eqdestroy function. Interpreting this is more subtle than it might first appear due to the inlining in -O3 -flto, though.

@tersec
Copy link
Copy Markdown
Contributor

tersec commented Nov 30, 2025

@arnetheduck
Copy link
Copy Markdown
Member

with --debugger:native, for nicer valgrind print nicer stack traces:

MPT trie proof verification ==2305286== Conditional jump or move depends on uninitialised value(s)
==2305286==    at 0x4197B3: system::eqdestroy_(seq<uInt8>) (fatal.nim:53)
==2305286==    by 0x43ECBC: _ZN3rlp10eqdestroy_E3varIN3rlp3RlpEE (rlp.nim:177)
==2305286==    by 0x43ECBC: _ZN25hexary_proof_verification11getNextNodeEN3rlp3RlpEN7nibbles10NibblesBufE (rlp.nim:177)
==2305286==    by 0x43ECBC: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:176)
==2305286==    by 0x441005: _ZN25hexary_proof_verification14verifyMptProofE3seqI3seqI5uInt8EEN6hashes6Hash32E9openArrayI5uInt8E9openArrayI5uInt8E (hexary_proof_verification.nim:219)
==2305286==    by 0x441005: keys::runTestX60gensym60_(string, string) (keys.nim:495)
==2305286==    by 0x4394AE: _ZN4keys9runDirectEN4keys4TestE (keys.nim:404)
==2305286==    by 0x4394AE: NimMainModule (keys.nim:464)
==2305286==    by 0x400604: NimMainInner (keys.nim:140)
==2305286==    by 0x400604: NimMain (keys.nim:151)
==2305286==    by 0x400604: main (keys.nim:159)
==2305286==  Uninitialised value was created by a stack allocation
==2305286==    at 0x43DE9E: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:163)
==2305286== 
==2305286== Use of uninitialised value of size 8
==2305286==    at 0x4197B5: system::eqdestroy_(seq<uInt8>) (fatal.nim:53)
==2305286==    by 0x43ECBC: _ZN3rlp10eqdestroy_E3varIN3rlp3RlpEE (rlp.nim:177)
==2305286==    by 0x43ECBC: _ZN25hexary_proof_verification11getNextNodeEN3rlp3RlpEN7nibbles10NibblesBufE (rlp.nim:177)
==2305286==    by 0x43ECBC: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:176)
==2305286==    by 0x441005: _ZN25hexary_proof_verification14verifyMptProofE3seqI3seqI5uInt8EEN6hashes6Hash32E9openArrayI5uInt8E9openArrayI5uInt8E (hexary_proof_verification.nim:219)
==2305286==    by 0x441005: keys::runTestX60gensym60_(string, string) (keys.nim:495)
==2305286==    by 0x4394AE: _ZN4keys9runDirectEN4keys4TestE (keys.nim:404)
==2305286==    by 0x4394AE: NimMainModule (keys.nim:464)
==2305286==    by 0x400604: NimMainInner (keys.nim:140)
==2305286==    by 0x400604: NimMain (keys.nim:151)
==2305286==    by 0x400604: main (keys.nim:159)
==2305286==  Uninitialised value was created by a stack allocation
==2305286==    at 0x43DE9E: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:163)
==2305286== 
==2305286== Conditional jump or move depends on uninitialised value(s)
==2305286==    at 0x4842DF6: free (vg_replace_malloc.c:990)
==2305286==    by 0x43ECBC: _ZN3rlp10eqdestroy_E3varIN3rlp3RlpEE (rlp.nim:177)
==2305286==    by 0x43ECBC: _ZN25hexary_proof_verification11getNextNodeEN3rlp3RlpEN7nibbles10NibblesBufE (rlp.nim:177)
==2305286==    by 0x43ECBC: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:176)
==2305286==    by 0x441005: _ZN25hexary_proof_verification14verifyMptProofE3seqI3seqI5uInt8EEN6hashes6Hash32E9openArrayI5uInt8E9openArrayI5uInt8E (hexary_proof_verification.nim:219)
==2305286==    by 0x441005: keys::runTestX60gensym60_(string, string) (keys.nim:495)
==2305286==    by 0x4394AE: _ZN4keys9runDirectEN4keys4TestE (keys.nim:404)
==2305286==    by 0x4394AE: NimMainModule (keys.nim:464)
==2305286==    by 0x400604: NimMainInner (keys.nim:140)
==2305286==    by 0x400604: NimMain (keys.nim:151)
==2305286==    by 0x400604: main (keys.nim:159)
==2305286==  Uninitialised value was created by a stack allocation
==2305286==    at 0x43DE9E: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:163)
==2305286== 
==2305286== Invalid free() / delete / delete[] / realloc()
==2305286==    at 0x4842E43: free (vg_replace_malloc.c:990)
==2305286==    by 0x43ECBC: _ZN3rlp10eqdestroy_E3varIN3rlp3RlpEE (rlp.nim:177)
==2305286==    by 0x43ECBC: _ZN25hexary_proof_verification11getNextNodeEN3rlp3RlpEN7nibbles10NibblesBufE (rlp.nim:177)
==2305286==    by 0x43ECBC: hexary_proof_verification::verifyProof(ref<db::TrieDatabaseRefcolonObjectType_>, hashes::Hash32, openArray<uInt8>) (hexary_proof_verification.nim:176)
==2305286==    by 0x441005: _ZN25hexary_proof_verification14verifyMptProofE3seqI3seqI5uInt8EEN6hashes6Hash32E9openArrayI5uInt8E9openArrayI5uInt8E (hexary_proof_verification.nim:219)
==2305286==    by 0x441005: keys::runTestX60gensym60_(string, string) (keys.nim:495)
==2305286==    by 0x4394AE: _ZN4keys9runDirectEN4keys4TestE (keys.nim:404)
==2305286==    by 0x4394AE: NimMainModule (keys.nim:464)
==2305286==    by 0x400604: NimMainInner (keys.nim:140)
==2305286==    by 0x400604: NimMain (keys.nim:151)
==2305286==    by 0x400604: main (keys.nim:159)
==2305286==  Address 0x54cba8 is 8 bytes inside data symbol "TM__M68nGWgBGfdRpIiz8SqAwg_88"

@arnetheduck
Copy link
Copy Markdown
Member

@arnetheduck
Copy link
Copy Markdown
Member

-O2 seems to help with this one

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

Successfully merging this pull request may close these issues.

3 participants