From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic303-20.consmr.mail.ir2.yahoo.com (sonic303-20.consmr.mail.ir2.yahoo.com [77.238.178.201]) by sourceware.org (Postfix) with ESMTPS id 1CB943860017 for ; Tue, 28 Apr 2020 12:06:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1CB943860017 X-YMail-OSG: mIYE5X8VM1mxJ_RBDGZZnZO4B5rmmrfk8YzcMkLbG_r.9KZwh1jtWeT6zl0Daqk giZXAGMOmSUbZrDml8S2LIduN7LCcJ2fsvX2IAdCcA0BOW7kGp0c5mmEjH9rYEfE3C7tmTSyKiWo GKxTY2wgRKy2Sy_Ws2oDLIl4IiMnHrA2HNQ7a0JJfg9vdqOMNCzCCEM0Y8WPRJf0QgoEK7cvlbEQ Z4tMEzuvUzVkR0mTInm9vjikC1PdeElG2veQkP7LzFKoyWPTRcTaDan5VroDuwVPnaDV7WqxJISi SSREo__bA8k5hd_DxxKvotRyVeLX2OA1ekOjL0eHKj7SV79E5AOAf6ZBfPM1hJNgh3AZpnoEn4lJ Kcem8Uij2jBcs4hfP_pGxeoYfRpTjp7AoBieyE0fdtLxe1SKGy9n68GTXptTvXHY.zhIeTIvOIuE xoWeYHBcwvHp8_8US_w.Uj6ube8luguhm3Vw5thtvUVZEgCuortEuE7rd8dXAQmlR99_D1IUEGoL 8lz80p1W3KUNEp2Lj6JWDcK9a5kf3vjPTOGHaP0zjnsU1VprkO5eeo3AHouldr0XhGMzsIafpefE Bf4f_cZsihnk6sMo.zxuucrE3C4hGQwZqyxfsrFBetItVewOIZnhmhhPLlTtbTcdYy6EGfm5kEcn 9b7O0qI0LavdqTsVbiIPIt0gSXYr9akgOS.aPHv04xSY5Gv3pw24VZZVvyXV.kIqH_FwLsK8mVky PCu82ZSFbElkY71HDuHJOrYMeeLnTHnR8KE5aA3zDz9e8cXL1Xse8DMhBTmGrQ3MqxG1K3hGiWIJ FKETtijik3BnCzHvOsyhOIeHVq1xwMOvnumZpDuvzU57BfRBhmqH8qgyOmX.jDhSpsJcbGrmj6gV elO6XIq9aC37fjyLwZVven6jCs8rVUrEMmqJuT62XnjMY.Rz8Ow7FJS6AiJle5CoWod_kpZJg7lc LWRmPedzHFaw0RZ7Sc5e9wBaD6xVRM6Vu7aZPw9A40pew2dpx5Kpv0BH7V9Tmj4qZOOgW3Z85Zh8 ou.j_LQHIW0zmlC6_dNyyBEPNLP6AaFqceJt8blMDPkZj4kwv1H6E.XSxM9LRWEKCsyhuRPKhWc0 KZJOkntui7CdOQzLBVlCZrFuD0cmBkgSFl0Qasss_7aRtQ7WEIoxFH0dXYu.vcL28203IQU_cCXd ylctU_lZKbQCQhfyLZ142OSV6W0MjGihi4w5dC4ykdz4gPAfou6cbjO4FCmzToE67QlxYdmZ3.pJ F9nMPtaS0aRla6T01UFZqoIHnQ2Rc3w5cBaBuz5tua44.nMmVMYakaBC6zlHoU4ayb5yAay_tkJG wwvnx3cl2Be5nGe1GlWBfI_2H8XkWzHATFEHFwbyqcfJX_C_3vLcj_sCEtaw2Fr60Nmj0ns0Q2be ERWCr4dnY8ie9IeJk.ict.5Bdq1vIMcO.j0f0C932 Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Tue, 28 Apr 2020 12:06:28 +0000 Date: Tue, 28 Apr 2020 12:06:24 +0000 (UTC) From: "R. Diez" To: Jeff Johnston Cc: "newlib@sourceware.org" Message-ID: <1949956947.2883373.1588075584956@mail.yahoo.com> In-Reply-To: References: <989180140.2023825.1588003097077.ref@mail.yahoo.com> <989180140.2023825.1588003097077@mail.yahoo.com> <1918742529.2295153.1588019348307@mail.yahoo.com> Subject: Re: _REENT_CHECK_VERIFY calls __assert_func even if NDEBUG is defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15756 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 28 Apr 2020 12:06:40 -0000 > An alternative change would require modifications to all the > existing conversion routines using eBalloc() and their callers > to do checking of return values and bubble up to the user, > setting errno to ENOMEM. I am not sure what conversion routines you are referring to. I found this i= ssue with rand(), because lwIP needs a source of random numbers. It is norm= ally not expected that rand() calls malloc(). rand() returns no error indic= ation, according to the POSIX standard: https://pubs.opengroup.org/onlinepubs/9699919799/functions/rand.html So using errno here is difficult. rand() ends up calling _REENT_CHECK, which does a malloc(). What do you mea= n with eBalloc()? =C2=A0=C2=A0 > The memory in question is being allocated by Balloc() > which is part of the mprec.c solution used in newlib. > The allocated _REENT_MP_FREELIST has an array > of storage to reuse for different k values so newlib will reuse > [...] Does that apply in my scenario? I am building Newlib without thread support= . There is no reent creation or destruction, as far as I can tell. I have been digging further, and I believe (the code is not easy to follow)= that these unexpected allocations come from using the "small reent". What = does --enable-newlib-reent-small actually do? The README file at this locat= ion: =C2=A0 https://sourceware.org/newlib/README has this description: =C2=A0 `--enable-newlib-reent-small' =C2=A0=C2=A0=C2=A0 Enable small reentrant struct support. =C2=A0=C2=A0=C2=A0 Disabled by default. But it does not really say what the difference between the normal and "smal= l" versions is. Thanks in advance, =C2=A0 rdiez