Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Mar 1, 2024

Should fix the GCC compilation portion of #29517 (comment).

See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 1, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK TheCharlatan
Concept ACK theuni
Ignored review m3dwards

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@m3dwards
Copy link
Contributor

m3dwards commented Mar 4, 2024

ACK a07206a

As it seems fopencookie is only available for glibc on linux it makes sense to add the __linux__ macro definition check.

Something we could look into another time is also using funopen function which is roughly comparable to fopencookie but works on BSD variants including MacOS.

Tested using FUZZ=buffered_file src/test/fuzz/fuzz on Debian 12 x86.

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not sure I'd trust the gnulib docs on this one. If nothing else, it seems to be supported on freebsd as well.. So I'd say either:

  • gnusource && (linux || freebsd)
  • gnusource && (!android && !openbsd)

@fanquake fanquake force-pushed the no_fopencookie_on_openbsd branch from a07206a to 68ae33d Compare March 5, 2024 16:26
@fanquake
Copy link
Member Author

fanquake commented Mar 5, 2024

So I'd say either:

I wanted to avoid having to pull this out into configure. So happy to just go with linux || freebsd. Sent up patch upstream that may get the gnulib docs fixed: https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00038.html.

@fanquake fanquake force-pushed the no_fopencookie_on_openbsd branch from 68ae33d to a663ff9 Compare March 5, 2024 16:50
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 5, 2024

🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.

Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.

Leave a comment here, if you need help tracking down a confusing failure.

Debug: https://github.com/bitcoin/bitcoin/runs/22304421122

@theuni
Copy link
Member

theuni commented Mar 5, 2024

So I'd say either:

I wanted to avoid having to pull this out into configure. So happy to just go with linux || freebsd. Sent up patch upstream that may get the gnulib docs fixed: https://lists.gnu.org/archive/html/bug-gnulib/2024-03/msg00038.html.

Nice work! This has been accepted upstream.

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK after re-adding the accidentally dropped line.

Should fix the GCC compilation portion of bitcoin#29517:
bitcoin#29517 (comment).

See also:
https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html
but note that FreeBSD has supported this function since 11.x.
@fanquake fanquake force-pushed the no_fopencookie_on_openbsd branch from a663ff9 to 312f338 Compare March 5, 2024 21:18
@DrahtBot DrahtBot removed the CI failed label Mar 5, 2024
@fanquake fanquake changed the title fuzz: restrict fopencookie usage to __linux__ fuzz: restrict fopencookie usage to LInux & FreeBSD Mar 6, 2024
@fanquake fanquake changed the title fuzz: restrict fopencookie usage to LInux & FreeBSD fuzz: restrict fopencookie usage to Linux & FreeBSD Mar 6, 2024
@m3dwards
Copy link
Contributor

m3dwards commented Mar 6, 2024

I'm struggling to replicate the issue on OpenBSD as yes fopencookie is not available in their version of libc but _GNU_SOURCE also isn't defined.

One caveat is that I wasn't able to try OpenBSD on power pc and instead ran it on x86.

ACK 312f338

As this shouldn't cause harm and someone managed to hit the problem.

Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 312f338

@DrahtBot DrahtBot requested a review from theuni March 6, 2024 12:04
@fanquake fanquake merged commit 6c77dbf into bitcoin:master Mar 6, 2024
@fanquake fanquake deleted the no_fopencookie_on_openbsd branch March 6, 2024 12:44
glozow pushed a commit to glozow/bitcoin that referenced this pull request Mar 7, 2024
Should fix the GCC compilation portion of bitcoin#29517:
bitcoin#29517 (comment).

See also:
https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html
but note that FreeBSD has supported this function since 11.x.

Github-Pull: bitcoin#29529
Rebased-From: 312f338
glozow added a commit that referenced this pull request Mar 11, 2024
c68d4d0 [doc] update manual pages for v26.1rc2 (glozow)
bd715bf [build] bump version to v26.1rc2 (glozow)
b6d006d update release notes 26.1 (glozow)
fce992b fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)
40c56a4 test: make sure keypool sizes do not change on `getrawchangeaddress`/`getnewaddress` failures (UdjinM6)
7c82b27 wallet: Avoid updating `ReserveDestination::nIndex` when `GetReservedDestination` fails (UdjinM6)
b5419ce p2p: Don't consider blocks mutated if they don't connect to known prev block (Greg Sanders)
0535c25 [test] IsBlockMutated unit tests (dergoegge)
8141498 [validation] Cache merkle root and witness commitment checks (dergoegge)
0c5c596 [test] Add regression test for #27608 (dergoegge)
2473635 [net processing] Don't process mutated blocks (dergoegge)
50c0b61 [validation] Merkle root malleation should be caught by IsBlockMutated (dergoegge)
aff368f [validation] Introduce IsBlockMutated (dergoegge)
076c67c [refactor] Cleanup merkle root checks (dergoegge)
97a1d0a [validation] Isolate merkle root checks (dergoegge)
4ac0eb5 test: Drop `x` modifier in `fsbridge::fopen` call for mingw builds (Hennadii Stepanov)

Pull request description:

  Includes:
  - #29357
  - #29412
  - #29524
  - #29510
  - #29529

  Also does:
  - update to release notes
  - bump to rc2
  - manpages
  - (no changes to bitcoin.conf)

ACKs for top commit:
  achow101:
    ACK c68d4d0

Tree-SHA512: 2f8c3dd705e3f9f33403b3cc17e8006510ff827d7dbd609b09732a1669964e9b001cfecdc63d8d8daeb8f39c652e1e4ad0aac873d44d259c21803de85688ed2b
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
312f338 fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)

Pull request description:

  Should fix the GCC compilation portion of bitcoin#29517 (comment).

  See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

ACKs for top commit:
  m3dwards:
    ACK bitcoin@312f338
  TheCharlatan:
    utACK 312f338

Tree-SHA512: aa8ff20c3fa735415d05a93b8855877035c300f4d2dfd82f65fd9ed5b5c96ab619b4d84eef114ed0013dc5ff0800cb628ed3801e1efde0cfb0d426930d1673d5
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
312f338 fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)

Pull request description:

  Should fix the GCC compilation portion of bitcoin#29517 (comment).

  See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

ACKs for top commit:
  m3dwards:
    ACK bitcoin@312f338
  TheCharlatan:
    utACK 312f338

Tree-SHA512: aa8ff20c3fa735415d05a93b8855877035c300f4d2dfd82f65fd9ed5b5c96ab619b4d84eef114ed0013dc5ff0800cb628ed3801e1efde0cfb0d426930d1673d5
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 24, 2024
312f338 fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)

Pull request description:

  Should fix the GCC compilation portion of bitcoin#29517 (comment).

  See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

ACKs for top commit:
  m3dwards:
    ACK bitcoin@312f338
  TheCharlatan:
    utACK 312f338

Tree-SHA512: aa8ff20c3fa735415d05a93b8855877035c300f4d2dfd82f65fd9ed5b5c96ab619b4d84eef114ed0013dc5ff0800cb628ed3801e1efde0cfb0d426930d1673d5
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Oct 24, 2024
b70e091 Merge bitcoin#29667: fuzz: actually test garbage >64b in p2p transport test (fanquake)
6d7aa3d Merge bitcoin#29497: test: simplify test_runner.py (fanquake)
d0e15d5 Merge bitcoin#29606: refactor: Reserve memory for ToLower/ToUpper conversions (Ava Chow)
045fa5f Merge bitcoin#29514: tests: Provide more helpful assert_equal errors (Ava Chow)
bd607f0 Merge bitcoin#29393: i2p: log connection was refused due to arbitrary port (Ava Chow)
c961755 Merge bitcoin#29595: doc: Wrap flags with code in developer-notes.md (fanquake)
8d6e5e7 Merge bitcoin#29583: fuzz: Apply fuzz env (suppressions, etc.) when fetching harness list (fanquake)
4dce690 Merge bitcoin#29576: Update functional test runner to return error code when no tests are found to run (fanquake)
910a7d6 Merge bitcoin#29529: fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)
fdac2b3 Merge bitcoin#29493: subtree: update crc32c subtree (fanquake)
a23b342 Merge bitcoin#29475: doc: Fix Broken Links (fanquake)
92bad90 Merge bitcoin#28178: fuzz: Generate with random libFuzzer settings (fanquake)
9b6a05d Merge bitcoin#29443: depends: fix BDB compilation on OpenBSD (fanquake)
9963e6b Merge bitcoin#29413: fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (fanquake)
3914745 Merge bitcoin#29425: test: fix intermittent failure in wallet_reorgrestore.py (fanquake)
b719883 Merge bitcoin#29399: test: Fix utxo set hash serialisation signedness (fanquake)
f096880 Merge bitcoin#29377: test: Add makefile target for running unit tests (Ava Chow)
03e0bd3 Merge bitcoin#27319: addrman, refactor: improve stochastic test in `AddSingle` (Ava Chow)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK b70e091
  knst:
    utACK b70e091

Tree-SHA512: 659a931f812c8a92cf3854abb873d92885219a392d6aa8e49ac4b27fe41e8e163ef9a135050e7c2e1bd33cecd2f7dae215e05a9c29f62e837e0057d3c16746d6
@bitcoin bitcoin locked and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants