From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 821 invoked from network); 7 Jan 2021 11:20:43 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 7 Jan 2021 11:20:43 -0000 Received: (qmail 19750 invoked by uid 550); 7 Jan 2021 11:20:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 18029 invoked from network); 7 Jan 2021 11:17:45 -0000 X-IronPort-AV: E=Sophos;i="5.79,329,1602540000"; d="scan'208";a="369294942" Date: Thu, 07 Jan 2021 12:17:33 +0100 Message-Id: From: Paul Zimmermann To: musl@lists.openwall.com Subject: [musl] issue with exp10l Hi, I am extending my comparison of the accuracy of several mathematical libraries to the "double extended precision" (long double on x86_64). First I notice that Musl does not provide j0, j1, y0, and y1 for the long double format. Do you confirm? Then I got a segmentation fault using exp10l with NaN input with a non-zero payload. $ cat test_exp10.c #define _GNU_SOURCE typedef union { __uint128_t n; long double x; } union_t; #include #include int main() { union_t u; u.n = 16383UL; u.n = u.n << 64; u.n = u.n | 629329181547216221UL; /* u.n = 302213637488765131341149 */ long double x = u.x; printf ("x=%La\n", x); fflush (stdout); long double y; y = exp10l (x); printf ("y=%La\n", y); fflush (stdout); return 0; } With glibc this works fine: $ gcc -fno-builtin test_exp10.c -lm $ ./a.out x=nan y=-nan With Musl 1.2.1 I get: $ ./a.out x=nan Segmentation fault According to gdb, the issue is in pow10l: Program received signal SIGSEGV, Segmentation fault. 0x000055555555d10e in pow10l () (gdb) where #0 0x000055555555d10e in pow10l () #1 0x0000000080000000 in ?? () #2 0x0000000000003fff in ?? () #3 0x0000000000000000 in ?? () Best regards, Paul