|
Download cpp/cpp-debug-race.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 917 Bytes
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/cpp/cpp-debug-race.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/cpp/cpp-debug-race.jsonl
-
curl -L -o cpp-debug-race.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/cpp/cpp-debug-race.jsonl
917 Bytes
| {"type": "session", "harness": "opencode", "id": "cpp-debug-race", "name": "Debugging C++ Thread Races"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert debugger."}} | |
| {"type": "message", "message": {"role": "user", "content": "How to debug C++ multithreaded race conditions?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "Thread Sanitizer (TSAN): -fsanitize=thread -g -O1\n\nCommon races:\n- Non-atomic read/write on shared int\n- TOCTOU: check-then-act race\n- Iterator invalidation during concurrent modification\n- Reference counted pointer: increment/decrement must be atomic\n\nSteps:\n1. Run with TSAN for exact locations\n2. Check shared variable protection (mutex, atomic, shared_mutex)\n3. Verify lock ordering across threads\n4. Use std::atomic<int> for flags, std::mutex for critical sections\n\nOther tools: Helgrind (Valgrind), Intel Inspector."}} | |