NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dlopen(), atexit() SEGV in NetBSD



On Wed, Jul 08, 2009 at 01:10:50PM +0530, Channa wrote:
> Hi,
> I am facing some issue with atexit handler in NetBSD.
> The procedure to reproduce the problem i have explained below:
[...]
> Because after a dlopened library that calls atexit() the libexample.so
> is dlclosed, an executable can't
> access a registered handler in the library and causes SEGV.

Well, of course it does.  The documentation is quite clear:

     dlclose() unlinks and removes the object referred to by handle from the
     process address space.

When you access memory which is not mapped into your process address space,
you get a SIGSEGV.  AFAICT this is just a bug in your code.

Thor


Home | Main Index | Thread Index | Old Index