From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Sep 6 12:00:04 2011 Return-Path: Delivered-To: freebsd-ports-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 F10671065672 for ; Tue, 6 Sep 2011 12:00:03 +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 C32A08FC0A for ; Tue, 6 Sep 2011 12:00:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p86C03SC082190 for ; Tue, 6 Sep 2011 12:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p86C03FC082189; Tue, 6 Sep 2011 12:00:03 GMT (envelope-from gnats) Resent-Date: Tue, 6 Sep 2011 12:00:03 GMT Resent-Message-Id: <201109061200.p86C03FC082189@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bartosz Fabianowski Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4A53106566C for ; Tue, 6 Sep 2011 11:57:37 +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 BAB6F8FC12 for ; Tue, 6 Sep 2011 11:57:37 +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 p86BvboB097668 for ; Tue, 6 Sep 2011 11:57:37 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p86BvbKQ097667; Tue, 6 Sep 2011 11:57:37 GMT (envelope-from nobody) Message-Id: <201109061157.p86BvbKQ097667@red.freebsd.org> Date: Tue, 6 Sep 2011 11:57:37 GMT From: Bartosz Fabianowski To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/160511: [PATCH] make math/py-graphtool actually work X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2011 12:00:04 -0000 >Number: 160511 >Category: ports >Synopsis: [PATCH] make math/py-graphtool actually work >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 06 12:00:02 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Bartosz Fabianowski >Release: 8.2-STABLE >Organization: Dobini >Environment: FreeBSD taiko.lan 8.2-STABLE FreeBSD 8.2-STABLE #0: Fri Jul 29 23:43:59 CEST 2011 root@taiko.lan:/usr/obj/usr/src/sys/TAIKO amd6 >Description: The math/py-graphtool port uses gcc 4.5+ to build. The port builds successfully but the resulting Python modules do not work. Any attempt to import the graph_tools module ends up crashing Python. I have spent many hours investigating the issue. I am still not sure what exactly causes it but it is a boost::any_cast<> that crashes Python. The following testcase shows that, at least on my AMD64 8.2-STABLE machines, g++4.5 miscompiles boost::any_cast<>: #include #include int main() { try { double d; int i = boost::any_cast(d); } catch(...) { std::cout << "OK" << std::endl; } } When compiled with system g++, the program's output is "OK". When compiled with g++4.5, the output is "Abort". >How-To-Repeat: >Fix: The attached patch makes math/py-graphtool build with system g++. There a lot of warnings but the resulting Python modules actually do work. The change to src/graph/graph_bind.cc is a workaround for http://bugs.python.org/issue10910. Patch attached with submission follows: diff -ruN math/py-graphtool.orig/Makefile math/py-graphtool/Makefile --- math/py-graphtool.orig/Makefile 2011-06-07 14:12:24.000000000 +0300 +++ math/py-graphtool/Makefile 2011-09-06 13:22:19.000000000 +0300 @@ -7,6 +7,7 @@ PORTNAME= graphtool PORTVERSION= 2.2.12 +PORTREVISION= 1 CATEGORIES= math python MASTER_SITES= http://downloads.skewed.de/graph-tool/ DISTNAME= graph-tool-${PORTVERSION} @@ -22,11 +23,12 @@ CGAL.5:${PORTSDIR}/math/cgal USE_BZIP2= yes -USE_GCC= 4.5+ USE_GMAKE= yes USE_PYTHON= yes GNU_CONFIGURE= yes +MAKE_JOBS_SAFE= yes -CONFIGURE_ENV= PYTHON_VERSION=${PYTHON_VER} +CXXFLAGS+= -I${PYTHONBASE}/include +CONFIGURE_ENV= PYTHON_VERSION=${PYTHON_VER} LDFLAGS=-L${PYTHONBASE}/lib .include diff -ruN math/py-graphtool.orig/files/patch-graph_bind.cc math/py-graphtool/files/patch-graph_bind.cc --- math/py-graphtool.orig/files/patch-graph_bind.cc 1970-01-01 03:00:00.000000000 +0300 +++ math/py-graphtool/files/patch-graph_bind.cc 2011-09-06 13:04:28.000000000 +0300 @@ -0,0 +1,11 @@ +--- src/graph/graph_bind.cc.orig 2011-09-06 13:03:52.000000000 +0300 ++++ src/graph/graph_bind.cc 2011-09-06 10:24:24.000000000 +0300 +@@ -15,6 +15,8 @@ + // You should have received a copy of the GNU General Public License + // along with this program. If not, see . + ++#include "Python.h" ++ + #define NUMPY_EXPORT + #include "numpy_bind.hh" + >Release-Note: >Audit-Trail: >Unformatted: