From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A795386486C; Mon, 5 Jul 2021 14:05:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A795386486C From: "Simon.Richter at hogyros dot de" To: glibc-bugs@sourceware.org Subject: [Bug malloc/25533] dlopen with RTLD_DEEPBIND crashes when using custom memory manager Date: Mon, 05 Jul 2021 14:04:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: malloc X-Bugzilla-Version: 2.12 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Simon.Richter at hogyros dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2021 14:05:00 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25533 Simon Richter changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Simon.Richter at hogyros d= ot de --- Comment #5 from Simon Richter --- I have the same issue with a program that uses libtbbmalloc (overriding malloc/realloc/free) and calls dlopen("libudev.so.1", RTLD_DEEPBIND). This creates a situation where libudev is linked against glibc only and doe= sn't see the overridden allocator, but the glibc instance it is linked to does h= ave these symbols overridden. The crash happens when libudev calls strdup() from glibc, which allocates memory from TBBmalloc, and later tries to pass the pointer to glibc's reall= oc() function. As far as I can see, this cannot be worked around other than by inhibiting RTLD_DEEPBIND (which is what I do in a preload library). The proper fix here would be to create another instance of glibc for use by= the hierarchy below the RTLD_DEEPBIND. --=20 You are receiving this mail because: You are on the CC list for the bug.=