<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn" -->

---
title: Finding panics with Call Graph Analyzer | daily.dev
description: Tweede golf, working with Microsoft under the Open Device Partnership, released the Call Graph Analyzer (CGA), a tool that extracts a callgraph from...
canonical: https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Finding panics with Call Graph Analyzer | daily.dev
og:description: Tweede golf, working with Microsoft under the Open Device Partnership, released the Call Graph Analyzer (CGA), a tool that extracts a callgraph from...
og:url: https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn
og:image: https://api.daily.dev/og/posts/akMRjKCXn.png
og:image:alt: Finding panics with Call Graph Analyzer
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Finding panics with Call Graph Analyzer

**[Tweede golf](https://daily.dev/sources/tweedegolf)** · 17 min read · 0 upvotes · 0 comments

## Summary

Tweede golf, working with Microsoft under the Open Device Partnership, released the Call Graph Analyzer (CGA), a tool that extracts a callgraph from monomorphized MIR to find functions that can panic. Running `cargo cga check` reports panic paths with a backtrace, including panics hidden in dependencies like the standard library. Unlike linker-based or HIR-based detectors, CGA's MIR-based approach can see code in dependencies and is compatible with async code, while dyn trait objects and function pointers are handled by assumption. Compiling with CGA is typically 2x to 3x slower than `cargo check`. CGA also supports blacklisting functions, like `std::process::Command::new`, to flag unwanted calls. It requires a specific nightly rustc version via `rustc-private` and can't be installed from crates.io.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tweedegolf.nl/en/blog/242/finding-panics-with-call-graph-analyzer>

## Questions this post answers

### How can I find all the places in my Rust code that might panic, including ones inside dependencies?

The Call Graph Analyzer (CGA) extracts a callgraph from monomorphized MIR, which lets it see panics originating in dependencies and the standard library, not just your own crate. Run 'cargo cga check' to get diagnostics with a full backtrace showing the panic path down to your entrypoint. It requires build-std and a specific nightly rustc version via rustc-private.

_Developers hunting hidden panics in Rust binaries can track tools like this through daily.dev._

### Why don't linker-based tools like no-panic detect all panics in a Rust binary?

Linker-based panic detection only works if a binary contains zero panics at all, since it relies on triggering a linker error when a panic handler symbol gets linked in. It also only works on binaries, not libraries, so it cannot be used to audit a library crate for panic paths before it's linked into an application.

_Teams choosing a panic-detection approach for Rust can weigh these tradeoffs via daily.dev._

### Why does changing opt-level affect which panics show up in Rust MIR analysis?

With opt-level=2, expressions like 1 + 1 get const-evaluated and their overflow check removed before the MIR analysis stage, so no panic path appears. With opt-level='z', that optimization is deferred to LLVM instead, so the panic path still shows up in MIR, causing more false positives. opt-level=2 is recommended for panic analysis to minimize both false positives and false negatives.

_Rust developers tuning compiler flags for panic safety can follow details like this on daily.dev._

## Similar posts on daily.dev

- [Callgraph analysis](https://daily.dev/posts/callgraph-analysis-eufsryslz) · Ferrous Systems · 2 upvotes · 0 comments
- [Nice CLI Crash Reports in Rust](https://daily.dev/posts/nice-cli-crash-reports-in-rust-refjbwkvz) · Pascal’s scribbles · 1 upvotes · 0 comments
- [BorrowSanitizer](https://daily.dev/posts/borrowsanitizer-4ckct9kas) · Lobsters · 0 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#embedded](https://daily.dev/tags/embedded)

[View this post on daily.dev](https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Finding panics with Call Graph Analyzer","url":"https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn"},"datePublished":"2026-10-27T12:01:45.249Z","dateModified":"2026-10-27T12:02:20.744Z","description":"Tweede golf, working with Microsoft under the Open Device Partnership, released the Call Graph Analyzer (CGA), a tool that extracts a callgraph from...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/047f389d73456ae4739a1748746d5963?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/047f389d73456ae4739a1748746d5963?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Tweede golf","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Tweede golf","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/tweedegolf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust,embedded","timeRequired":"PT17M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Tweede golf","item":"https://daily.dev/sources/tweedegolf"},{"@type":"ListItem","position":3,"name":"Finding panics with Call Graph Analyzer"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/finding-panics-with-call-graph-analyzer-akmrjkcxn#faq","mainEntity":[{"@type":"Question","name":"How can I find all the places in my Rust code that might panic, including ones inside dependencies?","acceptedAnswer":{"@type":"Answer","text":"The Call Graph Analyzer (CGA) extracts a callgraph from monomorphized MIR, which lets it see panics originating in dependencies and the standard library, not just your own crate. Run 'cargo cga check' to get diagnostics with a full backtrace showing the panic path down to your entrypoint. It requires build-std and a specific nightly rustc version via rustc-private. Developers hunting hidden panics in Rust binaries can track tools like this through daily.dev."}},{"@type":"Question","name":"Why don't linker-based tools like no-panic detect all panics in a Rust binary?","acceptedAnswer":{"@type":"Answer","text":"Linker-based panic detection only works if a binary contains zero panics at all, since it relies on triggering a linker error when a panic handler symbol gets linked in. It also only works on binaries, not libraries, so it cannot be used to audit a library crate for panic paths before it's linked into an application. Teams choosing a panic-detection approach for Rust can weigh these tradeoffs via daily.dev."}},{"@type":"Question","name":"Why does changing opt-level affect which panics show up in Rust MIR analysis?","acceptedAnswer":{"@type":"Answer","text":"With opt-level=2, expressions like 1 + 1 get const-evaluated and their overflow check removed before the MIR analysis stage, so no panic path appears. With opt-level='z', that optimization is deferred to LLVM instead, so the panic path still shows up in MIR, causing more false positives. opt-level=2 is recommended for panic analysis to minimize both false positives and false negatives. Rust developers tuning compiler flags for panic safety can follow details like this on daily.dev."}}]}
```

