From owner-freebsd-stable@FreeBSD.ORG Wed Nov 12 20:28:40 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 879D81065670 for ; Wed, 12 Nov 2008 20:28:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 26FA28FC0C for ; Wed, 12 Nov 2008 20:28:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L0Ld3-0001N1-SA; Wed, 12 Nov 2008 21:43:54 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mACJhonb044824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Nov 2008 21:43:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mACJhos2092609; Wed, 12 Nov 2008 21:43:50 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mACJhop0092608; Wed, 12 Nov 2008 21:43:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Nov 2008 21:43:50 +0200 From: Kostik Belousov To: Mikhail Teterin Message-ID: <20081112194350.GJ47073@deviant.kiev.zoral.com.ua> References: <491B1BD2.4050903@aldan.algebra.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NqSa+Xr3J/G6Hhls" Content-Disposition: inline In-Reply-To: <491B1BD2.4050903@aldan.algebra.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L0Ld3-0001N1-SA f8f666efc8f22a52587f8eb4c15082c3 X-Terabit: YES Cc: stable@freebsd.org Subject: Re: dlopen-ing a library with OpenMP by a non-OpenMP process X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2008 20:28:40 -0000 --NqSa+Xr3J/G6Hhls Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 12, 2008 at 01:09:22PM -0500, Mikhail Teterin wrote: > Hello! >=20 > Currently, when a program built without OpenMP (-fopenmp) is trying to=20 > dlopen a library, built with the feature, the result is a crash from=20 > "bad system call": >=20 > #0 0x00000008009a223c in ksem_init () from /lib/libc.so.7 > #1 0x0000000800998a8f in sem_init () from /lib/libc.so.7 > #2 0x00000008011a6537 in omp_get_nested () from /usr/lib/libgomp.so.1 > #3 0x00000008011a3466 in ?? () from /usr/lib/libgomp.so.1 > #4 0x0000000000000002 in ?? () > #5 0x00000008005072b2 in dlsym () from /libexec/ld-elf.so.1 > #6 0x0000000800507cd2 in dlopen () from /libexec/ld-elf.so.1 > ... >=20 > Can anything be done about this -- disable the OpenMP functionality, but= =20 > keep the library usable (single-threaded)? The problem arises, in=20 > particular, when one is trying to use libraries built by either=20 > GraphicsMagick or ImageMagick ports. Both have an OpenMP option, which=20 > speeds up some internal algorithms. The option is off by default, but=20 > enabling it makes sense on an SMP system... Yet, this makes the library= =20 > unsuitable for other purposes... Thanks! Yours, >=20 > -mi >=20 > P.S. I'm seeing the crash on a recent FreeBSD-7.1/amd64, but it, likely,= =20 > can be seen elsewhere. Try "kldload sem". --NqSa+Xr3J/G6Hhls Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkbMfUACgkQC3+MBN1Mb4jC2QCfTqeWHXbsp+uA7ox4/JwzZuvt HaIAnAr1TCaRKa/mR+Dd9ypbVso04NAI =1eJf -----END PGP SIGNATURE----- --NqSa+Xr3J/G6Hhls--