Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: Allowing traps
- X-seq: zsh-workers 13189
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: Re: Allowing traps
- Date: Fri, 24 Nov 2000 09:06:04 +0100 (MET)
- In-reply-to: "Bart Schaefer"'s message of Thu, 23 Nov 2000 19:14:20 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> ...
>
> The short answer would be "everywhere that we manipulate global variables
> that are pointers." That's a bit strong, as simple dereferencing should
> be OK. Based on a grep of *.(c|h|e#pro) files, there appear to be at least
> 234 such variables (including structs that may contain pointers, though I
> may have missed some of those), of which 44 are static and 57 are part of
> the completion system. Another 35 are part of ZLE.
>
> So 25% of the global pointers are in the completion system, and I'd be
> willing to bet that it modifies its globals a lot more heavily than just
> about anything except the memory allocators. That makes the completion
> system an awfully large target for an interactive shell that's receiving
> SIGALRM once every second; no wonder Thomas is seeing problems.
>
> The other pesky bits are the parameter tables, which could mostly be
> covered by doctoring params.c.
Judging from the debugging output I got from Thomas I think it was
this part that finally caused the SEGVs (if I remember correctly).
And hence I'm not convinced that the completion code (note: `code',
not `system') is really a problem. In fact, it should be easy to make
safe once the other code is safe. Because nowadays we have only very
few entry points to the completion code that can be guarded to
disallow invoking the code while it is still being executed (i.e. make
sure that trap handlers can't call it -- that wouldn't make much sense
anyway, I think).
And later we can put all the completion state in a struct and use that
to make it reentrant. Something I've been wishing to have for the
lexing, parsing and execution code for years (there we use structs to
safe and restore the state, copying it from/to global variables).
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author