-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add a tutorial for pystack core
#181
Conversation
pystack core
d39d4d0
to
ceac43f
Compare
00c0945
to
760ecf3
Compare
This tutorial walks users through a core dump configuration, then uses a python script to invoke a dump with stdlib sigabrt, and then utilizes pystack to trace the error. Signed-off-by: Jon Cirone <[email protected]>
760ecf3
to
3e23f5e
Compare
Thanks for the contribution, @PistachioCannoli! Sorry for taking so long to get around to reviewing it. I decided that the example program that I had suggested to you was a bit too trivial to make for an entertaining tutorial, and after a bit of effort and a few conversations I managed to come up with a real way to crash the interpreter with a segfault that works on all Python versions Memray supports, and that's much more challenging to debug with PyStack than the trivial version that just calls Thanks to all your work here, I had a great starting point. @sarahmonod Since I modified this so heavily, I'd rather not be the one to land it. Can you take a look and ensure I haven't made any mistakes? |
(Ignore the failing DCO check; it's just mad that I edited the Signed-off-by line to use a real name instead of a pseudonym, but we have received the DCO) |
bf64dd7
to
10a08cd
Compare
The example I originally suggested for the core dump tutorial is a bit too trivial to make an interesting example. Instead, Pablo helped me come up with an example of a known way to crash the interpreter where the root cause is not so obvious, which makes a far more engaging example for readers to dig into and try to make sense of. Signed-off-by: Matt Wozniski <[email protected]>
10a08cd
to
63098b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The tutorial walks users through a core dump configuration, then uses a python script to invoke a dump with stdlib SIGABRT, and then utilizes pystack to trace the error.
*Issue number of the reported bug or feature request: #53 *
Describe your changes
Wrote a tutorial page which guides users through a stack trace with pystack's core subcommand. The tutorial starts by introducing the concept, then configures the core dump settings such as size and output location. Afterwards, it uses a test script written which follows a series of asserts, if an assert is thrown, stdlib abort is called to interrupt the program, causing a core dump. Finally, the tutorial uses the core subcommand to trace the specific python stack then uses the --native flag to show the native C frames to assess the error.
Testing performed
Tested in an environment which copied the documentation structure of memray, but I reverted all memray dependencies prior to committing my changes.