[R-pkg-devel] New package with C++ code causes R abort in RStudio, not in R console.

Luc De Wilde Luc@DeW||de @end|ng |rom UGent@be
Thu Nov 14 14:08:13 CET 2024


At last, with checking of the program with address sanitizer in Visual Studio, I found an "off by 1 error" in my code. Now all tests pass without problems in Rstudio.

Thank you very much, Ivan, for helping me with this - new to me - issues!

Luc

________________________________________
Van: Ivan Krylov <ikrylov using disroot.org>
Verzonden: dinsdag 12 november 2024 22:33
Aan: Luc De Wilde <Luc.DeWilde using UGent.be>
CC: r-package-devel using r-project.org <r-package-devel using r-project.org>
Onderwerp: Re: [R-pkg-devel] New package with C++ code causes R abort in RStudio, not in R console.

В Tue, 12 Nov 2024 21:09:54 +0000
Luc De Wilde <Luc.DeWilde using UGent.be> пишет:

> I have attached a debugger (from Visual Studio) to the R process,
> which gives me the message "A breakpoint instruction (__debugbreak()
> statement or similar call) was executed in rsession-utf8.exe.
>
> When I go to the dll module in the Call Stack I get the message
> "Binary was not built with debug information".

So the crash does happen inside lavaanC.dll, did I get this right?

If you set the environment variable DEBUG to a non-empty string before
compiling the package, the resulting *.dll will have debug information
in the DWARF format (this is set in file.path(R.home('etc'), 'x64',
'Makeconf')). Visual Studio might not work with it, so you could
install gdb into Rtools using pacman, or you could try to give the
executable to Dr. Mingw <https://github.com/jrfonseca/drmingw>.

--
Best regards,
Ivan



More information about the R-package-devel mailing list