From owner-freebsd-questions@FreeBSD.ORG Tue Apr 15 01:24:22 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F569B9E for ; Tue, 15 Apr 2014 01:24:22 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9165514BA for ; Tue, 15 Apr 2014 01:24:21 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k14so8921201wgh.35 for ; Mon, 14 Apr 2014 18:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:cc:content-type; bh=Wes4cYnNYM++JMwwKb77QtIkSc/6BgMwOmVZ2dzv8+c=; b=VcEqTBySeQWLLmx0mfGSmXhFxuNMR7Px/S62iQ+2aOVOGo6lVA3O2fJNMgsUKiSozs I2Uh/nbCnWpmeUpSNST9y2o7mmPWCdkp0gnL3/Kx/bHXs1nrWb9SZU3epekEJIDPr26R d5u3bP745I213J+qCh0f+WmiKllonvAlp/tamefFznP5FFtV3gbNsGFjZ3/tEt+MppZw 0QSQGp+trResAsspF0Q2MyExAeA9XaV0yc/4cTT3lmk+qq2VMZOktu5NyxsHoI3Jxu3j IfMnTD96Dac+3lZgCuRAaI8QUcMYFvmI1ueHbt7/7GHdJ1L0kglppQrsiwoCWzzAlx8v hWGQ== X-Received: by 10.180.38.107 with SMTP id f11mr10474310wik.31.1397525059925; Mon, 14 Apr 2014 18:24:19 -0700 (PDT) MIME-Version: 1.0 Sender: zhao6014@gmail.com Received: by 10.194.25.129 with HTTP; Mon, 14 Apr 2014 18:23:59 -0700 (PDT) From: Jov Date: Tue, 15 Apr 2014 09:23:59 +0800 X-Google-Sender-Auth: gO-0jDjC7KUrOCyf7CQ708zQlCA Message-ID: Subject: PostgreSQL hang On FreeBSD,with CFLAGS='-O2 -pthread' workaround To: FreeBSD questions Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: =?KOI8-R?B?68/O09TBztTJziDrzsnWzsnL?= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 01:24:22 -0000 hi~ FreeBSD hackers, I find some problems when use pg on FreeBSD.On FreeBSD,If installed extension which pthread lib is used,for example plv8,pljava,imcs etc,when query touch these extenstions,the PG backend will hang. there is a solution,which configure postgresql with CFLAGS='-O2 -pthread' and compile pg from source ,then install the extension.But this solution is not offical documented and not easy to use(you must compile pg from source).It may make some extension developers or user waste much time to solve it,and make people complain that PG or FreeBSD not stable. knizhnik has some insight: > Actually I have already reproduced the problem with my lockbench test. It > work when build as application with -pthread, but doesn't work if it built > as shared library and loaded from application built without -pthread. > Unfortunately I do not know other solution rather than rebuilt PostgreSQL > with pthread. Sorry, that I have not informed you about my investigations > and thank you for your help. I also run this test at OS/X - there is no > such problem. this is the ldd output: [jovz@ ~]$ ldd pgsql_pthread/bin/postgres pgsql/bin/postgres: libm.so.5 => /lib/libm.so.5 (0x800cd1000) libthr.so.3 => /lib/libthr.so.3 (0x800ef7000) libc.so.7 => /lib/libc.so.7 (0x80111c000) [jovz@ ~]$ ldd pgsql934/bin/postgres pgsql934/bin/postgres: libm.so.5 => /lib/libm.so.5 (0x800cd1000) libc.so.7 => /lib/libc.so.7 (0x800ef7000) the output make me remember some talk about sshd Zombie recently, which something aoubt libc and libthr. is this a known problem with FreeBSD pthread implement? ref: http://www.postgresql.org/message-id/534785D2.6050105@matrix.gatewaynet.com https://github.com/knizhnik/imcs/issues/25 http://code.google.com/p/plv8js/issues/detail?id=34 Jov blog: http:amutu.com/blog