Task task9_cpp_footguns

# C++ Bug Hunt: Fix Subtle Errors

You'll find several C++ files in the current 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 the same directory).


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
37.5%
Success Rate
2m 57s
Avg Duration
44s - 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/google/gemini-3-pro-preview 5m 41s 293.7
100.0% openrouter/openai/gpt-5-nano 4m 51s 600.9
100.0% openrouter/anthropic/claude-opus-4.5 1m 48s 94.2
100.0% openrouter/qwen/qwen3-coder 4m 4s 266.3
100.0% openrouter/anthropic/claude-haiku-4.5 2m 49s 189.6
100.0% openrouter/deepseek/deepseek-v3.1-terminus 2m 28s 108.9
100.0% openrouter/openai/gpt-5.2 2m 51s 276.5
100.0% openrouter/anthropic/claude-sonnet-4.5 2m 36s 135.9
100.0% openrouter/openai/gpt-5-mini 2m 55s 316.6
87.5% litellm/GLM-4.5-Air-FP8-dev 1m 31s 150.7
75.0% openrouter/google/gemini-2.5-flash-lite-preview-09-2025 1m 20s 124.6
75.0% openrouter/openai/gpt-4.1-mini 1m 33s 120.7
62.5% openrouter/google/gemini-2.5-pro 3m 37s 73.4
50.0% openrouter/x-ai/grok-3-mini 1m 45s 329.4
50.0% openrouter/openai/gpt-4o-mini 2m 27s 107.8
50.0% openrouter/x-ai/grok-code-fast-1 2m 7s 126.8
25.0% openrouter/google/gemini-2.5-flash-preview-09-2025 48s 22.9
25.0% openrouter/openai/gpt-oss-120b 48s 23.2
25.0% openrouter/openai/gpt-oss-20b 44s 16.1
25.0% openrouter/deepseek/deepseek-chat-v3-0324 1m 5s 45.7
12.5% openrouter/openai/gpt-4.1-nano 1m 42s 141.0
0.0% litellm/DeepSeek-V3.2-sandbox 10m 0s 0.0
0.0% openrouter/openai/gpt-5 1m 18s 0.0
0.0% litellm/GLM-4.6-trtllm-sandbox 10m 0s 0.0