From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60639 invoked by alias); 25 Jun 2017 06:18:05 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 59496 invoked by uid 89); 25 Jun 2017 06:16:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=freertos, (unknown), safety!, malloc_r X-HELO: smtpo68.poczta.onet.pl Received: from smtpo68.poczta.onet.pl (HELO smtpo68.poczta.onet.pl) (141.105.16.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Jun 2017 06:16:05 +0000 Received: from [192.168.2.253] (77-253-36-69.adsl.inetia.pl [77.253.36.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: freddie_chopin@op.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 3wwMPQ4BZLzlkmV2 for ; Sun, 25 Jun 2017 08:15:37 +0200 (CEST) Message-ID: <1498371337.1704.1.camel@op.pl> Subject: Re: Confusion about possibly unsafe malloc_r? From: Freddie Chopin To: newlib@sourceware.org Date: Sun, 25 Jun 2017 06:18:00 -0000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00470.txt.bz2 On Sat, 2017-06-24 at 18:42 -0400, Dave Nadler wrote: > Is this OK? I'm paranoid about thread safety! Then it's worth mentioning that newlib and FreeRTOS will _NEVER_ be fully thread safe unless you are using a toolchain with retargetable locks and your project has support code for these locks. printf()-style families partially use global reent structure, this is expected. Trace the calls of the mentioned functions in newlib source and you'll see that sometimes _GLOBAL_REENT is used, sometimes thread's reent. Regards, FCh