From owner-freebsd-hackers Sat Mar 25 22:56:25 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from sharmas.dhs.org (c62443-a.frmt1.sfba.home.com [24.0.69.165]) by hub.freebsd.org (Postfix) with ESMTP id 0541D37B992 for ; Sat, 25 Mar 2000 22:56:14 -0800 (PST) (envelope-from adsharma@sharmas.dhs.org) Received: (from adsharma@localhost) by sharmas.dhs.org (8.9.3/8.9.3) id WAA11314 for freebsd-hackers@freebsd.org; Sat, 25 Mar 2000 22:56:15 -0800 Date: Sat, 25 Mar 2000 22:56:15 -0800 From: Arun Sharma To: FreeBSD Hackers Subject: RTLD thread safety Message-ID: <20000325225615.A11307@sharmas.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG When I try to compile a simple multi threaded program using a wrapper around rfork (from linuxthreads port), I get the following core dump: ld-elf.so.1: assert failed: /usr/src/libexec/rtld-elf/lockdflt.c:54 Investigation into code reveals that lazy resolution of symbols (using PLTs) was happening in multiple threads in the linker simultaneously. Also, the code in lockdflt.c is achieving mutual exclusion by blocking signals. This doesn't work on a SMP machine using kernel threads. What would be the right solution for this ? A new set of primitives registered using dllockinit or making the defaults SMP thread-safe ? I suppose the linuxthreads port works because it has been tested only with Linux executables and Linux executables don't use lazy resolution of symbols ? I'm just speculating here. -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message