Bug 158358

Summary: DoS + Bad crash when killing Python macro
Product: LibreOffice Reporter: LOO Debugger <loo-bugzilla.sitetester>
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: miguelangelrv
Priority: medium    
Version: 7.6.3.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description LOO Debugger 2023-11-24 14:52:49 UTC
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...
Comment 1 m_a_riosv 2023-11-25 03:45:42 UTC
Please, can you put your question in:
https://ask.libreoffice.org/c/english/5
There are people with a great acknowledge on python macros.
Comment 2 Werner Tietz 2023-11-25 07:24:37 UTC
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!