Skip to content

Rebased cmake-staging branch (post PRs 33, 37) - #38

Closed
hebasto wants to merge 38 commits into
masterfrom
231024-linear
Closed

hebasto wants to merge 38 commits into
masterfrom
231024-linear

Conversation

@hebasto

@hebasto hebasto commented Oct 24, 2023 •

Copy link
Copy Markdown
Owner

This is the cmake-staging branch rebased on the recent bitcoin/master one with the squashed "!fixup" commits.

Testing instructions are the same as for #31:


A note for reviewers:

First, the git rebase -i --autosquash master command was applied:
cmake-staging/pr38-init -- > cmake-staging/pr38-autosquash

Then, the recent changes in the build system in the master branch were applied:
cmake-staging/pr38-autosquash --> this PR branch

hebasto and others added 30 commits October 24, 2023 20:55
Co-authored-by: Cory Fields <[email protected]>
Co-authored-by: Vasil Dimov <[email protected]>
To configure CMake for cross-compiling, use
`--toolchain depends/${HOST}/share/toolchain.cmake` command-line option.
@hebasto

hebasto commented Oct 24, 2023

Copy link
Copy Markdown
Owner Author

Many thanks to @TheCharlatan who suggested to leverage the "fixup/autosquash" git functionality!

@hebasto

hebasto commented Oct 24, 2023

Copy link
Copy Markdown
Owner Author

Friendly ping @fanquake @theuni @TheCharlatan @luke-jr @willcl-ark @stickies-v @ajtowns @w0xlt @pablomartin4btc @vasild

The plan is to continue the work on #32 on top of this updated staging branch.

@theuni

theuni commented Oct 25, 2023

Copy link
Copy Markdown

For whatever reason, I had to move the "fixup! cmake: Add position independent code support" down to after the "add bitcoind" commit in order for the rebase to work. Maybe some config option difference for handling merge order or something?

After that, following along, the diff from this PR to what I generated with my rebase:

 $ git diff HEAD..hebasto/231024-linear
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a5e9dcc66..10b484bebd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@
 cmake_minimum_required(VERSION 3.16...3.28)

 project("Bitcoin Core"
-  VERSION 25.99.0
+  VERSION 26.99.0
   DESCRIPTION "Bitcoin client software"
   HOMEPAGE_URL "https://bitcoincore.org/"
   LANGUAGES CXX ASM
@@ -232,7 +232,7 @@ endif()

 include(cmake/optional.cmake)

-find_package(Python3 3.8 COMPONENTS Interpreter)
+find_package(Python3 3.9 COMPONENTS Interpreter)
 set(PYTHON_COMMAND ${Python3_EXECUTABLE})

 add_subdirectory(src)
diff --git a/src/bench/CMakeLists.txt b/src/bench/CMakeLists.txt
index feec7290b1..3e9b144c77 100644
--- a/src/bench/CMakeLists.txt
+++ b/src/bench/CMakeLists.txt
@@ -23,6 +23,7 @@ add_executable(bench_bitcoin
   checkqueue.cpp
   crypto_hash.cpp
   descriptors.cpp
+  disconnected_transactions.cpp
   duplicate_inputs.cpp
   ellswift.cpp
   examples.cpp

The version bump is obvious.
The python bump is from: bitcoin#28211
The additional cpp is from: bitcoin#28385

@theuni

theuni commented Oct 25, 2023

Copy link
Copy Markdown

-fstack-reuse=none is the other thing that I can think of that would need to be addressed in a recent buildsystem rebase, but those options come in #32.

LGTM. I'm curious if other reviewers have the same issue reproducing the rebase?

@vasild

vasild commented Oct 26, 2023

Copy link
Copy Markdown

LGTM

I got the same experience as in #38 (comment) and produced the same diff.

The change from commit 1246971 fixup! cmake: Add position independent code support is properly squashed in fc85336 cmake: Add position independent code support in this PR (branch 231024-linear), not like in my local rebase where I moved it into 6bf981a cmake: Build bitcoind executable to avoid a conflict.

@hebasto

hebasto commented Oct 26, 2023

Copy link
Copy Markdown
Owner Author

@theuni @vasild

Thank you for the reviewing!

This branch has been force pushed into the https://github.com/hebasto/bitcoin/tree/cmake-staging.

Closing.

@hebasto hebasto closed this Oct 26, 2023
hebasto pushed a commit that referenced this pull request Jul 22, 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
      #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.

3 participants