michalsta / opentims

Open-source C++ and Python module for opening binary timsTOF data files.
Other
41 stars 11 forks source link

opentimsr: crash/segfault when downloading bruker.so twice #21

Open sneumann opened 11 months ago

sneumann commented 11 months ago

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

michalsta commented 11 months ago

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.

sneumann commented 11 months ago

"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