Task task9_cpp_footguns

# C++ Bug Hunt: Fix Subtle Errors

You'll find several C++ files in the `input/` directory. Each file contains realistic code that does something useful, but has ONE subtle bug.

## Your Task

Fix the bug in each file so that:
1. The code compiles without warnings (`-Wall -Wextra -Werror`)
2. The code passes sanitizer checks (ASan/UBSan)
3. The code produces the correct expected output

## Files

- `virtual_destructor.cpp` - Plugin system with memory management
- `reference_to_temporary.cpp` - Configuration system
- `iterator_invalidation.cpp` - Event queue processor
- `unsigned_underflow.cpp` - Ring buffer implementation
- `dangling_cstr.cpp` - Log formatting system
- `init_order.cpp` - Coordinate system with units
- `off_by_one.cpp` - Matrix border detection
- `int_overflow.cpp` - Bulk price calculator

Each file is independent. Fix bugs **IN PLACE** (modify the files in `input/`).


PS: You are currently working in an automated system and cannot ask any question or have back and forth with an user.

Results

24
Models Tested
50.0%
Success Rate
6m 12s
Avg Duration
2m 33s - 10m 0s
Duration Range

Details

Score Model Duration Session (KB) test_dangling_cstr.sh test_init_order.sh test_int_overflow.sh test_iterator_invalidation.sh test_off_by_one.sh test_reference_to_temporary.sh test_unsigned_underflow.sh test_virtual_destructor.sh
100.0% openrouter/openai/gpt-5 7m 39s 442.4
100.0% openrouter/google/gemini-3-pro-preview 8m 26s 137.9
100.0% openrouter/openai/gpt-5-nano 6m 49s 517.5
100.0% openrouter/anthropic/claude-opus-4.5 5m 6s 84.1
100.0% openrouter/qwen/qwen3-coder 5m 20s 191.0
100.0% openrouter/google/gemini-2.5-pro 6m 14s 127.0
100.0% openrouter/anthropic/claude-haiku-4.5 5m 27s 127.8
100.0% openrouter/deepseek/deepseek-v3.1-terminus 7m 43s 115.0
100.0% openrouter/openai/gpt-5.2 6m 40s 370.0
100.0% openrouter/anthropic/claude-sonnet-4.5 6m 7s 138.4
100.0% openrouter/x-ai/grok-code-fast-1 7m 26s 939.4
100.0% openrouter/openai/gpt-5-mini 8m 29s 424.5
87.5% litellm/GLM-4.5-Air-FP8-dev 5m 34s 227.3
87.5% openrouter/openai/gpt-4.1-mini 4m 22s 137.4
75.0% openrouter/openai/gpt-4o-mini 7m 36s 152.9
62.5% openrouter/x-ai/grok-3-mini 5m 48s 426.9
25.0% openrouter/google/gemini-2.5-flash-preview-09-2025 4m 52s 18.5
25.0% openrouter/openai/gpt-oss-120b 2m 54s 58.4
25.0% openrouter/google/gemini-2.5-flash-lite-preview-09-2025 5m 2s 17.8
25.0% openrouter/openai/gpt-oss-20b 2m 33s 27.2
25.0% openrouter/deepseek/deepseek-chat-v3-0324 4m 7s 41.1
25.0% openrouter/openai/gpt-4.1-nano 4m 27s 72.7
0.0% litellm/DeepSeek-V3.2-sandbox 10m 0s 309.8
0.0% litellm/GLM-4.6-trtllm-sandbox 10m 0s 1095.0