From 264b06cb972ebb41237425a2f5a4e125376b2d31 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 17 Nov 2021 10:02:30 +0000 Subject: [PATCH] Add content on getting backtraces when sessions hang --- r/vignettes/developers/debugging.Rmd | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/r/vignettes/developers/debugging.Rmd b/r/vignettes/developers/debugging.Rmd index a18178dfac1..b9aa8bb75a5 100644 --- a/r/vignettes/developers/debugging.Rmd +++ b/r/vignettes/developers/debugging.Rmd @@ -75,7 +75,7 @@ Here is debugger output from the segfault shown in the previous example. You can see here that the exact line which triggers the segfault is included in the output. -``` +```shell > S3FileSystem$create() Thread 1 "R" received signal SIGSEGV, Segmentation fault. @@ -83,6 +83,23 @@ Thread 1 "R" received signal SIGSEGV, Segmentation fault. 318 operator++() noexcept ``` +#### Getting debugger output if your session hangs + +The instructions above can provide valuable additional context when a segfault +occurs. However, there are occasionally circumstances in which a bug could +cause your session to hang indefinitely without segfaulting. In this case, it +may be diagnostically useful to interrupt the debugger and generate backtraces +from all running threads. + +To do this, firstly, press Ctrl/Cmd and C to interrupt the debugger, and then run: + +```shell +thread apply all bt +``` + +This will generate a large amount of output, but this information is useful when +identifying the cause of the issue. + ## Resources The following resources provide detailed guides to debugging R code: