sheepshaver: all 5 MOADs CLEAN

This commit is contained in:
russell@unturf.com 2026-03-31 19:59:24 -04:00
parent cdba4c80e9
commit 097829af0a

40
defects/sheepshaver/scan Normal file
View file

@ -0,0 +1,40 @@
CLEAN
Target: SheepShaver (PowerPC Mac emulator, C++)
Repo: https://github.com/cebix/macemu (SheepShaver/ subtree)
Date: 2026-03-31
Scan depth: all 5 MOADs
MOAD-0001 (CWE-407): CLEAN
- block_cache.find() uses a 32768-slot hash table (block-cache.hpp), O(1) average.
- sifter_list (rom_patches.cpp) is bounded to 32 entries, static array, init-time only.
- IsMulticastRegistered (ether.cpp:113) is O(M) over multicast list, called per multicast
packet from dlpi_stream_list loop. Both S (streams) and M (multicast addresses) are
small in practice (single digits). Not a measurable defect.
- find_fsitem_by_id / find_fsitem (extfs.cpp) are O(N) linked-list scans called once per
FS operation, not inside an inner loop. No O(N^2) compound.
- All ROM patch scanning (find_rom_data, find_rom_resource, find_rom_trap) is init-time
startup work, not hot path.
- ppc-decode.cpp uses an indexed ii_index_table array for O(1) instruction dispatch.
MOAD-0002 (Intertangle): CLEAN
- KernelData / EmulatorData are fixed-layout structures representing the emulated Mac
hardware state, not a god object coupling independent subsystems. They are raw memory
mapped at fixed addresses as required by the Mac ROM interface.
- Subsystems (audio, disk, video, ethernet, serial) each have their own source files and
communicate through well-defined Mac OS traps and interrupt flags.
MOAD-0003 (Leaked Context): CLEAN
- No thread_local, __thread, pthread_key_create, or pthread_getspecific usage found.
- SheepShaver uses a single emulation thread (emul_thread) for all PowerPC execution.
The tick_thread and nvram_thread access disjoint data.
MOAD-0004 (CWE-312): CLEAN
- No passwords, tokens, credentials, or secrets in the codebase.
- SheepShaver is a local desktop emulator with no network authentication surface.
MOAD-0005 (Thundering Herd): CLEAN
- The JIT block cache (my_block_cache) is accessed only from the single emulation thread.
No concurrent cache-miss race is possible.
- InterruptFlags uses atomic_or / atomic_and operations (main_unix.cpp:1566-1571).
- No check+compute+put unsynchronized lazy init patterns found.