Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Nov 10, 2025

Base the task on --preset=dev-mode to ensure maximal coverage and add the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON

Currently a draft to figure out #33824 (comment)

Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON
@maflcko
Copy link
Member Author

maflcko commented Nov 10, 2025

Continue from #33824 (comment):

I was thinking about permitting nullptr when size=0, or even just permitting nullptr for any size, when the data pointer is followed by a size?

Afaict our de-serialization can handle this case (nullptr when size=0) correctly, but fails when passed a nullptr with non-zero size. Maybe a null check in btck_block_create(...) would be better? What do you think?

Yes, either should be fine. To clarify I had two alternative suggestions:

  • Remove all non-null attributes for spans (data+size) and replace them with null checks when the size is one or larger.
  • Remove all non-null attributes for spans without replacement.

@maflcko
Copy link
Member Author

maflcko commented Nov 11, 2025

I was wondering if the std::span nullptr check was part of the C++26 library hardening, but it seems not (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html#span-constructors), so I guess if we want it, we'd still have to write it ourselves.

@maflcko
Copy link
Member Author

maflcko commented Nov 11, 2025

Thanks for picking this up! Looks like a simple and small change in your pull request.

@maflcko maflcko closed this Nov 11, 2025
fanquake added a commit that referenced this pull request Nov 12, 2025
a3ac59a ci: Enable experimental kernel stuff in ASan task (MarcoFalke)
5b89956 kernel: Allow null arguments for serialized data (TheCharlatan)

Pull request description:

  An empty span constructed from an empty vector may have a null data pointer depending on the implementation. Remove the BITCOINKERNEL_ARG_NONNULL requirement for these arguments and instead handle such null arguments in the implementation.

  Also cherry-picked from #33845 to show that CI task passing now.

ACKs for top commit:
  yuvicc:
    Code review ACK a3ac59a
  maflcko:
    review ACK a3ac59a 🥈
  laanwj:
    code review ACK a3ac59a

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

1 participant