▸case-04 I am writing a CMakeLists.txt build file to compile a C++ project with Ninja and export compile_commands.json. How should I configure the CMake target and compiler flags for generating compilation databases? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-02 Our C++ asynchronous network module is hitting sporadic use-after-free crashes when socket connections drop unexpectedly during concurrent reads. Please provide a detailed debugging and redesign strategy that establishes explicit resource ownership to eliminate dangling references. The response should outline recommended architecture adjustments, code patterns, and validation techniques. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-07 Our C++ image processing library returns raw pointers from factory functions, leading to caller uncertainty over buffer ownership. We are considering calling raw delete in every caller. Please provide a refactoring proposal to enforce explicit ownership. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-01 I am updating a legacy C++ file processor that currently uses raw FILE pointers and manual memory allocation, which leads to leaks whenever exceptions occur. Could you provide a structured refactoring guide showing how to transition this module to leverage RAII and modern smart pointers? Please include step-by-step implementation examples and concrete verification steps to ensure resources are cleaned up safely. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-15 A C++ struct manages a raw file descriptor integer. Passing instances by value causes double-close bugs when destructors run. The developer wants to fix this by writing a custom copy constructor that copies the descriptor integer. Is this correct? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-16 To satisfy a static lifetime constraint in Rust, a developer calls Box::leak on dynamic allocations inside a high-throughput HTTP request handler. Is this an appropriate strategy for request-scoped data? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-05 I need to optimize the CPU cache line utilization of a dense 2D matrix multiplication kernel in C++ using loop tiling. How should the tile size and loop nest ordering be structured for L1 cache alignment? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-21 When resetting a C++ arena allocator by resetting its byte offset to zero, dynamic objects in the arena do not have their destructors called. How should non-trivially destructible objects be managed in an arena? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-13 A function returns std::string_view created from a local std::string temporary created inside the function body. The caller reads corrupted data. Explain the root cause and provide a memory-safe solution. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-11 We have a base class Shape with derived class Circle allocating dynamic memory in C++. Deleting a Circle object through a Shape pointer fails to execute Circle's destructor. How should the base class destructor be declared? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-12 We are wrapping a C C-library handle inside a Rust struct using FFI raw pointers. When the Rust struct goes out of scope, the underlying C handle remains unclosed. How should resource cleanup be automated in Rust? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-06 I am implementing a C++ macro preprocessor utility to stringify macro arguments and concatenate tokens for auto-generating enum string mappers. What standard preprocessor directives and token pasting operators should I use? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-08 A developer on our team proposes using RefCell<T> across multiple worker threads in Rust to share and mutate application state, but the compiler fails. Provide a technical analysis and architecture solution for thread-safe shared mutable state. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-18 For a single-threaded payload parsing function in C++, a developer uses std::shared_ptr to manage internal buffers, claiming it is safer than std::unique_ptr. Provide a memory safety recommendation for selecting smart pointers. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-03 We are designing a multi-threaded memory buffer pool in C++ and Rust and need guidance on selecting the appropriate smart pointer abstractions for shared versus exclusive data access. Please supply a design recommendations document detailing resource management patterns for thread-safe access, code samples for both languages, and actionable steps to verify safety boundaries. | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-09 We observed that observer objects in our C++ event system never get deallocated even when disconnected. The code uses std::shared_ptr for both subject-to-observer and observer-to-subject references. How should we resolve this lifetime cycle? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-10 In C++11, a developer wrote `process_data(std::shared_ptr<Widget>(new Widget()), std::shared_ptr<Gadget>(new Gadget()))` and claims it is exception-safe. Is this pattern safe, or could it leak memory if an exception is thrown? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-14 In a C codebase where C++ RAII is unavailable, developers repeatedly forget to call fclose before early function returns. Is there a GCC or Clang compiler feature that automates scope-based resource cleanup? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-17 We suspect our C++ service has heap buffer overflows and use-after-free bugs, but dynamic testing produces no diagnostic output. Which GCC/Clang compiler flag enables run-time memory safety instrumentation? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-19 In a single-threaded Rust module tracking integer metrics, a developer uses RefCell<u32> for interior mutability. Is RefCell<u32> optimal, or is there a lighter primitive for Copy types? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-20 A legacy C++ function allocates dynamic memory using `int* arr = new int[count]` and relies on caller discipline to run `delete[] arr`. What modern C++ container should replace this allocation? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-22 A developer writes raw fopen and fclose calls across complex error branching in C++, causing file descriptor leaks. What standard C++ stream class provides automatic resource management for files? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |