RStudio crashes when doing lm

To confirm, did you execute the continue command in gdb after attaching?

I think I got it to work, unfortunately says there is no stack?

sudo gdb -p 10699
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 10699
[New LWP 10701]
[New LWP 10702]
[New LWP 10703]
[New LWP 10733]
[New LWP 10734]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f88a8fbbf85 in futex_abstimed_wait_cancelable (private=,
abstime=0x7ffcfb727310, expected=0, futex_word=0x259a2e4)
at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) continue
Continuing.
[Thread 0x7f886a546700 (LWP 10734) exited]
[Thread 0x7f886ad47700 (LWP 10733) exited]
[Thread 0x7f88a3901700 (LWP 10703) exited]
[Thread 0x7f88a4102700 (LWP 10702) exited]
[Thread 0x7f88a9c48840 (LWP 10699) exited]
[Inferior 1 (process 10699) exited with code 0177]
(gdb) backtrace
No stack.
(gdb) backtrace
No stack.
(gdb)

Thanks,
J

That's surprising to me. That basically indicates that the R session is not really 'crashing' per se; rather, something is telling it to exit and it is doing so (exiting with status code 0177 in octal, or 127 in decimal).

I'm not sure how much more I can help debug; I can only guess that there is something strange going on in either your R or your BLAS / LAPACK installations.

You can also try following the instructions at e.g.

to see if there are other 'exit' methods you can try setting a breakpoint on to figure out what's going on.

Thanks Kevin, I did fix the crashing problem but had to recompile a new version of R that does not link to the LAPACK/BLAS libraries. So it works but a bit of problem if I want to run R code and/or packages that depend on those libraries.
Thx, J