# \#backtrace

**URL:** https://discuss.ocaml.org/tag/backtrace/493.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Backtrace in utop](https://discuss.ocaml.org/t/backtrace-in-utop/16801)

<div class="topic-metadata">

**Author:** [@ysalmon](https://discuss.ocaml.org/u/ysalmon)\
**Replies:** 3\
**Last updated:** [June 13, 2025, 8:30am UTC](https://discuss.ocaml.org/t/backtrace-in-utop/16801 "2025-06-13T08:30:10Z")

</div>

I recently upgraded from 4.14.0 to 5.3.0 and am now looking for toplevel backtraces (which were buggy in 4.14 iirc). Running utop with OCAMLRUNPARAM=b does give backtraces, but they are rather frustrating. For example, …

---

## [\[BLOG\] OCaml Backtraces on Uncaught Exceptions, by OCamlPro](https://discuss.ocaml.org/t/blog-ocaml-backtraces-on-uncaught-exceptions-by-ocamlpro/14551)

<div class="topic-metadata">

**Author:** [@OCamlPro](https://discuss.ocaml.org/u/OCamlPro)\
**Replies:** 13\
**Last updated:** [May 23, 2024, 10:58pm UTC](https://discuss.ocaml.org/t/blog-ocaml-backtraces-on-uncaught-exceptions-by-ocamlpro/14551 "2024-05-23T22:58:32Z")

</div>

Greetings Cameleers, Here’s another one of our heads up about our latest blog release! Today’s topic is about an unintentionally hidden feature of the OCaml dev environmment: backtraces on uncaught exception! We beli…

---

## [Why does Backtrace.Exn not work very well with monadic let bindings?](https://discuss.ocaml.org/t/why-does-backtrace-exn-not-work-very-well-with-monadic-let-bindings/13894)

<div class="topic-metadata">

**Author:** [@Ekanshdeep\_Gupta](https://discuss.ocaml.org/u/Ekanshdeep_Gupta)\
**Replies:** 9\
**Last updated:** [February 8, 2024, 10:13am UTC](https://discuss.ocaml.org/t/why-does-backtrace-exn-not-work-very-well-with-monadic-let-bindings/13894 "2024-02-08T10:13:32Z")

</div>

I am using the custom let bindings introduced in Ocaml 4.08 to implement a custom monad. Here is a snippet of how this is implemented: type 'a t = state -\> (state \* 'a) let return a = fun s -\> (s, a) module Syntax = s…

---

## [Why isn't OCaml recording bactrace by default](https://discuss.ocaml.org/t/why-isnt-ocaml-recording-bactrace-by-default/9915)

<div class="topic-metadata">

**Author:** [@Butanium](https://discuss.ocaml.org/u/Butanium)\
**Replies:** 7\
**Last updated:** [May 26, 2022, 6:38pm UTC](https://discuss.ocaml.org/t/why-isnt-ocaml-recording-bactrace-by-default/9915 "2022-05-26T18:38:18Z")

</div>

A few months ago, after 1.5 years of OCaml I discovered Printexc.record\_backtrace true. This is soooo useful to debug, so why isn’t it set to true by default ? I think it would help a lot of beginners, some of whose don…

---

## [Corrupted backtraces when omitting option \`-g\` to \`ocamlopt\`](https://discuss.ocaml.org/t/corrupted-backtraces-when-omitting-option-g-to-ocamlopt/9130)

<div class="topic-metadata">

**Author:** [@Maelan](https://discuss.ocaml.org/u/Maelan)\
**Replies:** 3\
**Last updated:** [January 11, 2022, 2:42pm UTC](https://discuss.ocaml.org/t/corrupted-backtraces-when-omitting-option-g-to-ocamlopt/9130 "2022-01-11T14:42:42Z")

</div>

While compiling with ocamlopt and running programs with OCAMLRUNPARAM=b, I have faced backtraces which were obviously wrong (mentioning raising locations that couldn’t possibly escape, in functions that weren’t even call…
