z-classic / zclassic

Zclassic is financial freedom. ZK-SNARKs, and no founder's fee.
https://www.reddit.com/r/Zclassic/
Other
189 stars 81 forks source link

test_bitcoin fails doing ./qa/zcash/check-security-hardening.sh with 1.0.1, 1.0.2, and 1.0.3 #28

Closed WaveringAna closed 7 years ago

WaveringAna commented 7 years ago

Error message:


Running 197 test cases...
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(291): error: in "Alert_tests/AlertApplies": check alert.CheckSignature(alertKey) has failed
test/alert_tests.cpp(297): error: in "Alert_tests/AlertApplies": check alerts[0].AppliesTo(1, "") has failed
test/alert_tests.cpp(298): error: in "Alert_tests/AlertApplies": check alerts[0].AppliesTo(999001, "") has failed
test/alert_tests.cpp(299): error: in "Alert_tests/AlertApplies": check alerts[0].AppliesTo(1, "/MagicBean:11.11.11/") has failed
test/alert_tests.cpp(301): error: in "Alert_tests/AlertApplies": check alerts[1].AppliesTo(1, "/MagicBean:0.1.0/") has failed
test/alert_tests.cpp(302): error: in "Alert_tests/AlertApplies": check alerts[1].AppliesTo(999001, "/MagicBean:0.1.0/") has failed
test/alert_tests.cpp(304): error: in "Alert_tests/AlertApplies": check alerts[2].AppliesTo(1, "/MagicBean:0.1.0/") has failed
test/alert_tests.cpp(305): error: in "Alert_tests/AlertApplies": check alerts[2].AppliesTo(1, "/MagicBean:0.2.0/") has failed
test/alert_tests.cpp(339): error: in "Alert_tests/AlertNotify": check r.size() == 6u has failed [0 != 6]
unknown location(0): fatal error: in "Alert_tests/AlertNotify": memory access violation at address: 0x00000008: no mapping at fault address
test/alert_tests.cpp(345): last checkpoint

*** 19 failures are detected in the test module "Bitcoin Test Suite"
test_bitcoin: /home/aayanl/zcl1.0.3/depends/x86_64-unknown-linux-gnu/share/../include/boost/thread/pthread/condition_variable_fwd.hpp:102: boost::condition_variable::~condition_variable(): Assertion `!ret' failed.
FAIL test/test_bitcoin (exit status: 134)
hairetikos commented 7 years ago

What test did you invoke there? Seems like a memory error you have this time. We were seeing different errors before:

$ ./qa/zcash/full-test-suite.sh ... ../build-aux/test-driver: line 107: 6101 Aborted "$@" > $log_file 2>&1 FAIL: test/test_bitcoin

commented out line 107 of test-driver: ... PASS: test/test_bitcoin

but this is not the solution.

WaveringAna commented 7 years ago

@hairetikos I'm doing full-test-suite.sh. I tried with 6, 8, and 10 gigs of ram and it didn't solve the issue. Commenting out line 107 made the test pass, but as you said, it isn't the solution

hairetikos commented 7 years ago

@aayanl i realise now the more detailed log you pasted shows after leaving the test for some time after it has failed and "Aborted". Hopefully we can figure this out with the info

hairetikos commented 7 years ago

@mountaindrifter has found this gem, we think it may be very related as the first error which triggers the escalation is "CheckSignature(alertKey) has failed"

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-September/013104.html

and from alerts_test.cpp:

more finds from @mountaindrifter

o https://bitcoin.org/en/alert/2016-11-01-alert-retirement o https://github.com/zcash/zcash/issues/1195

hairetikos commented 7 years ago

me and @mountaindrifter have ironed out the issues to do with CheckSignature(alertKey), i have removed / edited a lot of code to do with the sendalert & key system (reference: https://github.com/bitcoin/bitcoin/pull/7692/files?diff=split)

https://bitcoin.org/en/alert/2016-11-01-alert-retirement

the bitcoin test fails Gracefully now due to a separate issue:

test/main_tests.cpp(62): error: in "main_tests/subsidy_limit_test": check nSum == 12500000000000ULL has failed [1250000000 != 12500000000000]

this is to do with the difference in slow start from zcash to zclassic -- it is an artifact not changed to match zclassic:

/ Mining slow start for (int nHeight = 0; nHeight < consensusParams.nSubsidySlowStartInterval; nHeight ++) { CAmount nSubsidy = GetBlockSubsidy(nHeight, consensusParams); BOOST_CHECK(nSubsidy <= 12.5 * COIN); nSum += nSubsidy; BOOST_CHECK(MoneyRange(nSum)); } BOOST_CHECK_EQUAL(nSum, 12500000000000ULL);

@heyrhett set slow start to 2 blocks:

https://github.com/z-classic/zclassic/blob/master/src/chainparams.cpp#L41

consensus.nSubsidySlowStartInterval = 2; (previously 20000)

we need to change the test to match the zclassic values.

opening a new issue regarding this, as it is something else unrelated to previous.

hairetikos commented 7 years ago

https://github.com/z-classic/zclassic/issues/29

WaveringAna commented 7 years ago

Has been fixed with 1.0.3