From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4516 invoked from network); 2 Dec 1997 23:43:14 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 2 Dec 1997 23:43:14 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id SAA13851; Tue, 2 Dec 1997 18:25:32 -0500 (EST) Resent-Date: Tue, 2 Dec 1997 18:25:04 -0500 (EST) Date: Tue, 2 Dec 1997 18:22:31 -0500 Message-Id: <9712022322.AA17913@drkstr.lkg.dec.com> From: Kevin Sullivan To: zsh-users@math.gatech.edu Subject: Problem with autoload. Resent-Message-ID: <"uM0Dm.0.xN3.GZ9Xq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1172 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hello, I am having a problem with autoload and subsequently resolving the functions. Here are the particulars. (kevins@drkstr)(zsh:434)% echo $ZSH_VERSION 3.1.2 (kevins@drkstr)(zsh:435)% uname -a OSF1 drkstr.lkg.dec.com V4.0 375 alpha When I try to resolve an autoload function zsh core dumps. Here is the setup procedure: FPATH=${HOME}/bin/functions {whence replace && unalias replace} >& /dev/null autoload replace The function replace is a simple script to replace a symbolic link with the referenced file. However, the script/function is irrelevant it cores on any autoload(ed) name. I built zsh in debug so I could get a relevant core file. (kevins@drkstr)(zsh:439)% ./zsh (kevins@drkstr)(zsh:203)% autoload undefined mere () { } undefined replace () { } (kevins@drkstr)(zsh:203)% replace symlink zsh: 17792 segmentation fault (core dumped) ./zsh (kevins@drkstr)(zsh:440)% gdb ./zsh core GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (alpha-dec-osf4.0), Copyright 1996 Free Software Foundation, Inc... Core was generated by `zsh'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/shlib/libc.so...done. #0 0x12002fe94 in execautofn (cmd=0x14002f140) at exec.c:2494 2494 List l = getfpfunc(shf->nam); (gdb) bt #0 0x12002fe94 in execautofn (cmd=0x14002f140) at exec.c:2494 #1 0x12002c4dc in execcmd (cmd=0x14002f140, input=0, output=0, how=2, last1=2) at exec.c:1650 #2 0x120028728 in execpline2 (pline=0x14002f128, how=2, input=0, output=0, last1=0) at exec.c:807 #3 0x120027b8c in execpline (l=0x14002f108, how=2, last1=0) at exec.c:653 #4 0x1200275fc in execlist (list=0x14002f0f0, dont_change_job=1, exiting=0) at exec.c:533 #5 0x1200305ec in doshfunc (list=0x14003c360, doshargs=0x14002f050, flags=64, noreturnval=0) at exec.c:2583 #6 0x12002fe10 in execshfunc (cmd=0x14002f020, shf=0x140087ae0) at exec.c:2477 #7 0x12002c67c in execcmd (cmd=0x14002f020, input=0, output=0, how=2, last1=2) at exec.c:1686 #8 0x120028728 in execpline2 (pline=0x14002f0a0, how=2, input=0, output=0, last1=0) at exec.c:807 #9 0x120027b8c in execpline (l=0x14002f000, how=2, last1=0) at exec.c:653 #10 0x1200275fc in execlist (list=0x14002f0b8, dont_change_job=0, exiting=0) at exec.c:533 #11 0x120047664 in loop (toplevel=1) at init.c:72 #12 0x12008f028 in main (argc=1, argv=0x11ffff5e8) at main.c:81 (gdb) p shf $1 = (struct shfunc *) 0x0 (gdb) p *cmd $3 = { ntype = 1129668867, type = 13, flags = 0, lineno = 0, u = { list = 0x14002f288, forcmd = 0x14002f288, casecmd = 0x14002f288, ifcmd = 0x14002f288, whilecmd = 0x14002f288, pline = 0x14002f288, cond = 0x14002f288, autofn = 0x14002f288, generic = 0x14002f288 }, args = 0x14002f298, redir = 0x14002f2b8, vars = 0x14002f2a8 } (gdb) p *cmd->u.autofn $4 = { ntype = 1090519051, shf = 0x0 } I tried looking through the code somewhat but I am really unfamiliar with it. I am hoping one of the zsh-workers can enlighten me to what I am doing wrong. I am sure that I have not set up something quite right but I am at a loss. I have read through all the information I can find. I have been using zsh for many years. All of my functions and scripts I have loaded into a large (getting very large) file I load in at login time. I would like to break up that file and use autoload and fpath can you help me out. -Kevin