Skip to content

type-map: Work around LLVM 22 "out of bounds index" error#247

Merged
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/lindex
Mar 9, 2026
Merged

type-map: Work around LLVM 22 "out of bounds index" error#247
ryanofsky merged 1 commit intobitcoin-core:masterfrom
ryanofsky:pr/lindex

Conversation

@ryanofsky
Copy link
Collaborator

This workaround is needed to fix "parameter pack may not be accessed at an out of bounds index" compile errors in
bitcoin/bitcoin#29409 due in sanitizer jobs due to bitcoin/bitcoin#34660 which updates sanitizers to use LLVM 22 instead of LLVM 21:

https://github.com/bitcoin/bitcoin/actions/runs/22501264518/job/65188721708?pr=29409 https://github.com/bitcoin/bitcoin/actions/runs/22501264518/job/65188721733?pr=29409

/cxx_build/include/c++/v1/__fwd/tuple.h:40:52: error: a parameter pack may not be accessed at an out of bounds index
   40 |   using type _LIBCPP_NODEBUG = __type_pack_element<_Ip, _Tp...>;
      |                                                    ^
/cxx_build/include/c++/v1/__utility/try_key_extraction.h:82:67: note: in instantiation of template class 'std::tuple_element<0, std::tuple<>>' requested here
   82 |                             is_same<__remove_const_ref_t<typename tuple_element<0, _Tuple1>::type>, _KeyT>::value,
      |                                                                   ^

The upstream LLVM bug is llvm/llvm-project#167709 and fix is llvm/llvm-project#183614

This workaround is needed to fix "parameter pack may not be accessed at an out
of bounds index" compile errors in
bitcoin/bitcoin#29409 due in sanitizer jobs due to
bitcoin/bitcoin#34660 which updates sanitizers to use
LLVM 22 instead of LLVM 21:

https://github.com/bitcoin/bitcoin/actions/runs/22501264518/job/65188721708?pr=29409
https://github.com/bitcoin/bitcoin/actions/runs/22501264518/job/65188721733?pr=29409

```c++
/cxx_build/include/c++/v1/__fwd/tuple.h:40:52: error: a parameter pack may not be accessed at an out of bounds index
   40 |   using type _LIBCPP_NODEBUG = __type_pack_element<_Ip, _Tp...>;
      |                                                    ^
/cxx_build/include/c++/v1/__utility/try_key_extraction.h:82:67: note: in instantiation of template class 'std::tuple_element<0, std::tuple<>>' requested here
   82 |                             is_same<__remove_const_ref_t<typename tuple_element<0, _Tuple1>::type>, _KeyT>::value,
      |                                                                   ^
```

The upstream LLVM bug is llvm/llvm-project#167709 and
fix is llvm/llvm-project#183614
@DrahtBot
Copy link

DrahtBot commented Mar 1, 2026

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK f61af48, I have reviewed the code and it looks OK.

@ryanofsky ryanofsky merged commit 22bec91 into bitcoin-core:master Mar 9, 2026
10 checks passed
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Mar 11, 2026
…86d5

789ac8c86d5 test: m_on_cancel called after request finishes
5aa8c36cdd3 test: getParams() called after request cancel
7f954aa5eac race fix: m_on_cancel called after request finishes (bitcoin#34782)
88b4d85099d race fix: getParams() called after request cancel (bitcoin#34777)
4fa90c68015 race fix: worker thread destroyed before it is initialized (bitcoin#34711, bitcoin#34756)
22bec918c97 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error
8a5e3ae6ed2 Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
e8d35246918 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9
97d877053b6 proxy-types: add CustomHasField hook for nullable decode paths
8c2f10252c9 refactor: add missing includes to mp/type-data.h
b1638aceb40 doc: Bump version 8 > 9
f61af487217 type-map: Work around LLVM 22 "out of bounds index" error

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 789ac8c86d5532438351e06296e7139565ba60d7
Sjors added a commit to Sjors/bitcoin that referenced this pull request Mar 11, 2026
22bec918c9 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error
8a5e3ae6ed Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
e8d3524691 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9
97d877053b proxy-types: add CustomHasField hook for nullable decode paths
8c2f10252c refactor: add missing includes to mp/type-data.h
b1638aceb4 doc: Bump version 8 > 9
f61af48721 type-map: Work around LLVM 22 "out of bounds index" error

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 22bec918c97d32660c4694c3a8b5af4cdbb88481
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Mar 12, 2026
…5174

3f28bca5174 test: worker thread destroyed before it is initialized
789ac8c86d5 test: m_on_cancel called after request finishes
5aa8c36cdd3 test: getParams() called after request cancel
7f954aa5eac race fix: m_on_cancel called after request finishes (bitcoin#34782)
88b4d85099d race fix: getParams() called after request cancel (bitcoin#34777)
4fa90c68015 race fix: worker thread destroyed before it is initialized (bitcoin#34711, bitcoin#34756)
22bec918c97 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error
8a5e3ae6ed2 Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
e8d35246918 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9
97d877053b6 proxy-types: add CustomHasField hook for nullable decode paths
8c2f10252c9 refactor: add missing includes to mp/type-data.h
b1638aceb40 doc: Bump version 8 > 9
f61af487217 type-map: Work around LLVM 22 "out of bounds index" error

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 3f28bca5174f2a231b7fff6772411f8689f3d7e7
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Mar 12, 2026
…cca9

2fb97e8cca9 race fix: m_on_cancel called after request finishes
846a43aafb4 test: m_on_cancel called after request finishes
e69b6bf3f4e race fix: getParams() called after request cancel
75c5425173f test: getParams() called after request cancel
f09731e242f race fix: worker thread destroyed before it is initialized
88cacd4239f test: worker thread destroyed before it is initialized
22bec918c97 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error
8a5e3ae6ed2 Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values
e8d35246918 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9
97d877053b6 proxy-types: add CustomHasField hook for nullable decode paths
8c2f10252c9 refactor: add missing includes to mp/type-data.h
b1638aceb40 doc: Bump version 8 > 9
f61af487217 type-map: Work around LLVM 22 "out of bounds index" error

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 2fb97e8cca9feb1df70cf29b2a9895bea2c4c49c
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