apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: cvs commit: apr/test testdso.c
Date Sun, 29 Dec 2002 22:37:26 GMT
On Sun, Dec 29, 2002 at 10:48:24AM -0800, Ryan Bloom wrote:
> 
> 
> On Sun, 29 Dec 2002, William A. Rowe, Jr. wrote:
> 
> > At 12:21 AM 12/29/2002, rbb@apache.org wrote:
> >
> > >On 29 Dec 2002 wrowe@apache.org wrote:
> > >
> > >> wrowe       2002/12/28 21:44:02
> > >>
> > >>     First; once any apr object is closed, the results are undefined.
> > >...
> > >>   Index: testdso.c
> > >>   --- testdso.c       19 Dec 2002 16:15:29 -0000      1.30
> > >>   +++ testdso.c       29 Dec 2002 05:44:01 -0000      1.31
> > >>   ...
> > >>   @@ -155,17 +155,11 @@
> > >>
> > >>        status = apr_dso_unload(h);
> > >>        CuAssert(tc, apr_dso_error(h, errstr, 256), APR_SUCCESS == status);
> > >>   -
> > >>   -    status = apr_dso_sym(&func1, h, "print_hello");
> > >>   -    CuAssertIntEquals(tc, APR_EINIT, status);
> > >>    }
> > >
> > >I seriously disagree with this change.
> >
> >
> > >If the dso is unloaded, you
> > >shouldn't be able to find a symbol in it anymore.
> >
> > I agree with you.  However, h is now undefined.  This means that we
> > will generally react by segfaulting or throwing any indeterminate error.
> > EINIT is a Unixism.
> 
> There is no way at all that this code will segfault.  Not on any platform,
> because the unload only unloaded the native instance of the library, it
> had no effect on the APR wrapper.

This test does segfault on OpenBSD (2.8); if _sym after _close is
intended to be supported it would seem apr_dso_sym needs to fail early
if handle->handle == NULL for the DLFCN case as well.

joe

Mime
View raw message