From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Re: Allowing traps
Date: Fri, 24 Nov 2000 09:06:04 +0100 (MET) [thread overview]
Message-ID: <200011240806.JAA17838@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Thu, 23 Nov 2000 19:14:20 +0000
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@informatik.hu-berlin.de
next reply other threads:[~2000-11-24 8:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-24 8:06 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-11-23 8:11 Sven Wischnowsky
2000-11-23 19:14 ` Bart Schaefer
2000-11-23 21:42 ` Peter Stephenson
2000-11-23 21:58 ` Bart Schaefer
2000-11-23 22:05 ` Bart Schaefer
2000-11-20 16:54 Peter Stephenson
2000-11-20 17:39 ` PATCH: " Bart Schaefer
2000-11-22 17:33 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200011240806.JAA17838@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).