Skip to content

Segmentation fault with uno 24.2.5 ooo-dev-tools 0.47.7 using Python 3.12.4 #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JulienPalard opened this issue Aug 2, 2024 · 8 comments

Comments

@JulienPalard
Copy link

Hello!

I'm on Debian trixie running:

$ apt-cache policy python3 python3-uno
python3:
  Installed: 3.12.4-1
  Candidate: 3.12.4-1
  Version table:
 *** 3.12.4-1 500
        500 http://ftp.fr.debian.org/debian trixie/main amd64 Packages
        100 /var/lib/dpkg/status
python3-uno:
  Installed: 4:24.2.5-1
  Candidate: 4:24.2.5-1
  Version table:
 *** 4:24.2.5-1 500
        500 http://ftp.fr.debian.org/debian trixie/main amd64 Packages
        100 /var/lib/dpkg/status

I'm using a venv built from the system Python (3.12.4) with system packages (so ooo-dev-tools can see system Uno), and I'm installing ooo-dev-tools in the venv:

$ python3 -m venv .venv --system-site-packages
$ source .venv/bin/activate
$ pip install ooo-dev-tools
[...]
Successfully installed ooo-dev-tools-0.47.7 ooouno-2.1.2 types-uno-script-0.1.1 types-unopy-1.2.3 typing-extensions-4.12.2

Then when doing some imports I'm getting a segfault:

$ python
Python 3.12.4 (main, Jul 15 2024, 12:17:32) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ooodev.calc import Calc, CalcDoc
Fatal Python error: Segmentation fault

Current thread 0x00007fd5a5fe0080 (most recent call first):
  File ".venv/lib/python3.12/site-packages/ooodev/utils/data_type/generic_size_pos.py", line 7 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/loader/inst/lo_inst.py", line 55 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/loader/inst/__init__.py", line 4 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1310 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/loader/lo.py", line 31 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/loader/__init__.py", line 1 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/utils/data_type/cell_obj.py", line 9 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3/dist-packages/uno.py", line 349 in _uno_import
  File ".venv/lib/python3.12/site-packages/ooodev/calc/__init__.py", line 6 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "<stdin>", line 1 in <module>

Extension modules: pyuno (total: 1)
Segmentation fault
@Amourspirit
Copy link
Owner

I have not tested Python 3.12 just yet. I am not certain that is the issue; However I noticed that the issue starts with:

...data_type/generic_size_pos.py", line 7 

Which is:

T = TypeVar(name="T", bound=Union[int, float])

I know python 3.12 made some changes to the type system but I don't know yet if these are breaking changes.

I have limited time to test this right now, I am hoping I can get to testing this in the next few days. If you have anything to add I welcome it.

@Amourspirit
Copy link
Owner

This is looking like it a python 3.12 specefic error.
TypeVar with bad arguments segfault/misbehavior #118814

I will see if I can find a workaround for this.

@Amourspirit
Copy link
Owner

I just published ooo-dev-tools 0.47.8 This should work as a workaround.

@JulienPalard
Copy link
Author

Thanks for the work @Amourspirit !

I just tried 0.47.8 but no luck, I'm now getting:

Fatal Python error: Segmentation fault

Current thread 0x00007f0320971080 (most recent call first):
  File ".venv/lib/python3.12/site-packages/ooodev/utils/data_type/generic_size_pos.py", line 10 in <module>
   [...]

@Amourspirit
Copy link
Owner

Thanks for the feedback.
I am hoping to get more into this in the next day or two.

@Amourspirit
Copy link
Owner

OK, I have made more changes to correct this issue.
Version 0.47.9 is published hopfully works arround the python issue.

If you installed OooDev as an extension then please run the extension manager an update.

@JulienPalard
Copy link
Author

Yes, it works, thank you very much for the fix!

@Amourspirit
Copy link
Owner

Excellent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants