Bug 158889 - Macro kill => any attempt to access macros crashes LOo
Summary: Macro kill => any attempt to access macros crashes LOo
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2023-12-27 15:20 UTC by LOO Debugger
Modified: 2024-01-04 15:43 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
strace of attempt to access python macros menu, crashes LOo (71.53 KB, text/plain)
2023-12-27 15:20 UTC, LOO Debugger
Details
backtrace, LOo crashes before even getting to Macro problem (49.90 KB, text/x-log)
2023-12-28 12:30 UTC, LOO Debugger
Details
strace directly from LOo (23.57 MB, text/x-log)
2023-12-28 12:34 UTC, LOO Debugger
Details
LDD log1 (462 bytes, text/plain)
2023-12-28 12:40 UTC, LOO Debugger
Details
LDD log2 (526 bytes, text/plain)
2023-12-28 12:41 UTC, LOO Debugger
Details
Attempting to debug with GDB (5.06 KB, text/plain)
2023-12-28 23:52 UTC, LOO Debugger
Details
BackTrace from gdb (7.18 KB, text/plain)
2023-12-29 11:39 UTC, LOO Debugger
Details
Trace dumped displayed on CLI after failed attempt to install APSO (4.82 KB, text/plain)
2023-12-30 14:47 UTC, LOO Debugger
Details
APSO install attempt failure message (11.02 KB, image/png)
2023-12-30 14:47 UTC, LOO Debugger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LOO Debugger 2023-12-27 15:20:29 UTC
Created attachment 191603 [details]
strace of attempt to access python macros menu, crashes LOo

Hello,

- I was trying to create my first macro in Python in Writer in Linux.
- I made a mistake and it started to run in an infinite loop.
- LibreOffice was frozen, waiting for the marco to end.
- I killed the macro, but it was not sufficient.
- I killed LibreOffice too. 

Now, any attempt I make to access macros (Tools > Macro > Organize > Python) crashes LOo.

I tried:
- removing ~/.config/libreoffice
- purging (apt purge) all libreoffice packages & reinstalling them

But nothing works. LOo is still crashing at any attempt to access the Python macros menu. Accessing Basic macros work though.

I join an "strace" of simply opening LOo Writer and clicking on Tools > Macro > Organize > Python. I can't find anything bad myself in it, but it might help you...
Comment 1 LOO Debugger 2023-12-27 23:07:02 UTC
- Tools > Macro > Run Macro also crashes
- Tools > Macro > Organize > Javascript also crashes
Comment 2 LOO Debugger 2023-12-27 23:07:47 UTC
- Tools > Macro > Organize > BeanShell also crashes
Comment 3 Julien Nabet 2023-12-28 10:32:14 UTC
A backtrace would be useful (see https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU/Linux:_How_to_get_a_backtrace)
Comment 4 LOO Debugger 2023-12-28 12:30:52 UTC
Created attachment 191611 [details]
backtrace, LOo crashes before even getting to Macro problem
Comment 5 LOO Debugger 2023-12-28 12:34:39 UTC
Created attachment 191612 [details]
strace directly from LOo

with interesting error message
Comment 6 LOO Debugger 2023-12-28 12:40:52 UTC
Created attachment 191613 [details]
LDD log1
Comment 7 LOO Debugger 2023-12-28 12:41:18 UTC
Created attachment 191614 [details]
LDD log2
Comment 8 Julien Nabet 2023-12-28 13:13:07 UTC
Could you try this?

open a first terminal and launch LO
open a second terminal and type:
"gdb --pid=$(pidof soffice.bin)"
then wait a bit and type "c" for continue

Go back to terminal 1 and try to reproduce the pb.

On terminal 2, each time you'll get something like "?" or "??", type "c".
after these, you'll got something else, at this moment type "bt" and copy paste the result in a txt file that you'll attach.
Comment 9 LOO Debugger 2023-12-28 23:52:32 UTC
Created attachment 191620 [details]
Attempting to debug with GDB
Comment 10 LOO Debugger 2023-12-28 23:54:52 UTC
Comment on attachment 191620 [details]
Attempting to debug with GDB

Attempting to do as recommended.
- As user => GDB cannot attach to process
- Ass root => LOo seems to crash too strongly ; results in message "no bt" in GDB
Comment 11 QA Administrators 2023-12-29 03:12:15 UTC Comment hidden (obsolete)
Comment 12 Julien Nabet 2023-12-29 08:21:18 UTC
(In reply to LOO Debugger from comment #10)
> Comment on attachment 191620 [details]
> Attempting to debug with GDB
> 
> Attempting to do as recommended.
> - As user => GDB cannot attach to process
> - Ass root => LOo seems to crash too strongly ; results in message "no bt"
> in GDB

Reading your last trace, I see:
[New LWP 482951]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f7ddbd189df in __GI___poll (fds=0x556544072dd0, nfds=3, timeout=61357) at ../sysdeps/unix/sysv/linux/poll.c:29
29	../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) c
Continuing.
[New Thread 0x7f7dbb7fe640 (LWP 484614)]

=> OK

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x00007f7d6860062d in ?? ()
(gdb) c
Continuing.
[New Thread 0x7f7dbbe2d640 (LWP 484676)]

=> OK

but then:
[Thread 0x7f7d453ce640 (LWP 484689) exited]

Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140178438963584) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
(gdb) c
Continuing.

=> No, you should have typed "bt" here since it wasn't "?" or "??".
Comment 13 LOO Debugger 2023-12-29 11:39:40 UTC
Created attachment 191624 [details]
BackTrace from gdb

Not sure I understood where I should do the 'bt' or 'c', but I think I got the BT you asked
Comment 14 Julien Nabet 2023-12-29 11:48:13 UTC
Thank you it worked!

The relevant part is:
#9  0x00007f290a6d8027 in  () at /usr/lib/libreoffice/program/libpyuno.so
#10 0x00007f290a6e59eb in pyuno::Runtime::extractUnoException(pyuno::PyRef const&, pyuno::PyRef const&, pyuno::PyRef const&) const () at /usr/lib/libreoffice/program/libpyuno.so
#11 0x00007f29b40e742d in pyuno_Loader_get_implementation () at /usr/lib/libreoffice/program/libpythonloaderlo.so
#12 0x00007f29bc2596a7 in  () at /usr/lib/libreoffice/program/libuno_cppuhelpergcc3.so.3

It seems LO can't load Python part.

On which Linux distrib are you?

I'm on Debian testing updated today and I've got the package libreoffice-script-provider-python installed.

I think you need a Libreoffice/Python package.
Comment 15 LOO Debugger 2023-12-29 15:07:23 UTC
I was on Ubuntu and switched to Mint. Should not be a problem since the 2nd is based on the 1rst...

Also I needed a 7.x LOo a few months ago, so I set up a PPA:
```
$ cat /etc/apt/sources.list.d/libreoffice-ubuntu-libreoffice-still-jammy.list 
deb https://ppa.launchpadcontent.net/libreoffice/ppa/ubuntu/ jammy main
```

I just did:
# apt install libuno* --reinstall
# apt install libreoffice-script-provider-python --reinstall

But problem is still there...
Comment 16 Julien Nabet 2023-12-29 15:09:12 UTC
(In reply to LOO Debugger from comment #15)
> ...
> I just did:
> # apt install libuno* --reinstall
> # apt install libreoffice-script-provider-python --reinstall
> 
> But problem is still there...

Ok no idea then so uncc myself.
Comment 17 LOO Debugger 2023-12-30 14:32:36 UTC
:(

Thanks anyway for your time & help!
Comment 18 LOO Debugger 2023-12-30 14:45:35 UTC
Additional information:

Reading:
https://superuser.com/questions/1753373/libre-office-create-is-not-enabled-for-python-macro
I tried to install APSO:
https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python

And got this error message in attached picture.

And now when I open libreoffice, I get the generic GUI proposing to create a Writer/Calc/... document.
But whatever I do there (trying to open a Wirter doc or to open the Tools>Extensions menu), now LOo crashes!!! cf. new trace in attachment
Comment 19 LOO Debugger 2023-12-30 14:47:11 UTC
Created attachment 191649 [details]
Trace dumped displayed on CLI after failed attempt to install APSO
Comment 20 LOO Debugger 2023-12-30 14:47:44 UTC
Created attachment 191650 [details]
APSO install attempt failure message
Comment 21 LOO Debugger 2024-01-03 11:05:19 UTC
Bump? Anyone else could try to help?

LOo is totally unusable now... Removing my personal LOo folder, Reinstalling LOo, Reinstalling all UNO python packages, Reinstalling loo-py-provider, using completly new Writer/Calc files, NOTHING helps...

I can't use LOo at all, just because I killed a faulty macro...

1) That's already quite a MAJOR problem per-se...
2) Since it's persistent over any re-install/re-configuration, it probably reflects quite a MAJOR problem in LOo code base, where it seem to modify something way out of its expected reach...
Comment 22 LOO Debugger 2024-01-04 15:43:09 UTC
Hi again,

I found a very hacky workaround: by removing "~/.local/lib/python3.10/site-packages" I managed to regain control of LOo (just removing "uno*" there was not sufficient).

**But I still believe there's a BIG problem if killing a macro results in LOo trashing the users' installed python packages directory...**