From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 15 16:40:10 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618D1106564A for ; Sun, 15 Jan 2012 16:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0778FC0C for ; Sun, 15 Jan 2012 16:40:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0FGeAmf097135 for ; Sun, 15 Jan 2012 16:40:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0FGeABo097134; Sun, 15 Jan 2012 16:40:10 GMT (envelope-from gnats) Resent-Date: Sun, 15 Jan 2012 16:40:10 GMT Resent-Message-Id: <201201151640.q0FGeABo097134@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Shane Ambler Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBBC1065675 for ; Sun, 15 Jan 2012 16:32:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id DAE738FC1C for ; Sun, 15 Jan 2012 16:32:09 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FGW9Oj010739 for ; Sun, 15 Jan 2012 16:32:09 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q0FGW96B010738; Sun, 15 Jan 2012 16:32:09 GMT (envelope-from nobody) Message-Id: <201201151632.q0FGW96B010738@red.freebsd.org> Date: Sun, 15 Jan 2012 16:32:09 GMT From: Shane Ambler To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/164144: Crash on sending float/double values to std::ostringstream X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 16:40:10 -0000 >Number: 164144 >Category: misc >Synopsis: Crash on sending float/double values to std::ostringstream >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 15 16:40:09 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Shane Ambler >Release: 9.0-RELEASE >Organization: >Environment: FreeBSD leader 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: In c++ code sending a float or double value to a std::ostringstream using a << operator causes an illegal instruction. Sending a long double in the same place works. I find clang++ g++ and g++46 produce the same results so expect this is within libc++. This bug was found running blender - it is used within the elbeem lib code for fluid sims. Within gdb the following example code gives - For float values -- Program received signal SIGILL, Illegal instruction. 0x00000008008e0060 in std::ostream::operator<< (this=0x7fffffffd2c0, __f=100.255997) at ostream.tcc:221 221 ostream.tcc: No such file or directory. in ostream.tcc Current language: auto; currently c++ For double values -- Program received signal SIGILL, Illegal instruction. 0x00000008008dfe6b in std::ostream::_M_insert (this=0x7fffffffd2c0, __v=100.256) at ostream.tcc:221 221 ostream.tcc: No such file or directory. in ostream.tcc Current language: auto; currently c++ >How-To-Repeat: Build the following - clang++ test.cpp - and run #include int main(int argc, char ** argv) { std::ostringstream testout; // broken testout << (float)100.256; // broken testout << (double)100.256; // works testout << (long double)100.256; // exit nicely if we get here return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: