fix(bid-ffi): Fix HostVtable lifetime issue causing segfault

🚨 Critical memory safety fix:
- HostVtable was created on stack and destroyed after init
- Plugin stored reference to destroyed memory → NULL pointer access
- Changed to static LazyLock storage for lifetime safety

 Results:
- Segfault completely eliminated
- Plugin logging now works properly
- Type info system confirmed working
- Full E2E FileBox plugin operation successful

🔧 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-18 14:10:41 +09:00
parent 7fc3adef66
commit c6c3c8e2f9
12 changed files with 607 additions and 262 deletions

View File

@ -72,6 +72,14 @@ enum Commands {
#[arg(short, long, default_value = "Hello TLV Debug!")]
message: String,
},
/// Validate plugin type information against nyash.toml
Typecheck {
/// Path to plugin .so file
plugin: PathBuf,
/// Path to nyash.toml configuration file
#[arg(short, long, default_value = "../../nyash.toml")]
config: PathBuf,
},
}
// ============ Host Functions (テスト用実装) ============