zsh-workers
 help / color / mirror / code / Atom feed
* seg fault with compstate param
@ 2001-08-23  9:53 Oliver Kiddle
  2001-08-23 16:26 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2001-08-23  9:53 UTC (permalink / raw)
  To: zsh-workers

In either 4.0.2 or recentish 4.1 putting the command `typeset compstate'
in a completion function causes it to seg fault. I was hoping to use it
for debug information.

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: seg fault with compstate param
  2001-08-23  9:53 seg fault with compstate param Oliver Kiddle
@ 2001-08-23 16:26 ` Bart Schaefer
  2001-08-23 17:51   ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-08-23 16:26 UTC (permalink / raw)
  To: zsh-workers

On Aug 23, 10:53am, Oliver Kiddle wrote:
}
} In either 4.0.2 or recentish 4.1 putting the command `typeset compstate'
} in a completion function causes it to seg fault.

Of course it shouldn't do that, but:

} I was hoping to use it for debug information.

What you did was declare a local variable named compstate that was not an
associative array.  The completion system blew up trying to use it as one.

Use `typeset + compstate' instead.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: seg fault with compstate param
  2001-08-23 16:26 ` Bart Schaefer
@ 2001-08-23 17:51   ` Bart Schaefer
  2001-08-24  9:24     ` PATCH: " Sven Wischnowsky
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2001-08-23 17:51 UTC (permalink / raw)
  To: zsh-workers

On Aug 23,  4:26pm, Bart Schaefer wrote:
} Subject: Re: seg fault with compstate param
}
} On Aug 23, 10:53am, Oliver Kiddle wrote:
} }
} } In either 4.0.2 or recentish 4.1 putting the command `typeset compstate'
} } in a completion function causes it to seg fault.
} 
} What you did was declare a local variable named compstate that was not an
} associative array.

That's not quite accurate.  The compstate array did retain its special
properties when made local.  But it was equivalent to `compstate=()',
which also causes a core dump.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* PATCH: Re: seg fault with compstate param
  2001-08-23 17:51   ` Bart Schaefer
@ 2001-08-24  9:24     ` Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2001-08-24  9:24 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Aug 23,  4:26pm, Bart Schaefer wrote:
> } Subject: Re: seg fault with compstate param
> }
> } On Aug 23, 10:53am, Oliver Kiddle wrote:
> } }
> } } In either 4.0.2 or recentish 4.1 putting the command `typeset compstate'
> } } in a completion function causes it to seg fault.
> } 
> } What you did was declare a local variable named compstate that was not an
> } associative array.
> 
> That's not quite accurate.  The compstate array did retain its special
> properties when made local.  But it was equivalent to `compstate=()',
> which also causes a core dump.

Oops.  Better test if we get a table at all.


Bye
  Sven

Index: Src/Zle/complete.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complete.c,v
retrieving revision 1.18
diff -u -r1.18 complete.c
--- Src/Zle/complete.c	2001/07/25 14:49:33	1.18
+++ Src/Zle/complete.c	2001/08/24 09:23:46
@@ -1072,6 +1072,9 @@
     struct value v;
     char *str;
 
+    if (!ht)
+        return;
+
     for (i = 0; i < ht->hsize; i++)
 	for (hn = ht->nodes[i]; hn; hn = hn->next)
 	    for (cp = compkparams,

-- 
Sven Wischnowsky                    wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-24  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23  9:53 seg fault with compstate param Oliver Kiddle
2001-08-23 16:26 ` Bart Schaefer
2001-08-23 17:51   ` Bart Schaefer
2001-08-24  9:24     ` PATCH: " Sven Wischnowsky

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).