From owner-freebsd-ports Tue Sep 29 11:06:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA07664 for freebsd-ports-outgoing; Tue, 29 Sep 1998 11:06:38 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from mfo01.iij.ad.jp (mfo01.iij.ad.jp [202.232.2.118]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA07507 for ; Tue, 29 Sep 1998 11:05:55 -0700 (PDT) (envelope-from kiroh@pp.iij4u.or.jp) Received: from pp.iij4u.or.jp (root@pp.iij4u.or.jp [210.130.0.40]) by mfo01.iij.ad.jp (8.8.8/MFO1.1) with ESMTP id DAA15194 for ; Wed, 30 Sep 1998 03:05:30 +0900 (JST) Received: from nya (h097.p049.iij4u.or.jp [210.130.49.97]) by pp.iij4u.or.jp (8.8.8+2.2IIJ/4U1.1) with SMTP id DAA22520 for ; Wed, 30 Sep 1998 03:05:29 +0900 (JST) Date: Wed, 30 Sep 1998 03:05:29 +0900 (JST) Message-Id: <199809291805.DAA22520@pp.iij4u.or.jp> From: kiroh@pp.iij4u.or.jp (HARADA Kiroh) To: ports@FreeBSD.ORG Subject: POVRAY port fix (FPE problem fix) X-Mailer: mnews [version 1.20PL5] 1997-07/01(Tue) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Dear porters, I found that the port of POVRAY-3.0 eventually crashes with floating exception. The cause was that FreeBSD does not handle floating point exception in IEEE 754 manner. Attached is the patch to prevent povray crash with FPE. It masks several FPEs in the beginning of the problem and restores them at the end. Please update the port as appropriate. Thank you. Regards, -- Kiroh HARADA kiroh@pp.iij4u.or.jp, kiroh@jp.freebsd.org PGP Fingerprint: 38 0D E0 BD BB C1 8F E0 93 3C 13 30 39 F7 C4 79 PGP Public Key : http://www.pp.iij4u.or.jp/~kiroh/harada.asc *** povray.c.orig Wed Sep 23 20:10:31 1998 --- povray.c Wed Sep 30 02:57:14 1998 *************** *** 24,29 **** --- 24,34 ---- #include #include /* BP */ + + #ifdef __FreeBSD__ /* to prevent FPE on FreeBSD */ + #include + #endif + #include "frame.h" /* common to ALL modules in this program */ #include "povproto.h" #include "bezier.h" *************** *** 198,205 **** #ifdef NOCMDLINE /* a main() by any other name... */ ! #ifdef ALTMAIN ! MAIN_RETURN_TYPE alt_main() #else MAIN_RETURN_TYPE main() #endif --- 203,209 ---- #ifdef NOCMDLINE /* a main() by any other name... */ ! #ifdef ALTMAIN MAIN_RETURN_TYPE alt_main() #else MAIN_RETURN_TYPE main() #endif *************** *** 218,223 **** --- 222,232 ---- DBL Diff_Clock; SHELLRET Pre_Scene_Result, Frame_Result; + #ifdef __FreeBSD__ /* to prevent FPE on FreeBSD */ + /* allow divide by zero -- Inf */ + fpsetmask(fpgetmask() & ~(FP_X_OFL|FP_X_DZ|FP_X_INV)); + #endif + /* Attention all ALTMAIN people! See comments attached to this function*/ pre_init_povray(); *************** *** 371,376 **** --- 380,390 ---- /* And finish. */ Terminate_POV(0); + + #ifdef __FreeBSD__ /* restore original FPE handling in FreeBSD */ + fpresetsticky(FP_X_DZ|FP_X_INV); + fpsetmask(FP_X_OFL|FP_X_DZ|FP_X_INV); + #endif MAIN_RETURN_STATEMENT } /* main */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message