From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id BB0B3382CF28 for ; Tue, 7 Jun 2022 06:18:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB0B3382CF28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy02.your-server.de ([78.47.166.47]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nySYG-0001Mv-32; Tue, 07 Jun 2022 08:18:52 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nySYG-000Qtb-0M; Tue, 07 Jun 2022 08:18:52 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id A687B480138; Tue, 7 Jun 2022 08:18:51 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2EpPlvwVoXGZ; Tue, 7 Jun 2022 08:18:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 5F029480190; Tue, 7 Jun 2022 08:18:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rW1CBh3fda1X; Tue, 7 Jun 2022 08:18:51 +0200 (CEST) Received: from [10.10.171.14] (unknown [10.10.171.14]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 2E390480138; Tue, 7 Jun 2022 08:18:51 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------N0wWevHtVb0UYW6GE3Rq0ded" Message-ID: <5ee6a38c-d7f5-ed62-970d-b25aedee3a25@embedded-brains.de> Date: Tue, 7 Jun 2022 08:18:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] Fix stdio init handling Content-Language: en-US To: Hans-Peter Nilsson , newlib@sourceware.org References: <20220606182003.DB8A72041A@pchp3.se.axis.com> From: Sebastian Huber In-Reply-To: <20220606182003.DB8A72041A@pchp3.se.axis.com> X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26564/Mon Jun 6 10:06:17 2022) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 06:18:56 -0000 This is a multi-part message in MIME format. --------------N0wWevHtVb0UYW6GE3Rq0ded Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello Hans-Peter, sorry for breaking your Newlib configuration. I was able to reproduce=20 the issue in RTEMS with a corresponding configuration. The problem=20 didn't show up in our tests since in RTEMS __getreent() returns a=20 thread-specific reentrancy structure. With struct _reent * __getreent (void) { return _impure_ptr; } your test case reproduced the issue. Could you please try the attached=20 patch? We would like to introduce a configuration option for Newlib to use=20 thread-local storage for the members of struct _reent: https://sourceware.org/pipermail/newlib/2022/018855.html With this option, struct _reent is not defined, so using members of=20 _GLOBAL_REENT to maintain global Newlib state would not work. This is=20 why we tried to use dedicated global objects for the FILE object list=20 and the exit handlers. We also would like to make the _REENT_GLOBAL_STDIO_STREAMS option the=20 default Newlib behaviour: https://sourceware.org/pipermail/newlib/2022/019735.html --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ --------------N0wWevHtVb0UYW6GE3Rq0ded Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-__sglue-inititialization.patch" Content-Disposition: attachment; filename="0001-Fix-__sglue-inititialization.patch" Content-Transfer-Encoding: base64 RnJvbSA5NjI5ZWMwYjdhMmU2NTdkNjkzOTYwMjY5NTA2ZmNjNmM3MTVjNmZmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTZWJhc3RpYW4gSHViZXIgPHNlYmFzdGlhbi5odWJl ckBlbWJlZGRlZC1icmFpbnMuZGU+CkRhdGU6IFR1ZSwgNyBKdW4gMjAyMiAwNzo1NTowMiAr MDIwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCBfX3NnbHVlIGluaXRpdGlhbGl6YXRpb24KCkRv IG5vdCBpbml0aWFsaXplIF9fc2dsdWUgd2l0aCB0aGUgRklMRSBvYmplY3RzIG9mIF9HTE9C QUxfUkVFTlQgdG8gYXZvaWQgYQpkb3VibGUgdXNlIGluIHRoZSAhX1JFRU5UX1NNQUxMIGFu ZCAhX1JFRU5UX0dMT0JBTF9TVERJT19TVFJFQU1TIGNvbmZpZ3VyYXRpb25zCndoaWNoIGRp ZG4ndCB1c2UgYSB0aHJlYWQtc3BlY2lmaW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