Skip to content

Cache hashes - #39

Closed
NicolasDorier wants to merge 28 commits into
sipa:segwitfrom
NicolasDorier:cache-signatures2
Closed

NicolasDorier wants to merge 28 commits into
sipa:segwitfrom
NicolasDorier:cache-signatures2

Conversation

@NicolasDorier

Copy link
Copy Markdown

No description provided.

@NicolasDorier

Copy link
Copy Markdown
Author

Moving #36

@sipa
sipa force-pushed the segwit branch 4 times, most recently from 7ae0189 to 82f323e Compare January 23, 2016 18:22
@sipa
sipa force-pushed the segwit branch 2 times, most recently from a660ed1 to 37973bf Compare January 27, 2016 17:22
morcos and others added 6 commits February 1, 2016 16:57
Includes fixup by Thomas Kerin.
…en verify_script receives VERIFY_WITNESS flag

script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set

Rename internal method + make it static

trim bitcoinconsensus_ prefix

Add SERIALIZE_TRANSACTION_WITNESS flag
Witness blocks can be greater than 2MiB, but cannot be validly greater
than 4MB.
@sipa
sipa force-pushed the segwit branch 2 times, most recently from 909fb25 to 99c8d54 Compare March 16, 2016 17:51
@sipa
sipa force-pushed the segwit branch 4 times, most recently from a88b686 to 38a8b36 Compare March 26, 2016 00:21
@sipa

sipa commented Mar 29, 2016

Copy link
Copy Markdown
Owner

As explained on IRC, this needs a more complicated approach that lets cache entries live longer than the CheckInputs call.

@sipa sipa closed this Mar 29, 2016
@NicolasDorier

Copy link
Copy Markdown
Author

I will do it when I manage to get my hand on jetbrain Clion and PyCharm licenses.

I'm concerned though that the test did not break, this should have triggered a segfault as I was accessing freed memory.

sipa pushed a commit that referenced this pull request Aug 6, 2026
…AFL fork

faada35 fuzz: [refactor] Use 100'000 digit separator in __AFL_LOOP (MarcoFalke)
fae067e fuzz: Avoid dangling prevoutfetch threads after AFL fork (MarcoFalke)

Pull request description:

  Presumably fixes https://issues.oss-fuzz.com/issues/536943806

  This is a bit confusing, because the issue was already fixed in commit f608a40, by removing the AFL forkserver.

  However, OSS-Fuzz doesn't go through the AFL_LOOP, but through the AFL libFuzzer driver:

  ```
            #0 0x7e055245baab in __pthread_clockjoin_ex /build/glibc-B3wQXB/glibc-2.31/nptl/pthread_join_common.c:89:6
      bitcoin#1 0x5a27e904dcdd in operator() /src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:293:14
      #2 0x5a27e904dcdd in Join<(lambda at /src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:292:44)> /src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.h:75:9
      #3 0x5a27e904dcdd in ___interceptor_pthread_join /src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:292:25
      #4 0x5a27e90f4044 in std::__1::thread::join()
      #5 0x5a27e9366277 in ThreadPool::Stop() [bitcoin-core/src/util/threadpool.h:146](https://github.com/bitcoin/bitcoin/blob/7d8137c1417b61589949b3e8b081e5310fe335f3/src/util/threadpool.h#L146):53
      #6 0x5a27e9365db9 in ThreadPool::~ThreadPool() [bitcoin-core/src/util/threadpool.h:94](https://github.com/bitcoin/bitcoin/blob/7d8137c1417b61589949b3e8b081e5310fe335f3/src/util/threadpool.h#L94):9
  ...
            #32 0x5a27e95a9506 in (anonymous namespace)::ResetChainman(TestingSetup&) (.12669) [bitcoin-core/src/test/fuzz/process_messages.cpp:44](https://github.com/bitcoin/bitcoin/blob/7d8137c1417b61589949b3e8b081e5310fe335f3/src/test/fuzz/process_messages.cpp#L44):27
      #33 0x5a27e95a8c60 in process_messages_fuzz_target(std::__1::span<unsigned char const, 18446744073709551615ul>) [bitcoin-core/src/test/fuzz/process_messages.cpp:141](https://github.com/bitcoin/bitcoin/blob/7d8137c1417b61589949b3e8b081e5310fe335f3/src/test/fuzz/process_messages.cpp#L141):9
  ...
              #36 0x5a27e97b7190 in test_one_input(std::__1::span<unsigned char const, 18446744073709551615ul>) bitcoin-core/src/test/fuzz/fuzz.cpp:86:5
              #37 0x5a27e97b7190 in LLVMFuzzerTestOneInput bitcoin-core/src/test/fuzz/fuzz.cpp:214:5
              #38 0x5a27e90ada19 in LLVMFuzzerRunDriver /src/aflplusplus/utils/aflpp_driver/aflpp_driver.c:427:13
              #39 0x5a27e90ad69b in main /src/aflplusplus/utils/aflpp_driver/aflpp_driver.c:323:10
              #40 0x7e055223b082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/libc-start.c:308:16
              #41 0x5a27e8fc602d in _start
  ```

  So the correct fix would be to set `AFL_DRIVER_DONT_DEFER=1`. Ref: https://github.com/AFLplusplus/AFLplusplus/blob/ad5304010ae3be9d5cdc1ba51b09e14169c5cb87/utils/aflpp_driver/aflpp_driver.c#L161

  However, I don't know how to do this on OSS-Fuzz, so just drop the threads for now, because there are dedicated fuzz targets to test the multi-threaded case anyway.

ACKs for top commit:
  l0rinc:
    ACK faada35
  andrewtoth:
    lgtm ACK faada35
  sedited:
    ACK faada35

Tree-SHA512: c249d7267f789084968f8510531f60fc71c9fbd6b4e574a181fd6da1af19a3cb7c03ba60c3ca70244b56ce44c602293517cdb6b0e969b4a2cc9d1afaa49ab0f8
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.

9 participants