Skip to content

Commit 208a6da

Browse files
committed
Record what the review left for later
Six items from the review that are not defects in the code as it stands: the gap left in the Mach-O cases, a sanitizer job, the double read during discovery, a bounded retry for a search directory that keeps failing, two ELF compatibility questions, and an explicit length for the embedded metadata.
1 parent 5d9e9ca commit 208a6da

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎docs/TODO.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# TODO
22

33
- Implement the extension-system layer after the API and lifecycle decisions in [ExtensionSystemPlan.md](../.cache/codex/ExtensionSystemPlan.md) are approved.
4-
- Build and test the hardened ELF and Mach-O embedded metadata readers on Linux and macOS, including malformed offsets, sizes, section-name tables, load commands, and universal-binary slices.
4+
- Cover universal binaries in `test_pluginloader_mac.cpp`. The malformed image cases there are all thin Mach-O, so the fat header, the slice table and the retry across slices are still only exercised by real binaries.
5+
- Add a sanitizer job to CI. An AddressSanitizer build over the malformed image cases is worth more than it looks: with the check on `e_shstrndx` removed, the ELF reader runs off the end of its section vector and only the sanitizer build notices. A plain Linux Debug configuration plus `-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer -g"` and the same flag in the three linker flag variables is enough. A `-fsanitize=thread` job would cover `test_concurrent_queries_follow_factory_changes` and `test_concurrent_frozen_queries` the same way.
6+
- Stop reading each candidate binary twice. `PluginFactory::scanPluginPaths()` builds a throwaway `PluginLoader` only to filter by IID, and `scanPlugins()` then reads the winner again. Whatever replaces it has to keep a bundle whose external metadata is broken visible with its diagnostic, which is the reason the second read exists today.
7+
- Give a search directory that keeps failing to scan a bounded retry. Keeping the IID pending is deliberate, because a transient failure has to be retried, but a directory the process can never open makes every `plugins()` call rescan. The cost is not the directory walk: a candidate whose IID does not match never enters `readPluginFiles`, so it is parsed again on every scan.
8+
- Decide what the ELF reader does with `SHN_XINDEX`. A library with more than 65280 sections currently reads as having no metadata. Also reword the byte order mismatch, which reports "is not an ELF library", and read the section name table in one go instead of seeking once per section name.
9+
- Give the embedded metadata an explicit length prefix. The reader recovers the length by stripping trailing NUL bytes, which only works because the linker zero pads the section. `GeneratePluginMetadata.cmake` writes the bytes and could state the length instead.

0 commit comments

Comments
 (0)