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

23
Models Tested
30.4%
Success Rate
5m 42s
Avg Duration
3m 25s - 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 5m 30s 745.3
100.0% openrouter/anthropic/claude-3.7-sonnet 6m 43s 518.4
100.0% openrouter/anthropic/claude-haiku-4.5 3m 25s 370.4
100.0% openrouter/anthropic/claude-sonnet-4.5 4m 33s 138.6
100.0% openrouter/openai/gpt-5-mini 8m 9s 648.4
100.0% openrouter/anthropic/claude-3.5-haiku 4m 53s 224.5
100.0% openrouter/openai/gpt-4.1-mini 4m 18s 348.1
87.5% openrouter/qwen/qwen3-coder 5m 32s 159.5
87.5% openrouter/anthropic/claude-3.5-sonnet 5m 3s 415.1
87.5% openrouter/deepseek/deepseek-v3.1-terminus 6m 7s 398.0
87.5% litellm/GLM-4.5-Air-FP8-dev 8m 45s 266.7
87.5% openrouter/anthropic/claude-sonnet-4 6m 1s 400.0
50.0% openrouter/x-ai/grok-3-mini 5m 59s 704.8
50.0% openrouter/google/gemini-2.5-pro 4m 55s 33.2
50.0% openrouter/openai/gpt-4o-mini 3m 47s 296.4
50.0% openrouter/google/gemini-2.5-flash-lite-preview-09-2025 6m 5s 264.1
25.0% openrouter/google/gemini-2.5-flash-preview-09-2025 3m 34s 14.0
25.0% openrouter/openai/gpt-oss-120b 4m 6s 285.8
25.0% openrouter/openai/gpt-oss-20b 3m 50s 16.9
25.0% openrouter/deepseek/deepseek-chat-v3-0324 5m 18s 344.2
25.0% openrouter/openai/gpt-4.1-nano 4m 42s 203.1
0.0% openrouter/openai/gpt-5-nano 10m 0s 1597.8
0.0% openrouter/anthropic/claude-3-haiku 10m 0s 351.3