[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: segfault after disabling a loadable builtin
From: |
Chet Ramey |
Subject: |
Re: segfault after disabling a loadable builtin |
Date: |
Fri, 10 Jul 2015 16:18:50 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 7/7/15 5:49 PM, Piotr Grzybowski wrote:
> hi,
>
> maybe I am mistaken, but I think that keeping track of the
> variables/functions bound/unbound by the loadable bultins leads to a
> complete hell of unmanageable code.
> It should be noted, that the builtins should clean by themselves,
> e.g., in this case mypid.c should contain something like:
>
> int __attribute__((destructor)) enable_mypid_builtin_destructor(void) {
> unbind_variable("MYPID");
> }
>
> which removes the calls to noexistent code after the builtin code has
> been removed via dlclose, and cleans the segfault.
This is the right approach, but a disable hook (destructor) needs to be
part of the interface somehow, which has potentially wide-ranging
consequences. I will have to think about how to do it.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/