Nikita Nazarov | KotlinConf 2024, May 22–24, Copenhagen
all speakers

Nikita Nazarov

Nikita Nazarov

Google LLC

Hi! My name is Nikita Nazarov!

LinkedIn: https://www.linkedin.com/in/nikita-nazarov-694762234/

GitHub: https://github.com/nikita-nazarov

I used to work at JetBrains in the Kotlin plugin team for a couple of years fixing issues and bringing new features to the Kotlin debugger. There I interacted with the coroutine debugger a lot and put in many effort to making it faster and more useful. These days I work at the Kotlin compiler team at Google, where we are working on improving the compiler and various Kotlin tooling including the coroutine debugger as well. I'm also the author of the Coroutine Stacks (https://github.com/nikita-nazarov/coroutine-stacks) Intellij plugin that allows rendering coroutine traces in a similar way to how it is done in the Parallel Stacks feature of the JetBrains rider IDE.

Debugging the Future: Exploring Coroutine Debugger Tools

Coroutines is a shining feature of the Kotlin language, however when having hundreds of them running, debugging becomes a challenging task! In this talk, we will take a deep dive into the core of coroutine debugging, debunking its internals and reviewing available tools.

During the first part of the talk I will give the overview of the coroutine debugging tooling available in Intellij IDEA and how to use it:

  1. Asynchronous stack traces
  2. How the debugger handles stepping inside coroutines, where after pressing the 'step over' button you may wake up in a different world.
  3. Coroutine Panel
  4. Stack trace recovery (https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/topics/debugging.md#stacktrace-recovery)
  5. The "-Xdebug" kotlin compiler flag that allows users to view variables that would normally be optimised. While presenting the tooling, I will also uncover the machinery behind it.

The second part of the talk will cover the tooling for coroutine debugging developed by the community:

  1. Stack Trace Decoroutinator (https://github.com/Anamorphosee/stacktrace-decoroutinator)
  2. Coroutine Stacks (https://github.com/nikita-nazarov/coroutine-stacks) I will give an overview of how to use it, which problems it covers and how it is different from what exists in Intellij.