Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Core dump unloading zsh/zftp



Bart Schaefer wrote:
> Running:
>     zmodload zsh/zftp
>     zmodload -u zsh/zftp

It crashes when you exit the shell, too, if you have zsh/zftp loaded.

> It appears that the zfsessions linklist is not empty, even though there
> is no valid session in it anywhere.

See boot_ -- you always get a `default' session.

It way well be related to the stuff I posted yesterday about TCP session
management: deciding what zfclose() should actually be doing was one of the
big problems.  The interface between the zftp and tcp modules is still a
bit tricky.

Here's the patch to make zftp load tcp.  This handles the dependency
transparently with a working RTLD_LAZY, which seems fine with Solaris.
It should be pretty easy to convert dependency lists into code like this.

The only fly in the ointment I can see is with multiple dependencies: if we
load module A, then fail to load module B, we should unload A if it wasn't
already loaded.  Hence we should probably write a function for module.c
which is passed the list of dependency modules and handles loading in this
way.

It doesn't unload tcp automatically, though.  I don't know how to do that,
given that tcp may meanwhile be used for other things meanwhile.  In
particular, it links in a builtin, at which point we can't really tell
who's doing what.

Index: Src/Modules/zftp.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v
retrieving revision 1.19
diff -u -r1.19 zftp.c
--- Src/Modules/zftp.c	2001/09/08 21:09:56	1.19
+++ Src/Modules/zftp.c	2001/09/28 10:12:39
@@ -3099,6 +3099,10 @@
 int
 setup_(Module m)
 {
+    /* setup_ returns 0 for success. load_module returns 1 for success. */
+    if (!module_loaded("zsh/net/tcp"))
+	return !load_module("zsh/net/tcp");
+
     return 0;
 }
 
-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author