From owner-freebsd-stable@FreeBSD.ORG Wed Nov 12 18:37:29 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 E21F41065673 for ; Wed, 12 Nov 2008 18:37:29 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: from mail2.sea5.speakeasy.net (mail2.sea5.speakeasy.net [69.17.117.4]) by mx1.freebsd.org (Postfix) with ESMTP id C80848FC17 for ; Wed, 12 Nov 2008 18:37:29 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: (qmail 2696 invoked from network); 12 Nov 2008 18:09:24 -0000 Received: from aldan.algebra.com (HELO [127.0.0.1]) (mi@[216.254.65.224]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 Nov 2008 18:09:24 -0000 Message-ID: <491B1BD2.4050903@aldan.algebra.com> Date: Wed, 12 Nov 2008 13:09:22 -0500 From: Mikhail Teterin User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: stable@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: 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 18:37:30 -0000 Hello! Currently, when a program built without OpenMP (-fopenmp) is trying to dlopen a library, built with the feature, the result is a crash from "bad system call": #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 ... Can anything be done about this -- disable the OpenMP functionality, but keep the library usable (single-threaded)? The problem arises, in particular, when one is trying to use libraries built by either GraphicsMagick or ImageMagick ports. Both have an OpenMP option, which speeds up some internal algorithms. The option is off by default, but enabling it makes sense on an SMP system... Yet, this makes the library unsuitable for other purposes... Thanks! Yours, -mi P.S. I'm seeing the crash on a recent FreeBSD-7.1/amd64, but it, likely, can be seen elsewhere.