A Deep Dive into Python Stack Frames

Опубликовано: 14 November 2018
на канале: PyGotham 2018
4,882
89

Speaker: Nikhil Marathe

This talk walks listeners through CPython's implementation of call stacks and how information is encoded in these stacks to aid execution and error recovery. Once we cover that, I will show how we modified the Crashpad crash reporter at Dropbox to extract these stacks from native crashes in the wild to make engineers lives easier. This allows our developers to detect crashes caused on remote user machines due to incorrect Python code, with accurate Python stack traces.

The CPython interpreter implements function call stacks using various structures that act as chains of linked lists.
Each interpreter maintains a list of thread states for each thread. Each thread maintains a list of frames that represent the python function calls. New frames are pushed onto the stack as execution proceeds and the interpreter exposes these frames to user space. In addition, these frames can be inspected in native code to extract useful information about program crashes and to profile programs.

Some prior knowledge of C programming syntax, threading, native function stacks (https://manybutfinite.com/post/journe...) and Python byte code (   • James Bennett - A Bit about Bytes: Un...  ) will be useful for attendees to get the most out of this talk.


На этой странице сайта вы можете посмотреть видео онлайн A Deep Dive into Python Stack Frames длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь PyGotham 2018 14 November 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 4,882 раз и оно понравилось 89 зрителям. Приятного просмотра!