From owner-freebsd-ports-bugs@freebsd.org Tue Oct 13 04:26:46 2020 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9832B430DFA for ; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9MvB3dy5z457s for ; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 7B1204312B1; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) Delivered-To: ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AD254312B0 for ; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9MvB2XLcz454Z for ; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3696F17B86 for ; Tue, 13 Oct 2020 04:26:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 09D4QkPO050790 for ; Tue, 13 Oct 2020 04:26:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 09D4QkRO050788 for ports-bugs@FreeBSD.org; Tue, 13 Oct 2020 04:26:46 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 250311] devel/glib20: lock getfsent() usage to fix x11-fm/thunar crashes Date: Tue, 13 Oct 2020 04:26:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: sigsys@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 04:26:46 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250311 Bug ID: 250311 Summary: devel/glib20: lock getfsent() usage to fix x11-fm/thunar crashes Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: sigsys@gmail.com CC: desktop@FreeBSD.org, xfce@FreeBSD.org CC: desktop@FreeBSD.org, xfce@FreeBSD.org I had thunar crashing from time to time (especially in large directories) d= ue to concurrent use of getfsent() (which is not thread-safe). (gdb) bt #0 _flockfile (fp=3D0x0) at /usr/src/lib/libc/stdio/_flock_stub.c:68 #1 0x000000080bf59deb in fgets (buf=3D0x80bf8ff90 "\n", n=3D1024, fp=3D0x0= ) at /usr/src/lib/libc/stdio/fgets.c:61 #2 0x000000080be7a1b4 in fstabscan () at /usr/src/lib/libc/gen/fstab.c:121 #3 0x000000080be7a03c in getfsent () at /usr/src/lib/libc/gen/fstab.c:227 #4 0x000000080a181c28 in g_unix_mount_points_get () at /usr/local/lib/libgio-2.0.so.0 #5 0x000000080a181da9 in g_unix_mount_point_at () at /usr/local/lib/libgio-2.0.so.0 #6 0x000000080a1e0811 in () at /usr/local/lib/libgio-2.0.so.0 #7 0x000000080a1e0624 in () at /usr/local/lib/libgio-2.0.so.0 #8 0x000000080a1e4235 in () at /usr/local/lib/libgio-2.0.so.0 #9 0x000000080a1e3d4e in () at /usr/local/lib/libgio-2.0.so.0 #10 0x000000080a116a88 in g_file_enumerator_next_file () at /usr/local/lib/libgio-2.0.so.0 #11 0x000000000027ca39 in () #12 0x000000000027c1ed in () #13 0x00000000002a54ee in () #14 0x0000000801f97b86 in () at /usr/local/lib/libexo-2.so.0 #15 0x000000080a12bd9e in () at /usr/local/lib/libgio-2.0.so.0 #16 0x000000080a15fc45 in () at /usr/local/lib/libgio-2.0.so.0 #17 0x000000080ae6b483 in () at /usr/local/lib/libglib-2.0.so.0 #18 0x000000080ae6a272 in () at /usr/local/lib/libglib-2.0.so.0 #19 0x0000000806d1afac in thread_start (curthread=3D0x87f425400) at /usr/src/lib/libthr/thread/thr_create.c:292 #20 0x0000000000000000 in () Adding this patch fixes the problem. devel/glib20/files/patch-gio_gunixmounts.c --- gio/gunixmounts.c.orig 2020-10-01 09:17:53.138733000 -0400 +++ gio/gunixmounts.c 2020-10-13 00:14:04.413638000 -0400 @@ -1389,6 +1389,8 @@ #elif (defined(HAVE_GETVFSSTAT) || defined(HAVE_GETFSSTAT)) && defined(HAVE_FSTAB_H) && defined(HAVE_SYS_MOUNT_H) +G_LOCK_DEFINE_STATIC(getfsent); + static GList * _g_get_unix_mount_points (void) { @@ -1433,6 +1435,7 @@ #endif #endif + G_LOCK (getfsent); while ((fstab =3D getfsent ()) !=3D NULL) { gboolean is_read_only =3D FALSE; @@ -1468,6 +1471,7 @@ } endfsent (); + G_UNLOCK (getfsent); return g_list_reverse (return_list); } --=20 You are receiving this mail because: You are the assignee for the bug.=