# Knows what your build compiles. *Proves every change before you see it.*

ByteAsk is an AI coding agent for C and C++ that runs your compiler, sanitizers, gdb and tests on its own changes.

[Install](https://byteask.ai/#install) [Book a demo](https://byteask.cal.com/pratyush/book-a-demo)

The deadlock is found and fixed.

**ByteAsk**AI pair-debugger done

❯ byteask "my gdb is stopped on the deadlock in orderd, take a look"

● Joined the bridge in your gdb. orderd is stopped.

▸ Two threads are stuck in __lll_lock_wait with no progress since 09:31.

▸ T7 (match) is blocked in OrderBook::cancel at order_book.cpp:214.

▸ T7 holds book_mtx_ and waits on risk_mtx_, owned by LWP 71154.

▸ T12 holds risk_mtx_ and waits on book_mtx_, owned by LWP 71149.

▸ That is a lock-order inversion between cancel() and on_fill().

✎ order_book.cpp

-std::lock_guard<std::mutex> bk(book_mtx_);

-std::lock_guard<std::mutex> rk(risk_mtx_);

+std::scoped_lock lk(book_mtx_, risk_mtx_);

▸ The same change is applied in risk_engine.cpp:87.

$ ninja -C build && ./build/stress --orders 5000000 --threads 16

✓ 5000000 orders, 0 stalls

▸ I want to run detach in your gdb. Approve? [y/n]

▸ Approved. Sent to your gdb.

✓The diff is ready for review.

**gdb**your gdb, bridge armed detached

(gdb) source ~/.byteask/byteask_gdb_bridge.py your session · 09:36

(gdb) byteask-bridge

ByteAsk bridge armed. The AI can attach now.

[byteask] (gdb) info threads

Id Target Id Frame

* 1 LWP 71142 "orderd" epoll_wait ()

2 LWP 71143 "io" io_uring_enter ()

7 LWP 71149 "match" __lll_lock_wait ()

9 LWP 71151 "md_feed" recvmsg ()

12 LWP 71154 "risk" __lll_lock_wait ()

[byteask] (gdb) thread 7

[Switching to thread 7 (LWP 71149 "match")]

[byteask] (gdb) bt

#0 __lll_lock_wait ()

#1 ___pthread_mutex_lock ()

#2 std::mutex::lock () at bits/std_mutex.h

#3 OrderBook::cancel (this=0x55d1a3f2c8e0, id=88213004) at order_book.cpp:214

[byteask] (gdb) frame 3

#3 OrderBook::cancel (this=0x55d1a3f2c8e0, id=88213004) at order_book.cpp:214

[byteask] (gdb) p risk_mtx_._M_mutex.__data.__owner

$1 = 71154 ← held by T12

[byteask] (gdb) thread 12

[Switching to thread 12 (LWP 71154 "risk")]

[byteask] (gdb) bt

#0 __lll_lock_wait ()

#1 ___pthread_mutex_lock ()

#2 std::mutex::lock () at bits/std_mutex.h

#3 RiskEngine::on_fill (this=0x55d1a3f30120, fill=...) at risk_engine.cpp:87

[byteask] (gdb) p book_mtx_._M_mutex.__data.__owner

$2 = 71149 ← held by T7 · cycle confirmed

[byteask] (gdb) detach

Detaching from program: /srv/orderd, process 71142

[Inferior 1 (process 71142) detached]

(gdb)

## ByteAsk builds the context. *The model gets the answer.*

It replays your build and maps every function, template and call. The model gets only the few functions that matter.

Bug #1982 in nlohmann/json, a popular C++ library. Each dot is a function, each line a call. The ringed dot is where ByteAsk points first.

source files compiled

43

files in the project

77

lines of code

57,234

functions

907

classes

184

template versions

20,463

function calls

1,762

to build the index

2 min 16 s

| Bugs | Model alone | With ByteAsk |
| --- | --- | --- |
| 80 bugs fixed 18 Aug to 22 Oct 2026 across 21 C/C++ projects | 50.9% | 66.7% |
| 129 Multi-SWE-bench C++ bugs | 36% | 54% |

## It joins the gdb session you already have open.

Linux allows one debugger per process. ByteAsk uses a bridge you start in yours.

```
~/orderd ❯ claude "my gdb is stopped on the deadlock in orderd, take a look"
Your gdb is holding the process.
$ gdb -p <pid> -batch -ex bt
warning: process <pid> is already traced by process <your-gdb>
ptrace: Operation not permitted.

One tracer per process. The kernel refuses
a second debugger while yours is attached.
```

```
~/orderd ❯ byteask "my gdb is stopped on the deadlock in orderd, take a look"
Joined through the bridge you started.
(gdb) bt
#3  OrderBook::cancel (...) at order_book.cpp:214
(gdb) p risk_mtx_._M_mutex.__data.__owner
$1 = 71154  (held by the risk thread)
Your breakpoints are still set for the next turn.

+ std::scoped_lock lk(book_mtx_, risk_mtx_);
✓ Proposed, waiting for your approval.
```

your network

your machine

**gdb**your open session

**byteask**the CLI

**Tools**build, sanitizers, tests

**ByteAsk gateway**company keys, allowlists

**self-hosted models**vLLM, Ollama, llama.cpp

## The sanitizer names the line.

```
~/demo/outputs ❯ g++ -O1 -g -fsanitize=address -fno-omit-frame-pointer order_book.cpp && ./order_book_asan
==2967905==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60c0000000c8
WRITE of size 4 at 0x60c0000000c8 thread T0
    #0 0x55d75c82e5a6 in OrderBook::cancel_all() demo/outputs/order_book.cpp:31
    #1 0x55d75c82e5a6 in main demo/outputs/order_book.cpp:42
    #2 0x7feead645249 in __libc_start_call_main libc_start_call_main.h:58
0x60c0000000c8 is located 8 bytes to the right of 128-byte region
allocated by thread T0 here:
    #0 0x7feeadcb94c8 in operator new(unsigned long)
SUMMARY: AddressSanitizer: heap-buffer-overflow demo/outputs/order_book.cpp:31
```

```
~/demo/outputs ❯ cmake -B build && cmake --build build && ctest --test-dir build
Test project demo/outputs/build
1/3 Test #1: book_ops .........................   Passed    0.00 sec
2/3 Test #2: risk_engine ......................   Passed    0.00 sec
3/3 Test #3: wire_codec .......................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.01 sec
```

## The tools you already run

**byteask***the CLI*

- ### It builds your tree before it edits it - clangd - CMake - Compiler Explorer - C++ Insights
- ### ASan, gdb and rr, on your process - ASan - gdb - lldb - Valgrind - rr
- ### Your .clang-tidy, not ours - clang-tidy - clang-format - cppcheck
- ### perf, before you see a diff - perf - Callgrind - QuickBench
- ### objdump, when there is no source - objdump - nm - readelf

## Your key, or your own server

- **Managed:** Sign in and use OpenAI, Anthropic and Google models through ByteAsk. No API key to paste. `$ byteask login`
- **Your key:** Use your own OpenAI, Anthropic or Gemini key. Traffic goes straight to the provider, not through ByteAsk. `$ byteask byok set`
- **Your server:** Point ByteAsk at vLLM, Ollama, llama.cpp, LM Studio, TGI, SGLang or a LiteLLM proxy. Self-hosted models are not metered. `$ byteask models add my-model --url http://your-host:8000`

### Standards it can cite

| Tool | Corpus |
| --- | --- |
| autosar_ref | AUTOSAR C++14 · MISRA · ISO C++ |
| mcu_ref | STM32 · Cortex-M · Modbus · CAN |
| fpga_ref | Xilinx UltraScale · AMBA AXI |
| hft_ref | ITCH/OUCH · FIX · IEEE 1588 PTP |
| grid_ref | IEEE 1547 · 2030.5 · SunSpec |
| scpi_ref | SCPI · instrument manuals |
| x86_ref | x86-64 Software Developer Manual |

## Try it on your build.

[Install ByteAsk](https://byteask.ai/install) [Book a demo](https://byteask.cal.com/pratyush/book-a-demo)

---
HTML version: https://byteask.ai/product
