From owner-freebsd-ports-bugs@FreeBSD.ORG Wed May 16 10:00:07 2012 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 8756A1065673 for ; Wed, 16 May 2012 10:00:07 +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 524B08FC17 for ; Wed, 16 May 2012 10:00:07 +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 q4GA076s044416 for ; Wed, 16 May 2012 10:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4GA07bQ044415; Wed, 16 May 2012 10:00:07 GMT (envelope-from gnats) Resent-Date: Wed, 16 May 2012 10:00:07 GMT Resent-Message-Id: <201205161000.q4GA07bQ044415@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, Svyatoslav Lempert Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BF66106566B for ; Wed, 16 May 2012 09:53:28 +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 F0EF48FC0C for ; Wed, 16 May 2012 09:53:27 +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 q4G9rRtB028058 for ; Wed, 16 May 2012 09:53:27 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4G9rRlv028048; Wed, 16 May 2012 09:53:27 GMT (envelope-from nobody) Message-Id: <201205160953.q4G9rRlv028048@red.freebsd.org> Date: Wed, 16 May 2012 09:53:27 GMT From: Svyatoslav Lempert To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/167953: devel/pecl-xhprof patch for single core cpu 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: Wed, 16 May 2012 10:00:07 -0000 >Number: 167953 >Category: ports >Synopsis: devel/pecl-xhprof patch for single core cpu >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed May 16 10:00:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Svyatoslav Lempert >Release: 8.3-STABLE >Organization: >Environment: >Description: Install port on single core (VPS with VDSmanager-FreeBSD jail-like virtualizaion http://ispsystem.com/en/software/vdsmanager/freebsd_virtualization) # cat test.php # php test.php setaffinity: Resource deadlock avoided setaffinity: Resource deadlock avoided Segmentation fault # sysctl -n kern.smp.cpus 1 >How-To-Repeat: For fix this issue we should not use cpu_set_t in xhprof.c >Fix: Patch to port Patch attached with submission follows: diff -Nru pecl-xhprof.old/Makefile pecl-xhprof/Makefile --- pecl-xhprof.old/Makefile 2010-09-17 04:14:49.000000000 +0900 +++ pecl-xhprof/Makefile 2012-05-16 18:43:34.000000000 +0900 @@ -24,6 +24,12 @@ .include +CPUS!= ${SYSCTL} -n kern.smp.cpus + +.if ${CPUS} == "1" +EXTRA_PATCHES=${FILESDIR}/extra-onecorecpu-xhprof.c.patch +.endif + .if ${OSVERSION} < 700110 BROKEN= Requires cpuset support .endif diff -Nru pecl-xhprof.old/files/extra-onecorecpu-xhprof.c.patch pecl-xhprof/files/extra-onecorecpu-xhprof.c.patch --- pecl-xhprof.old/files/extra-onecorecpu-xhprof.c.patch 1970-01-01 08:00:00.000000000 +0800 +++ pecl-xhprof/files/extra-onecorecpu-xhprof.c.patch 2012-05-16 15:14:02.000000000 +0900 @@ -0,0 +1,25 @@ +--- xhprof.c.orig 2009-06-02 02:52:32.000000000 +0900 ++++ xhprof.c 2012-05-16 15:12:22.000000000 +0900 +@@ -1203,11 +1203,6 @@ + CPU_ZERO(&new_mask); + CPU_SET(cpu_id, &new_mask); + +- if (SET_AFFINITY(0, sizeof(cpu_set_t), &new_mask) < 0) { +- perror("setaffinity"); +- return -1; +- } +- + /* record the cpu_id the process is bound to. */ + hp_globals.cur_cpu_id = cpu_id; + +@@ -1330,10 +1325,6 @@ + * @author cjiang + */ + int restore_cpu_affinity(cpu_set_t * prev_mask) { +- if (SET_AFFINITY(0, sizeof(cpu_set_t), prev_mask) < 0) { +- perror("restore setaffinity"); +- return -1; +- } + /* default value ofor cur_cpu_id is 0. */ + hp_globals.cur_cpu_id = 0; + return 0; >Release-Note: >Audit-Trail: >Unformatted: