Hello I'm trying to learn how to create a macro in LibreOffice (7.6.3.2 60(Build:2)) under Linux. I hit "run" on a Python macro that was calling an external software using "subprocess.check_output". This external tools never ended. So I killed LOo with xkill. Now, every time I hit the Tools>Macro>Run or Tools>Macro>Organize>Python LOo crashes. I've tried killing/restarting LOo multiple times, I get the same result. I tried killing any remaining all the processes I could find related to LOo or Python, with no luck... The only thing I didn't try is restart the computer, because I can't do it for the moment (important stuff runnning). The error message when running LOo from CLI is: "" terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc "" So there might be bad (exploitable?) stuff happening here :( At least, it's a complete DoS for all Macros...
Please, can you put your question in: https://ask.libreoffice.org/c/english/5 There are people with a great acknowledge on python macros.
Hallo For now you should rename (backup) your user-profile and start soffice with a new user-profile from scratch. For the future: dont execute **long running independent things** via »subprocess.check_output(…) use »subprocess.Popen(…)« instead!
(In reply to Werner Tietz from comment #2) > Hallo > > For now you should rename (backup) your user-profile and start soffice with > a new user-profile from scratch. > > For the future: > dont execute **long running independent things** via > »subprocess.check_output(…) > use »subprocess.Popen(…)« instead! Indeed: https://docs.python.org/3/library/subprocess.html#using-the-subprocess-module "The recommended approach to invoking subprocesses is to use the run() function for all use cases it can handle. For more advanced use cases, the underlying Popen interface can be used directly." I guess we can close this.