Skip to content

Utilities to examine backtraces of coroutines in coredump files

License

Notifications You must be signed in to change notification settings

TakeoutSpace18/libcoro-dbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libcoro-dbg

Utilities to examine backtraces of coroutines in coredump files, that work with modified version of libcoro. Currently work in progress.

Main ideas

libcoro's coro_transfer function is modified to save coroutine execution state on each invocation. This state is saved into a table in process address space, that can afterwards be read from a coredump file in case of crash.

libcorostacks library is used to read coroutine state table and retrieve meaningful information about execution state. It uses elfutils under the hood for reading coredumps and stack unwinding.

print-coroutines is a simple program to output informaition obtained from libcorostacks.

Example program and modified libcoro can be found in demo directory.

Why not use GDB?

The thing is that GDB currently has no support for green threads and can't do unwinding outside of main stack without running process.
Link to discussion

How to build

Install dependencies

sudo apt install libelf-dev libdw-dev

Build using Meson

mkdir -p build
meson setup build --prefix=<where_to_install>
cd build
meson compile
meson install

How to use demo

Inside libcoro-dbg/build directory:

  1. gdb demo/corodemo & start - launch demo with GDB
  2. Ctrl+c & gcore after some time, to generate core file
  3. q - exit GDB
  4. print-coroutines/print-coroutines core.<pid> - print backtraces

About

Utilities to examine backtraces of coroutines in coredump files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published