[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ltdl bugs
From: |
Ralf Wildenhues |
Subject: |
Re: ltdl bugs |
Date: |
Sun, 3 Apr 2005 08:52:42 +0200 |
User-agent: |
Mutt/1.4.1i |
* Jeff Squyres wrote on Sat, Apr 02, 2005 at 07:03:27PM CEST:
> On Apr 2, 2005, at 8:29 AM, Peter O'Gorman wrote:
>
> >| I am not sure that this is a bug, if you check the return code from
> >| lt_dlclose(), you will notice that it fails.
> >
> >Hate to reply to myself, but I would consider that the memory not being
> >cleaned up by lt_dlexit() to be a bug. Darn, thought I'd get away with
> >the
> >'not a bug' response.
>
> Sorry - I should have clarified that in my original post; my sample app
> is not checking the return code, but only for simplicity of the e-mail.
> Of course my real application checks the return code. :-)
>
> So there's actually 2 things:
>
> 1. lt_dlclose() needs to free the memory.
No. Not a bug. I have audited this once, thought it was a bug, then
tried to fix it. Found out all you need to do is think about the
residency of the module. (Hint: try a file != self.)
If you had tried to execute the program in a loop, you'd found out that
memory will _not_ accumulate (IIRC -- if not, please report back).
Furthermore, if you (not possible without touching internals, I think)
set the residency to no, the memory would go away.
These 32some bytes you will just have to live with.
In another mail:
| Compiling with -pedantic gives:
|
| -----
| lttest.c:12: warning: ISO C forbids assignment between function pointer
| and `void *'
| -----
|
| Can a second function be added, perhaps lt_dlsymfunc(), that returns
| function pointers instead of (void*)?
Yes, surely. We've learned about the TODO entry already.
Adding the interface won't help you as much as you think, though. This
cast _will_ have to happen on each system using dlsym internally, all
you can get is hide this inside libltdl instead of your application.
(Note you are very right it _should_ be inside ltdl, for the very reason
that there exist systems with very different object and function
pointers. However, I just don't believe you used one of them. :)
Regards,
Ralf
- ltdl bugs, Jeff Squyres, 2005/04/01
- Re: ltdl bugs, Peter O'Gorman, 2005/04/02
- Re: ltdl bugs, Peter O'Gorman, 2005/04/02
- Re: ltdl bugs, Jeff Squyres, 2005/04/02
- Re: ltdl bugs,
Ralf Wildenhues <=
- Re: ltdl bugs, Ralf Wildenhues, 2005/04/03
- Re: ltdl bugs, Jeff Squyres, 2005/04/03
- Re: ltdl bugs, Jeff Squyres, 2005/04/03
- Re: ltdl bugs, Ralf Wildenhues, 2005/04/03
- Re: ltdl bugs, Ralf Wildenhues, 2005/04/03
- Re: ltdl bugs, Jeff Squyres, 2005/04/03
- Re: ltdl bugs, Ralf Wildenhues, 2005/04/03
- Re: ltdl bugs, Jeff Squyres, 2005/04/04
- Re: ltdl bugs, Ralf Wildenhues, 2005/04/04
- Re: ltdl bugs, Jeff Squyres, 2005/04/20