i386/93396: dlopen crash with locked page
Fabien THOMAS
fabien.thomas at netasq.com
Wed Feb 15 08:40:05 PST 2006
>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 at 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:
More information about the freebsd-i386
mailing list