Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-11 Thread Vladimir Dergachev
On Tue, 12 Mar 2024, Ivan Krylov wrote: Vladimir, Thank you for the example and for sharing the ideas regarding symbol-relative offsets! On Thu, 7 Mar 2024 09:38:18 -0500 (EST) Vladimir Dergachev wrote: unw_get_reg(, UNW_REG_IP, ); Is it ever possible for unw_get_reg() to

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-11 Thread Ivan Krylov via R-package-devel
Vladimir, Thank you for the example and for sharing the ideas regarding symbol-relative offsets! On Thu, 7 Mar 2024 09:38:18 -0500 (EST) Vladimir Dergachev wrote: > unw_get_reg(, UNW_REG_IP, ); Is it ever possible for unw_get_reg() to fail (return non-zero) for UNW_REG_IP? The

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-07 Thread Vladimir Dergachev
Hi Ivan, Here is the piece of code I currently use: void backtrace_dump(void) { unw_cursor_tcursor; unw_context_t context; unw_getcontext(); unw_init_local(, ); while (unw_step() > 0) { unw_word_t offset, pc; charfname[64];

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-07 Thread Ivan Krylov via R-package-devel
On Tue, 5 Mar 2024 18:26:28 -0500 (EST) Vladimir Dergachev wrote: > I use libunwind in my programs, works quite well, and simple to use. > > Happy to share the code if there is interest.. Do you mean that you use libunwind in signal handlers? An example on how to produce a backtrace without

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-05 Thread Vladimir Dergachev
I use libunwind in my programs, works quite well, and simple to use. Happy to share the code if there is interest.. best Vladimir Dergachev On Mon, 4 Mar 2024, Ivan Krylov via R-package-devel wrote: On Sun, 3 Mar 2024 19:19:43 -0800 Kevin Ushey wrote: Would libSegFault be useful here?

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-03 Thread Ivan Krylov via R-package-devel
On Sun, 3 Mar 2024 19:19:43 -0800 Kevin Ushey wrote: > Would libSegFault be useful here? Glad to know it has been moved to and not just removed altogether after the upstream commit

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-03 Thread Kevin Ushey
Would libSegFault be useful here? https://lemire.me/blog/2023/05/01/under-linux-libsegfault-and-addr2line-are-underrated/ On Sun, Mar 3, 2024, 5:15 PM Rolf Turner wrote: > On Sun, 3 Mar 2024 11:14:44 +0300 > Ivan Krylov via R-package-devel wrote: > > > Hello, > > > > This may be of interest to

Re: [R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-03 Thread Rolf Turner
On Sun, 3 Mar 2024 11:14:44 +0300 Ivan Krylov via R-package-devel wrote: > Hello, > > This may be of interest to people who run lots of R CMD checks and > have to deal with resulting crashes in compiled code. > Is adding C-level backtraces to R CMD checks worth the effort? Could > it be a

[R-pkg-devel] RFC: C backtraces for R CMD check via just-in-time debugging

2024-03-03 Thread Ivan Krylov via R-package-devel
Hello, This may be of interest to people who run lots of R CMD checks and have to deal with resulting crashes in compiled code. Every now and then, the CRAN checks surface a particularly nasty crash. The R-level traceback stops in the compiled code. It's not obvious where exactly the crash