Date: Wed, 15 Feb 2006 16:38:13 GMT From: Fabien THOMAS <fabien.thomas@netasq.com> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/93396: dlopen crash with locked page Message-ID: <200602151638.k1FGcDI2071407@www.freebsd.org> Resent-Message-ID: <200602151640.k1FGe4oo043791@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 93396 >Category: i386 >Synopsis: dlopen crash with locked page >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 15 16:40:03 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Fabien THOMAS >Release: 6.1 BETA1 >Organization: NETASQ >Environment: FreeBSD build 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Fri Feb 10 18:39:05 CET 2006 root@build:/usr/obj/usr/src/sys/SMP i386 >Description: When process page are locked any dlopen will crash. It is not related to 6.1 BETA version (it crash under 6.0 RELEASE). >How-To-Repeat: cc -pthread -o dltest dltest.c ./dltest Bus error (core dumped) gdb: (gdb) bt #0 0x28058e7c in memset () from /libexec/ld-elf.so.1 #1 0x2806d060 in ?? () #2 0x28051909 in map_object () from /libexec/ld-elf.so.1 #3 0x2804e9ed in elf_hash () from /libexec/ld-elf.so.1 #4 0x2805073d in dlopen () from /libexec/ld-elf.so.1 #5 0x080487ec in main () dltest.c: #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/mman.h> #include <pthread.h> #include <stdio.h> #include <dlfcn.h> static void page_lockall (void) { int res; struct rlimit rlimit; rlimit.rlim_cur = RLIM_INFINITY; rlimit.rlim_max = RLIM_INFINITY; setrlimit (RLIMIT_MEMLOCK, &rlimit); mlockall (MCL_CURRENT | MCL_FUTURE); } int main (int argc, char **argv) { void *dl_handle; page_lockall(); dl_handle = dlopen ("/usr/lib/pam_guest.so", RTLD_NOW); dlclose(dl_handle); } >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602151638.k1FGcDI2071407>