From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12715 Path: news.gmane.org!.POSTED!not-for-mail From: ardi Newsgroups: gmane.linux.lib.musl.general Subject: Re: tcmalloc compatibility Date: Sun, 15 Apr 2018 13:52:10 +0200 Message-ID: References: <0ea267bf-ea3a-9810-be1a-50e71b6cfce1@denis.im> <20180410143359.GF3094@brightrain.aerifal.cx> <878t9vlzh1.fsf@mid.deneb.enyo.de> <20180410203354.GI4418@port70.net> <20180410204411.GK3094@brightrain.aerifal.cx> <20180410211724.GJ4418@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1523793023 8443 195.159.176.226 (15 Apr 2018 11:50:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2018 11:50:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12731-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 15 13:50:19 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1f7gAl-00026P-7H for gllmg-musl@m.gmane.org; Sun, 15 Apr 2018 13:50:19 +0200 Original-Received: (qmail 5540 invoked by uid 550); 15 Apr 2018 11:52:23 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5486 invoked from network); 15 Apr 2018 11:52:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=OfRzkOnUeXEYIm1zXUWn3a0kJp8CAtE5xVjiPFHiW3A=; b=WP4TkybAGIX3QKGYooeJQLpmileMNqj0BbYRl5JC13yHAWZqJDIiUqO0+x5XRvu9nZ rt5b6cwraWPEAkYSiaDkky1JIH3icphc/TrH/uccBLtRSCGcv+qYcnWLNedKwO5b/w/a 3KeBAeEQx56WvjEnt7wNW3Of6RDKiK26AGPuUGl/SD3Q9Avh4EKqhxrRr690Rv9WFcKq qSq4Pm7Jw2bu1G2390cRD6p5JQmzsnmUWZfuG0/Ve9/LlOG4QZlFwaGzuG7V17G6x/u0 W7wM958QZBksfh5pb+O9RiDM+98EHrh0K1YSSVWK/Jgc4VaE+7fHU2NHjimH0EsEEHHR 9/ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=OfRzkOnUeXEYIm1zXUWn3a0kJp8CAtE5xVjiPFHiW3A=; b=qTtLsMhF0lm5s8yQqVfNVWRV9EFqw2HsC5jJgDn3eC89TU35SkIOgKjzwQGMC/ZLro kwMtaVH8TZP9/MizDLpWsEZhTW+H15woueiuq1HhrNMad5R8NdkcEVNYDEqfQSHm1lhu iv0V6x9ftk51H3sy4G8RS4cuMtFYk0BZlwYoNzCtn84WOqV4eJhyU9vjn4dozXI2hGxe JuN8RPRDm2SKp3XCMbrhM1JaB1Qvm/9MeSDCrbzw7TeVCWrpxC0wLWWR7qOEH/M1a+vD S1D+urddIE2nNT21wc+f7ZZh6U9Wf8PzD5ZaCk9P2gUPRks9B+Gt8+F4WLLG0S81RRsr nh1g== X-Gm-Message-State: ALQs6tCyPHSdPsDJiZNpoIYrihCuz+bHeSwkb9ubZonASEGR3iBtUtnj 7HiIQM1NI51T6TTE4keG0hfiOIhYPdXEk3gx2wA= X-Google-Smtp-Source: AIpwx48rfP+yRjtwYNSnAva8F3iSrskwSM0bQcy9V/G0/xZftDWqF2gL9ABSIPhWQcmsE8rsGWLZSNPQnr3UMwUb/rM= X-Received: by 2002:a24:6e83:: with SMTP id w125-v6mr12126022itc.67.1523793130715; Sun, 15 Apr 2018 04:52:10 -0700 (PDT) In-Reply-To: <20180410211724.GJ4418@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:12715 Archived-At: On Tue, Apr 10, 2018 at 11:17 PM, Szabolcs Nagy wrote: > > then the wrappers with dlsym(RTLD_NEXT,sym) would not work. > (malloc checkers, valgrind, sanitizers etc all do it) I've been using ElectricFence, as my only memory debugger since 1996 or so; mostly with the libc of commercial Unices, but also with glibc in Linux, and with the OSX libc. I never considered I could run into the issues commented in this thread, and in fact I never faced these issues and it always worked as expected (however, I must admit I only use multithreading for accelerating clearly isolated math-intensive loops that don't call malloc-related functions from inside the loop). Said this, when I'm linking with ElectricFence, my brain has the "hack mode flag" ON (I mean, I always had the feeling that I'm working with a temporary hack that can fail whenever my link line contains -lefence , and I'm aware that things can go wrong --I didn't consider thread safety, but anyway I know ElectricFence can fail if the OS syscalls that allocate protected memory at buffer ends change their behaviour in newer versions, or if there's some OS/CPU-dependent subtlety with alignment, etc...) I've not tried to use ElectricFence with musl yet... but reading this, can I suppose it won't work? Is there any "hack mode ON" procedure (yet easy) that would allow to use ElectricFence (assuming non-threaded code, which is always my case). I agree with your commitment to correctness, and I'm not asking for a safe and guaranteed implementation of function interposition, just that sometimes I need to break my binaries to make them crash hard as soon as pointer accesses a byte it shouldn't access. Cheers, ardi