Bug 1212474 - Nautilus: Segmentation fault (core dumped) with libpython3_11-1_0-x86-64-v3 (works with non-v3 optimized library)
Summary: Nautilus: Segmentation fault (core dumped) with libpython3_11-1_0-x86-64-v3 (...
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Python (show other bugs)
Version: Current
Hardware: x86-64 Other
: P5 - None : Normal with 6 votes (vote)
Target Milestone: ---
Assignee: Daniel Garcia
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-17 14:10 UTC by Iron Bone
Modified: 2023-07-10 07:12 UTC (History)
17 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
gdb backtrace of crash (21.79 KB, text/plain)
2023-06-17 19:40 UTC, Atri Bhattacharya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iron Bone 2023-06-17 14:10:32 UTC
After (last update and) starting nautilius I get the following

>nautilus
>** Message: 16:05:22.598: Connecting to org.freedesktop.Tracker3.Miner.Files
>Segmentation fault (core dumped)
Comment 1 Jurgen Schellaert 2023-06-17 15:08:35 UTC
I'm seeing the same. 

I have tried the newer version from gnome:factory but I still get segmentation fault.
Comment 2 Atri Bhattacharya 2023-06-17 19:40:55 UTC
Created attachment 867653 [details]
gdb backtrace of crash

I see the same. Managed to get a gdb backtrace in case that helps.
Comment 3 Vernius 2023-06-18 09:51:49 UTC
The latest TW update has broken Nautilus on my laptop. I get this error:
** Message: 11:06:40.235: Connecting to org.freedesktop.Tracker3.Miner.Files
fish: Job 1, 'nautilus' terminated by signal SIGSEGV (Address boundary error)
Comment 4 Harald van Bree 2023-06-18 10:54:19 UTC
I had the same error since I've updated on Jun 16th

Current version:
NAME="openSUSE Tumbleweed"
# VERSION="20230616"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20230616"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20230616"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"

I managed to resolve this issue by removing: nautilus-extension-tilix
Once that nautilus extension has been removed from my system, I can start nautilus again
Comment 5 Vernius 2023-06-18 11:45:51 UTC
(In reply to Harald van Bree from comment #4)
> I had the same error since I've updated on Jun 16th
> 
> Current version:
> NAME="openSUSE Tumbleweed"
> # VERSION="20230616"
> ID="opensuse-tumbleweed"
> ID_LIKE="opensuse suse"
> VERSION_ID="20230616"
> PRETTY_NAME="openSUSE Tumbleweed"
> ANSI_COLOR="0;32"
> CPE_NAME="cpe:/o:opensuse:tumbleweed:20230616"
> BUG_REPORT_URL="https://bugzilla.opensuse.org"
> SUPPORT_URL="https://bugs.opensuse.org"
> HOME_URL="https://www.opensuse.org"
> DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
> LOGO="distributor-logo-Tumbleweed"
> 
> I managed to resolve this issue by removing: nautilus-extension-tilix
> Once that nautilus extension has been removed from my system, I can start
> nautilus again

Thank you. Solved
Comment 6 Atri Bhattacharya 2023-06-18 12:52:45 UTC
(In reply to Harald van Bree from comment #4)
> 
> I managed to resolve this issue by removing: nautilus-extension-tilix
> Once that nautilus extension has been removed from my system, I can start
> nautilus again

Does not work for me, unfortunately. Removed all nautilus extensions, but still no luck.
Comment 7 Iron Bone 2023-06-18 15:08:35 UTC
Also, for the problem is not solved this way. On a fresh installation of openSUSE the problem does not exist even with nautilus-extension-tilix installed. So there must be conflict with something.
Comment 8 Iron Bone 2023-06-18 15:10:39 UTC
Also, this is not connected with user specific extension. The same problem on a new created user
Comment 9 Stefan Sauer 2023-06-18 15:31:23 UTC
I first tried to simply reinstall tilix and the extension, but that did not help. Right now I also have to remove the extension.
Comment 10 Atri Bhattacharya 2023-06-18 16:52:31 UTC
(In reply to Stefan Sauer from comment #9)
> I first tried to simply reinstall tilix and the extension, but that did not
> help. Right now I also have to remove the extension.

Seems that any python-nautilus extension currently causes nautilus to crash. It could be the tilix extension, or as in my case nautilus-gsconnect.py installed to ~/.local/share/nautilus-python/extension/. Deleting all extensions installed to that latter dir, alongside using zypper to uninstall nautilus-extension-* helped nautilus start in my case.

Indeed after getting it to start, just copy pasting the TestExtension.py example [1] to ~/.local/share/nautilus-python/extension/ will once again cause nautilus to crash. Here is the debugging output on terminal:


> ~> NAUTILUS_PYTHON_DEBUG=misc nautilus                                                                                                             > ** Message: 22:19:26.177: Connecting to org.freedesktop.Tracker3.Miner.Files
> nautilus_module_initialize: entered
> nautilus_python_load_dir: entered dirname=/home/badshah/.local/share/nautilus-python/extensions
> nautilus-python:g_module_open /usr/lib64/libpython3.11.so.1.0
> nautilus-python:Py_Initialize
> nautilus-python:PySys_SetArgv
> nautilus-python:Sanitize the python search path
> nautilus-python:init_pygobject
> Segmentation fault (core dumped)

[1] https://gitlab.gnome.org/GNOME/nautilus-python/-/blob/master/examples/TestExtension.py
Comment 11 Emiliano Langella 2023-06-18 18:15:55 UTC
I had the same issue, and I confirm that comment#4 solved the issue.
Comment 12 PJ J 2023-06-18 19:25:16 UTC
on my end I had to remove all Python extensions - which is a real bummer as they are among the core features I use on Nautilus on a daily basis (titlix, gsconnect and sublimetext extensions).
This seems to have appeared with a bump to Python 3.11 .
Comment 13 Dominique Leuenberger 2023-06-19 06:55:46 UTC
A different solution, which has less impact on the user is to remove/block
  libpython3_11-1_0-x86-64-v3
for the time being. 

Seems either python gets mis-optimized on v3 hardware or nautilus does something weird there.

But with this removed from the system, nautilus can be used with python extensions.

Assigning to python as component
Comment 14 Atri Bhattacharya 2023-06-19 06:59:25 UTC
(In reply to Dominique Leuenberger from comment #13)
> A different solution, which has less impact on the user is to remove/block
>   libpython3_11-1_0-x86-64-v3
> for the time being. 
> 
> Seems either python gets mis-optimized on v3 hardware or nautilus does
> something weird there.
> 
> But with this removed from the system, nautilus can be used with python
> extensions.
> 

Many thanks. I can confirm that that works very well.
Comment 15 Johannes Weberhofer 2023-06-19 09:37:26 UTC
I had to remove nautilus-extension-nextcloud to get nautilus running again.
Comment 16 Atri Bhattacharya 2023-06-19 09:45:32 UTC
(In reply to Johannes Weberhofer from comment #15)
> I had to remove nautilus-extension-nextcloud to get nautilus running again.

Even with libpython3_11-1_0-x86-64-v3 uninstalled? I also had to get rid of nautilus-extension-nextcloud, but with libpython3_11-1_0-x86-64-v3 now out my system, I have installed it back and it works.
Comment 17 Johannes Weberhofer 2023-06-19 09:49:55 UTC
(In reply to Atri Bhattacharya from comment #16)
> (In reply to Johannes Weberhofer from comment #15)
> > I had to remove nautilus-extension-nextcloud to get nautilus running again.
> 
> Even with libpython3_11-1_0-x86-64-v3 uninstalled? I also had to get rid of
> nautilus-extension-nextcloud, but with libpython3_11-1_0-x86-64-v3 now out
> my system, I have installed it back and it works.

I have libpython3_11-1_0 and libpython3_11-1_0-x86-64-v3 installed and only removed nautilus-extension-nextcloud.

The only extensions left are nautilus-extension-seahorse and nautilus-extension-terminal (didn't install much)
Comment 18 Atri Bhattacharya 2023-06-19 10:33:53 UTC
(In reply to Johannes Weberhofer from comment #17)
> 
> I have libpython3_11-1_0 and libpython3_11-1_0-x86-64-v3 installed and only
> removed nautilus-extension-nextcloud.
> 
> The only extensions left are nautilus-extension-seahorse and
> nautilus-extension-terminal (didn't install much)

No, please see comment 13; the bug is in libpython3_11-1_0-x86-64-v3. Remove that package and you can install back all your necessary nautilus-extension-* packages without a problem.
Comment 19 Iron Bone 2023-06-19 11:19:56 UTC
Confirmed. Uninstalling libpython3_11-1_0-x86-64-v3 solves the problem
Comment 20 Johannes Weberhofer 2023-06-19 11:30:09 UTC
(In reply to Atri Bhattacharya from comment #18)
> (In reply to Johannes Weberhofer from comment #17)
> > 
> > I have libpython3_11-1_0 and libpython3_11-1_0-x86-64-v3 installed and only
> > removed nautilus-extension-nextcloud.
> > 
> > The only extensions left are nautilus-extension-seahorse and
> > nautilus-extension-terminal (didn't install much)
> 
> No, please see comment 13; the bug is in libpython3_11-1_0-x86-64-v3. Remove
> that package and you can install back all your necessary
> nautilus-extension-* packages without a problem.

I've now done that and it works. Thanks!
Comment 21 Eyad Issa 2023-06-23 11:54:17 UTC
Also for me removing libpython3_11-1_0-x86-64-v3 resolves the issue.
Comment 22 Austin Morgan 2023-06-28 02:31:05 UTC
This solution also worked for me.
Comment 23 Daniel Garcia 2023-07-03 12:11:39 UTC
I've been debugging and trying different approximations to detect what's happening here and I've discovered something. Looks like the python-nautilus extension looks for the libpython.so [1] in the default libdir and is using a different version from the loaded v3.

I've tested building with the PYTHON_LIBPATH pointing to the v3 and in that case it works. Now I just need to patch to make it sure that it picks the correct version depending on the installed libpython.

[1] https://gitlab.gnome.org/GNOME/nautilus-python/-/blob/master/src/nautilus-python.c#L158
Comment 24 Daniel Garcia 2023-07-03 16:05:00 UTC
This patch fixes the issue [1]. I'm not sure if it's the best solution, but at least this works for me, with and without the libpython3_11-1_0-x86-64-v3 installed.

[1] https://build.opensuse.org/request/show/1096629
Comment 25 Daniel Garcia 2023-07-04 15:45:01 UTC
This simplest patch also fixes the issue in TW:

https://build.opensuse.org/request/show/1096798

There's also a discussion happening upstream about it, and as far as I can tell, this fix will be problematic with using a python interpreter different from the system python, that's something that I think doesn't affect the TW package.

https://gitlab.gnome.org/GNOME/nautilus-python/-/issues/21#note_1783240
Comment 26 Matej Cepl 2023-07-10 06:12:33 UTC
*** Bug 1212482 has been marked as a duplicate of this bug. ***
Comment 27 Daniel Garcia 2023-07-10 07:12:55 UTC
Fix published in TW