bug-bash
[Top][All Lists]
Advanced

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

Re: segfault after disabling a loadable builtin


From: Piotr Grzybowski
Subject: Re: segfault after disabling a loadable builtin
Date: Tue, 7 Jul 2015 23:49:26 +0200

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.

cheers,
pg



On Tue, Jul 7, 2015 at 10:25 PM,  <address@hidden> wrote:
> The mypid loadable in the examples directory sets a dynamic variable.
> Bash segfaults if you reference it after using enable -d enable_mypid.
>
> $ enable -f ./mypid enable_mypid
> $ enable_mypid
> $ enable -d enable_mypid
> $ echo $MYPID
> Segmentation fault (core dumped)
>
> enable should keep track of the dynamic variables it sets and unset them
> when using dlclose().
>
>
>
> ---
> xoxo iza
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]