From owner-freebsd-hackers Sun Oct 22 22:22:09 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id WAA22169 for hackers-outgoing; Sun, 22 Oct 1995 22:22:09 -0700 Received: from subnet.sub.net (root@subnet.sub.net [192.101.75.3]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id WAA22164 for ; Sun, 22 Oct 1995 22:22:05 -0700 Received: from ud.dinoex.sub.org (root@localhost) by subnet.sub.net (8.6.12/8.6.12) with UUCP id GAA07949 for freebsd.org!freebsd-hackers; Mon, 23 Oct 1995 06:21:26 +0100 Received: from phase23.dinoex.sub.org by ud.dinoex.sub.org with uucp (Linux Smail3.1.28.1 #14) id m0t74rA-000JiRC; Sun, 22 Oct 95 19:10 MET Received: from citylink.dinoex.sub.org by phase23.dinoex.sub.org with uucp (CY Smail3.1.28.1 #6) id m0t723c-0005KkC; Sun, 22 Oct 95 16:11 MET From: peter@citylink.dinoex.sub.org (Peter Much) Date: Fri, 20 Oct 1995 01:03:39 +0100 Message-Id: <199510200003.BAA14324@citylink.dinoex.sub.org> Received: by citylink.dinoex.sub.org (8.6.12 FreeBSD-1/PMuch) id BAA14324; Fri, 20 Oct 1995 01:03:39 +0100 To: freebsd-hackers@freebsd.org Newsgroups: comp.unix.bsd.freebsd.misc Subject: modf.S (in libc.a): stack access fault Summary: ingres cannot handle float values Reply-To: admin@citylink.dinoex.sub.org Organization: Buero fuer Sektenforschung und Qualitaetspruefung in der Esoterik Keywords: ingres float exception modf() libc Sender: owner-hackers@freebsd.org Precedence: bulk The funktion modf() (in libc.a, from lib/libc/i386/gen/modf.S) seems to dismangle the program stack. This is the reason why ingres cannot handle float values with FreeBSD (and other OS's - i reported that here, somewhen about May). If linked with lib/msun/src/s_modf.c instead, it does work. A friend of mine had already reported this bug to Borland/Heimsoeth years ago - so it was obviously not the latest version of the Borland compiler library that made it into FreeBSD.:-(( To reproduce the error, try the following code: ---------------------------------------------------------------------- #include main() { double arg = 0.0, fj; int i; char *p, buf[21]; p = buf; for(i=0; i < 20; i++) { arg *= 10; (void)modf(arg, &fj); arg -= fj; *p++ = (int)fj + '0'; } *p = '\0'; printf("%s\n", buf); } ---------------------------------------------------------------------- It crashes with i=7. I don't know math-copro-assembler, so i cannot debug this. Peter P.S: Anybody wanting the ingres patches to build a port? -- Write to: Peter Much * Koelnische Str. 22 * D-34117 Kassel * +49-561-774961 peter@citylink.dinoex.sub.org * much@hrz.uni-kassel.de