From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eBy0NKBoemP2XAEAbAwnHQ (envelope-from ) for ; Sun, 20 Nov 2022 18:49:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qHO5NKBoemNjdAAAauVa8A (envelope-from ) for ; Sun, 20 Nov 2022 18:49:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6C21F10E2E for ; Sun, 20 Nov 2022 18:49:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owoRD-00080w-Up; Sun, 20 Nov 2022 12:49:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owoRC-00080L-81 for bug-guix@gnu.org; Sun, 20 Nov 2022 12:49:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owoRB-00040g-Vf for bug-guix@gnu.org; Sun, 20 Nov 2022 12:49:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owoRB-0003B2-SG for bug-guix@gnu.org; Sun, 20 Nov 2022 12:49:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#58221: nautilus: Crashes loading KgxNautilus plugin twice (problems with NAUTILUS_EXTENSION_PATH) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 20 Nov 2022 17:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58221 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Baines Cc: tobias.kortkamp@gmail.com, 58221@debbugs.gnu.org, Liliana Marie Prikler Received: via spool by 58221-submit@debbugs.gnu.org id=B58221.166896653112184 (code B ref 58221); Sun, 20 Nov 2022 17:49:01 +0000 Received: (at 58221) by debbugs.gnu.org; 20 Nov 2022 17:48:51 +0000 Received: from localhost ([127.0.0.1]:44503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owoR0-0003AR-Jn for submit@debbugs.gnu.org; Sun, 20 Nov 2022 12:48:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owoQw-0003AC-Pq for 58221@debbugs.gnu.org; Sun, 20 Nov 2022 12:48:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owoQr-0003yu-9P; Sun, 20 Nov 2022 12:48:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=mL2wFA2x1uMjNY10x2dj+NAC+kfjS/ygWxcAVv7NrDM=; b=gOiRvyagAVKyr/PVtM0r GjkZDzvpg/4AutOExj8rJBhvgCb4ccHjxIn34/wFKKipTl2CQXY/pKYlFvEURbHVPiklJ1QlNdVUm yQaRzu6vp0HMbrj149UXMzkTuITP5C6AYZVt/1O4iBXJ6HRrkEd3+3UPJ6RwND1OdBSEBuQCEe8/g ThUo3aojLLkhOyCuzjwmDacxifzaKH9xoQsriM4eUJcvkVlGkiFLXc2p3FoniQ1/6WgUuM4LAxHvw zpzoc3YCk38qOpSQgdlQRpxoYUIYREk7RXT1bKdc+jbGWW74UEge8McLEGFrOdB3FTxqzwLe0aczL pC/24JACbIo7eg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owoQq-0002C0-To; Sun, 20 Nov 2022 12:48:41 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <6a3df82e8c2720bc7d3e792afa1fce5b7be874dc.camel@gmail.com> <87o7tft7da.fsf@cbaines.net> Date: Sun, 20 Nov 2022 18:48:38 +0100 In-Reply-To: <87o7tft7da.fsf@cbaines.net> (Christopher Baines's message of "Thu, 10 Nov 2022 10:42:25 +0000") Message-ID: <87ilj95xft.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668966560; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=mL2wFA2x1uMjNY10x2dj+NAC+kfjS/ygWxcAVv7NrDM=; b=htWKo8SeKwN0981+smUqvxh82ujvyub3iRNW58IZ8fEJY0Y9fN81IrNjfpM/Hy9nfbr0qt 2Y0TQMaqZlKAgGG3VnjOPwVSKP5RQ1aWJ3z1yngbl9soaFPBZ+5yyjrDOmAr+8MwbpApmL 3VEuec2brtpNrqqUe1eQOOItrGfM8xMt2zWzako40ZkBK3BRkXIgTSY1qM4CG2oR4lJ3Xv bEbVZtjreQXz4UEEF0XzJIMOSAe4wOqoXqBcpB9nwqc4MJRQOa4p1oUWUqqHIYQXRnVgJi mOYEw3egBFnlTxmuUpP6kPWV/gW/EDIvIDoe6heTJoJGuOUdfb23GqAnFtDVvw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668966560; a=rsa-sha256; cv=none; b=lMAlxprf/Jju68K+tDdt1NFgB++zEJl+Qo/LM0lMqHqjPiLBaoHL4NjfkChV8s5Q+P0ATn o5XvCIDQeEWmH5UkHHW8rXVl1E501FwGcN8qFEgzFmQAugWO1OLT1vVPdbDpCOLYOsUvIe 5OB3V7hwjO+SE0KK+h9l0V8JEwsA1t6fYeHTWyz69rMdslL6eeV79pPZb7qFKuyV3r3UxG TKUJFy02R76jf/AtOEEXMPlYB5TU89ytWl+DX5AcH55/qpMYb10qBDDUnlYx/yhh3Vi6fC 7TWBdHlu2T2FZtyt86pfcvYEDH7bxCwAxKY7bmeZScSq5bzs9D73Y2eXaMdpIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=gOiRvyag; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=gOiRvyag; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6C21F10E2E X-Spam-Score: 0.09 X-Migadu-Scanner: scn1.migadu.com X-TUID: ZgI/dZNOnXme --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Christopher Baines skribis: > Liliana Marie Prikler writes: > >> Am Samstag, dem 01.10.2022 um 13:29 +0200 schrieb Tobias Kortkamp: >>> Hi, >>>=20 >>> The problem seems to be that NAUTILUS_EXTENSION_PATH contains the >>> same path twice and that it tries to load KgxNautilus from each of >>> the paths: >>>=20 >>> $ echo $NAUTILUS_EXTENSION_PATH >>> /run/current-system/profile/lib/nautilus/site- >>> extensions:/run/current-system/profile/lib/nautilus/site-extensions >>>=20 >>> Running Nautilus like this works fine: >>>=20 >>> $ NAUTILUS_EXTENSION_PATH=3D/run/current- >>> system/profile/lib/nautilus/site-extensions nautilus >> >> I only know of one thing setting this variable, that being nautilus' >> search-path. Do you by chance source some profile multiple times? > > There might be a related issue where there's duplicates in search paths, > I've tested in a simple VM and I see the duplication in > NAUTILUS_EXTENSION_PATH. > > Anyway, this probably should be something that doesn't cause nautilus to > segfault. Agreed! I don=E2=80=99t use GNOME and I don=E2=80=99t even know what KgxNa= utilus is, but here=E2=80=99s a patch that may fix this by ensuring Nautilus doesn=E2= =80=99t load the same extension twice. Could you give it a spin and lemme know if it solves this issue?\ That=E2=80=99ll get us closer to a release. :-) Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 3d942635a2..78e65d7400 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -9671,7 +9671,9 @@ (define-public nautilus name "-" version ".tar.xz")) (sha256 (base32 - "1cncyiyh79w1id6a6s2f0rxmgwl65lp4ml4afa0z35jrnwp2s8cr")))) + "1cncyiyh79w1id6a6s2f0rxmgwl65lp4ml4afa0z35jrnwp2s8cr")) + (patches + (search-patches "nautilus-extension-search-path.patch")))) (build-system meson-build-system) (arguments (list @@ -9685,27 +9687,6 @@ (define-public nautilus (substitute* "test/automated/displayless/meson.build" (("^foreach t: tracker_tests" all) (string-append "tracker_tests = []\n" all))))) - (add-after 'unpack 'make-extensible - (lambda _ - (substitute* "src/nautilus-module.c" - (("static gboolean initialized = FALSE;" all) - (string-append all " -const char *extension_path; -char **extension_dirs, **d; -") - ) - (("load_module_dir \\(NAUTILUS_EXTENSIONDIR\\);" all) - (string-append all - " -extension_path = g_getenv (\"NAUTILUS_EXTENSION_PATH\"); -if (extension_path) -{ - extension_dirs = g_strsplit (extension_path, \":\", -1); - for (d = extension_dirs; d != NULL && *d != NULL; d++) - load_module_dir(*d); - g_strfreev(extension_dirs); -} -"))))) (add-after 'unpack 'skip-gtk-update-icon-cache ;; Don't create 'icon-theme.cache'. (lambda _ diff --git a/gnu/packages/patches/nautilus-extension-search-path.patch b/gnu/packages/patches/nautilus-extension-search-path.patch new file mode 100644 index 0000000000..aa870d9212 --- /dev/null +++ b/gnu/packages/patches/nautilus-extension-search-path.patch @@ -0,0 +1,72 @@ +diff --git a/src/nautilus-module.c b/src/nautilus-module.c +index bf474bd..42e2a4e 100644 +--- a/src/nautilus-module.c ++++ b/src/nautilus-module.c +@@ -211,6 +211,10 @@ static void + load_module_dir (const char *dirname) + { + GDir *dir; ++ static GHashTable *loaded = NULL; ++ ++ if (loaded == NULL) ++ loaded = g_hash_table_new (g_str_hash, g_str_equal); + + dir = g_dir_open (dirname, 0, NULL); + +@@ -221,15 +225,22 @@ load_module_dir (const char *dirname) + while ((name = g_dir_read_name (dir))) + { + if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) +- { +- char *filename; +- +- filename = g_build_filename (dirname, +- name, +- NULL); +- nautilus_module_load_file (filename); +- g_free (filename); +- } ++ { ++ /* Make sure each module is loaded only twice or this could ++ lead to a crash. Double loading can occur if DIRNAME ++ occurs more than once in $NAUTILUS_EXTENSION_PATH. */ ++ if (!g_hash_table_contains (loaded, name)) ++ { ++ char *filename; ++ ++ filename = g_build_filename (dirname, ++ name, ++ NULL); ++ nautilus_module_load_file (filename); ++ g_hash_table_add (loaded, g_strdup (name)); ++ g_free (filename); ++ } ++ } + } + + g_dir_close (dir); +@@ -257,10 +268,24 @@ nautilus_module_setup (void) + + if (!initialized) + { ++ const gchar *extension_path; + initialized = TRUE; + + load_module_dir (NAUTILUS_EXTENSIONDIR); + ++ /* Load additional modules from the user-provided search path. */ ++ extension_path = g_getenv ("NAUTILUS_EXTENSION_PATH"); ++ if (extension_path) ++ { ++ char **extension_dirs, **d; ++ ++ extension_dirs = g_strsplit (extension_path, ":", -1); ++ for (d = extension_dirs; d != NULL && *d != NULL; d++) ++ load_module_dir (*d); ++ ++ g_strfreev (extension_dirs); ++ } ++ + eel_debug_call_at_shutdown (free_module_objects); + } + } --=-=-=--