On Sat, Mar 25, 2000 at 10:56:15PM -0800, Arun Sharma wrote:
> 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.
No. See the file libc_thread.c in the linuxthreads port.
Note that if you call rfork (RF_MEM...) without any supporting
infrastructure (eg. as provided by the linuxthreads port) you
are in dangerous territory. You do not get *any* of the
thread safe behaviour in libc, libgcc, or in ld-ef.so.
--
Richard Seaman, Jr. email: [EMAIL PROTECTED]
5182 N. Maple Lane phone: 262-367-5450
Chenequa WI 53058 fax: 262-367-5852
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message