-
Type:
Technical Debt
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Configuration
-
None
-
Storage Engines, Storage Engines - Foundations
-
None
-
None
We encountered a bug in the FLCS deprecation work where I forgot to initialize my WT_CONFIG_ITEM prior to passing it to __wt_config_getones. This resulted in a surprisingly rare segfault which was harder to debug than expected. Part of what enabled the segfault was that the calling code wrapped the config call in WT_RET_NOTFOUND_OKAY.
Using WT_RET_NOTFOUND_OKAY in combination with an uninitialized WT_CONFIG_ITEM is likely required to see any negative consequences, or undefined behaviour as a result.
But a brief glance around the codebase suggests numerous locations where an uninitialized WT_CONFIG_ITEM is passed into the config API, and at least once occurrence where it is done in combination with WT_RET_NOTFOUND_OKAY (__wt_session_get_btree_ckpt).
Scope:
- Review WT_CONFIG_ITEM usages.
- Add necesssary initialization.
- Consider ways to prevent this in a future? Perhaps a macro to use WT_CONFIG_ITEM. Similar to WT_DECL_ITEM.
- is related to
-
WT-16164
Review usages of __wt_config_merge to ensure they correctly pass a not sparse array.
-
- Backlog
-