opentims icon indicating copy to clipboard operation
opentims copied to clipboard

opentimsr: crash/segfault when downloading bruker.so twice

Open sneumann opened this issue 1 year ago • 2 comments

Hi, the following code will reproducibly crash your R session:

library(opentimsr)
so_folder <- tempdir()

so_file <- download_bruker_proprietary_code(so_folder, method = "wget")
setup_bruker_so(so_file)

so_file <- download_bruker_proprietary_code(so_folder, method = "wget")
setup_bruker_so(so_file)

My guess is that R doesn't like it if a used *.so gets overwritten. => Possibly this can be solved if download_bruker_proprietary_code() refuses to overwrite the file. More complex would probably be to check to not overwrite a loaded *.so file.

Yours, Steffen

sneumann avatar Jul 10 '23 14:07 sneumann

Hi,

What would be the use-case and expected behaviour of such code? In other words, what are you trying to do here? Because I'm kind of tempted to respond with a "yeah, don't do that then" ;)

Though of course that should be a proper error message, not a segfault.

michalsta avatar Jul 10 '23 14:07 michalsta

"Don't do that" is exactly the correct answer. It was an oversight, we learned that now :-) But with the check it would be more robust, so indeed very low on the priority list. Yours, Steffen

sneumann avatar Jul 10 '23 15:07 sneumann