From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA63F3858025; Sat, 21 Nov 2020 21:58:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA63F3858025 From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/26930] New: tsearch/tfind tree caches need locking Date: Sat, 21 Nov 2020 21:58:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2020 21:58:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26930 Bug ID: 26930 Summary: tsearch/tfind tree caches need locking Product: elfutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: mark at klomp dot org CC: elfutils-devel at sourceware dot org Target Milestone: --- libdw uses various search trees as (lazy) caches. Specifically struct Dwarf has: /* Search tree for the CUs. */ void *cu_tree; Dwarf_Off next_cu_offset; /* Search tree and sig8 hash table for .debug_types type units. */ void *tu_tree; Dwarf_Off next_tu_offset; Dwarf_Sig8_Hash sig8_hash; /* Search tree for split Dwarf associated with CUs in this debug. */ void *split_tree; /* Search tree for .debug_macro operator tables. */ void *macro_ops; /* Search tree for decoded .debug_line units. */ void *files_lines; struct Dwarf_CU has: /* Known location lists. */ void *locs; struct Dwarf_CFI_s has: /* Search tree for the CIEs, indexed by CIE_pointer (section offset). */ void *cie_tree; /* Search tree for the FDEs, indexed by PC address. */ void *fde_tree; /* Search tree for parsed DWARF expressions, indexed by raw pointer. */ void *expr_tree; struct Dwfl_Module has: void *lazy_cu_root; /* Table indexed by Dwarf_Off of CU. */ When used in a concurrent program they need to be read locked when searched (with tfind) and write locked when updating (with tsearch). See several backtraces in bug #26921 which describes a different concurrent unsafe update mechanism. --=20 You are receiving this mail because: You are on the CC list for the bug.=