zsh-workers
 help / color / mirror / code / Atom feed
* Seg fault with zmodload -u
@ 2000-08-15 15:18 Oliver Kiddle
  2000-08-15 15:40 ` Thomas Köhler
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Oliver Kiddle @ 2000-08-15 15:18 UTC (permalink / raw)
  To: Zsh workers

zsh -f
zmodload -ud zsh/zleparameter zsh/zle
zsh: 18383 segmentation fault  zsh -f

I found this because I was going through the various zmodload options 
because I was doing an _arguments based completion for it. It happens
wherever the dependencies are defined, i.e, zmodload -d foo bar;zmodload
-du foo bar will also result in a seg fault.

This is on 3.1.9-dev-4 plus patches up to 12568 on AIX. If it isn't
reproducible elsewhere, I'll upgrade to the latest cvs and try again.

On the subject of zmodload completion, how would I prevent the 'module
alias' description from being displayed when there are no module
aliases - do I have to put the zmodload -A output in an array first and
then not call the _requested line if the array is empty - or is there a
better way?

Oliver


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

* Re: Seg fault with zmodload -u
  2000-08-15 15:18 Seg fault with zmodload -u Oliver Kiddle
@ 2000-08-15 15:40 ` Thomas Köhler
  2000-08-15 15:48   ` Thomas Köhler
  2000-08-15 15:43 ` Andrej Borsenkow
  2000-08-15 15:52 ` Peter Stephenson
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Köhler @ 2000-08-15 15:40 UTC (permalink / raw)
  To: Zsh workers

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

On Tue, Aug 15, 2000 at 05:24:45PM +0200,
Oliver Kiddle <opk@u.genie.co.uk> wrote:
> 
> zsh -f
> zmodload -ud zsh/zleparameter zsh/zle
> zsh: 18383 segmentation fault  zsh -f
[...]
> This is on 3.1.9-dev-4 plus patches up to 12568 on AIX. If it isn't
> reproducible elsewhere, I'll upgrade to the latest cvs and try again.

~> zsh -f
picard% zmodload -ud zsh/zleparameter zsh/zle
zsh: segmentation fault (core dumped)  zsh -f
~> echo $ZSH_VERSION
3.1.9-dev-5

> Oliver

CU,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

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

* RE: Seg fault with zmodload -u
  2000-08-15 15:18 Seg fault with zmodload -u Oliver Kiddle
  2000-08-15 15:40 ` Thomas Köhler
@ 2000-08-15 15:43 ` Andrej Borsenkow
  2000-08-15 15:49   ` Andrej Borsenkow
  2000-08-15 15:52 ` Peter Stephenson
  2 siblings, 1 reply; 8+ messages in thread
From: Andrej Borsenkow @ 2000-08-15 15:43 UTC (permalink / raw)
  To: Oliver Kiddle, Zsh workers

>
> zsh -f
> zmodload -ud zsh/zleparameter zsh/zle
> zsh: 18383 segmentation fault  zsh -f
>
> I found this because I was going through the various zmodload options
> because I was doing an _arguments based completion for it. It happens
> wherever the dependencies are defined, i.e, zmodload -d foo bar;zmodload
> -du foo bar will also result in a seg fault.
>
> This is on 3.1.9-dev-4 plus patches up to 12568 on AIX. If it isn't
> reproducible elsewhere, I'll upgrade to the latest cvs and try again.
>

With the latest CVS:

bor@itsrm2% zsh -f
itsrm2% zmodload -ud zsh/zleparameter zsh/zle
zsh: bus error (core dumped)  zsh -f

Note, that bus error normaly means unaligned memory access here (MIPS R4400).
That is quite different from out-of-bounds error.

In any case, if you can test if current CVS builds on AIX, it would be very
nice. I made some changes for Cygwin - hopefully, they do not affect other
systems.

> On the subject of zmodload completion, how would I prevent the 'module
> alias' description from being displayed when there are no module
> aliases - do I have to put the zmodload -A output in an array first and
> then not call the _requested line if the array is empty - or is there a
> better way?
>

I use grouping (zstyle ':completion:*' group-name '') and if there are no
matches for a given tag, it is not printed. Dunno in general case.

-andrej


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

* Re: Seg fault with zmodload -u
  2000-08-15 15:40 ` Thomas Köhler
@ 2000-08-15 15:48   ` Thomas Köhler
  2000-08-15 15:56     ` Thomas Köhler
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Köhler @ 2000-08-15 15:48 UTC (permalink / raw)
  To: Zsh workers

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

On Tue, Aug 15, 2000 at 05:42:13PM +0200, I wrote:
> 
> On Tue, Aug 15, 2000 at 05:24:45PM +0200,
> Oliver Kiddle <opk@u.genie.co.uk> wrote:
> > 
> > zsh -f
> > zmodload -ud zsh/zleparameter zsh/zle
> > zsh: 18383 segmentation fault  zsh -f
> [...]
> > This is on 3.1.9-dev-4 plus patches up to 12568 on AIX. If it isn't
> > reproducible elsewhere, I'll upgrade to the latest cvs and try again.
> 
> ~> zsh -f
> picard% zmodload -ud zsh/zleparameter zsh/zle
> zsh: segmentation fault (core dumped)  zsh -f
> ~> echo $ZSH_VERSION
> 3.1.9-dev-5

Oops, forgot to mention, this is on Linux for i386.

CU,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

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

* RE: Seg fault with zmodload -u
  2000-08-15 15:43 ` Andrej Borsenkow
@ 2000-08-15 15:49   ` Andrej Borsenkow
  0 siblings, 0 replies; 8+ messages in thread
From: Andrej Borsenkow @ 2000-08-15 15:49 UTC (permalink / raw)
  To: Andrej Borsenkow, Oliver Kiddle, Zsh workers

>
> bor@itsrm2% zsh -f
> itsrm2% zmodload -ud zsh/zleparameter zsh/zle
> zsh: bus error (core dumped)  zsh -f
>
> Note, that bus error normaly means unaligned memory access here
> (MIPS R4400).
> That is quite different from out-of-bounds error.
>

(dbx32) where
realfree() at 0x8050958
cleanfree() at 0x8051328
malloc() at 0x80502b4
zcalloc(size = 64), line 469 in "/tools/src/zsh/Src/mem.c"
hbegin(dohist = 1), line 752 in "/tools/src/zsh/Src/hist.c"
.init.loop(toplevel = 1, justonce = 0), line 111 in
"/tools/src/zsh/Src/init.c"
zsh_main(argc = 2, argv = 0x7ffeed4c), line 1197 in
"/tools/src/zsh/Src/init.c"
.main.main(argc = 2, argv = 0x7ffeed4c), line 37 in
"/tools/src/zsh/Src/main.c"
__start() at 0x409c24

It does not help much. malloc() internals are already corrupted :-(

-andrej


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

* Re: Seg fault with zmodload -u
  2000-08-15 15:18 Seg fault with zmodload -u Oliver Kiddle
  2000-08-15 15:40 ` Thomas Köhler
  2000-08-15 15:43 ` Andrej Borsenkow
@ 2000-08-15 15:52 ` Peter Stephenson
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Stephenson @ 2000-08-15 15:52 UTC (permalink / raw)
  To: Zsh hackers list

Oliver wrote:
> On the subject of zmodload completion, how would I prevent the 'module
> alias' description from being displayed when there are no module
> aliases - do I have to put the zmodload -A output in an array first and
> then not call the _requested line if the array is empty - or is there a
> better way?

This is easy, anyway. (Remind me to commit this later.)

Index: Completion/Builtins/_zmodload
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_zmodload,v
retrieving revision 1.4
diff -u -r1.4 _zmodload
--- Completion/Builtins/_zmodload	2000/08/14 15:46:17	1.4
+++ Completion/Builtins/_zmodload	2000/08/15 15:52:12
@@ -11,8 +11,11 @@
   while _tags; do
     _requested files expl 'module file' \
       _files -W module_path -/g '*.(dll|s[ol])(:r)' && ret=0
-    _requested aliases expl 'module alias' \
-      compadd -- ${${(f)"$(zmodload -A)"}%% *} && ret=0
+    if _requested aliases expl 'module alias'; then
+      local array
+      array=(${${(f)"$(zmodload -A)"}%% *})
+      (( $#array )) && compadd "${expl[@]}" -- $array && ret=0
+    fi
     (( ret )) || break
   done
 fi

-- 
Peter Stephenson <pws@csr.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: Seg fault with zmodload -u
  2000-08-15 15:48   ` Thomas Köhler
@ 2000-08-15 15:56     ` Thomas Köhler
  2000-08-15 16:46       ` PATCH: " Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Köhler @ 2000-08-15 15:56 UTC (permalink / raw)
  To: Zsh workers

[-- Attachment #1: Type: text/plain, Size: 3385 bytes --]

On Tue, Aug 15, 2000 at 05:50:28PM +0200, I wrote:
> 
> On Tue, Aug 15, 2000 at 05:42:13PM +0200, I wrote:
> > 
> > On Tue, Aug 15, 2000 at 05:24:45PM +0200,
> > Oliver Kiddle <opk@u.genie.co.uk> wrote:
> > > 
> > > zsh -f
> > > zmodload -ud zsh/zleparameter zsh/zle
> > > zsh: 18383 segmentation fault  zsh -f
> > [...]
> > > This is on 3.1.9-dev-4 plus patches up to 12568 on AIX. If it isn't
> > > reproducible elsewhere, I'll upgrade to the latest cvs and try again.
> > 
> > ~> zsh -f
> > picard% zmodload -ud zsh/zleparameter zsh/zle
> > zsh: segmentation fault (core dumped)  zsh -f
> > ~> echo $ZSH_VERSION
> > 3.1.9-dev-5
> 
> Oops, forgot to mention, this is on Linux for i386.

And here's the gdb ouput:
~> gdb =zsh core
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i686-pc-linux-gnu"...(no debugging symbols found)...
Core was generated by `zsh -f'.
Program terminated with signal 11, Speicherzugriffsfehler.
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libncurses.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_compat.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /usr/lib/zsh/3.1.9-dev-5/zsh/zle.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/zsh/3.1.9-dev-5/zsh/zle.so
Reading symbols from /usr/lib/zsh/3.1.9-dev-5/zsh/complete.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/zsh/3.1.9-dev-5/zsh/complete.so
Reading symbols from /usr/lib/zsh/3.1.9-dev-5/zsh/compctl.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/zsh/3.1.9-dev-5/zsh/compctl.so
#0  0x80767f1 in deletewrapper ()
(gdb) where
#0  0x80767f1 in deletewrapper ()
#1  0x8077595 in bin_zmodload ()
#2  0x8077071 in bin_zmodload ()
#3  0x8051d7d in execbuiltin ()
#4  0x805e36c in execsubst ()
#5  0x805bda5 in execlist ()
#6  0x805b583 in execlist ()
#7  0x805b101 in execlist ()
#8  0x805aed6 in execode ()
#9  0x806a66e in loop ()
#10 0x806c8d4 in zsh_main ()
#11 0x8051648 in main ()
#12 0x400a6a42 in __libc_start_main () from /lib/libc.so.6
(gdb) 

Does this help in any way?

CU,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

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

* PATCH: Re: Seg fault with zmodload -u
  2000-08-15 15:56     ` Thomas Köhler
@ 2000-08-15 16:46       ` Bart Schaefer
  0 siblings, 0 replies; 8+ messages in thread
From: Bart Schaefer @ 2000-08-15 16:46 UTC (permalink / raw)
  To: Zsh workers

Unintentional re-use of a local variable name.

And stuff in some horizontal whitespace, as long as I'm here.

Index: Src/module.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Src/module.c,v
retrieving revision 1.36
diff -u -r1.36 module.c
--- module.c	2000/08/08 15:24:41	1.36
+++ module.c	2000/08/15 16:45:44
@@ -1142,23 +1142,24 @@
 {
     LinkNode node;
     Module m;
-    if(ops['u']) {
+    if (ops['u']) {
 	/* remove dependencies, which can't pertain to aliases */
 	const char *tnam = *args++;
 	node = find_module(tnam, 1, &tnam);
 	if (!node)
 	    return 0;
 	m = (Module) getdata(node);
-	if(*args && m->deps) {
+	if (*args && m->deps) {
 	    do {
-		for(node = firstnode(m->deps); node; incnode(node))
-		    if(!strcmp(*args, getdata(node))) {
-			zsfree(getdata(node));
-			remnode(m->deps, node);
+		LinkNode dnode;
+		for (dnode = firstnode(m->deps); dnode; incnode(dnode))
+		    if (!strcmp(*args, getdata(dnode))) {
+			zsfree(getdata(dnode));
+			remnode(m->deps, dnode);
 			break;
 		    }
 	    } while(*++args);
-	    if(empty(m->deps)) {
+	    if (empty(m->deps)) {
 		freelinklist(m->deps, freestr);
 		m->deps = NULL;
 	    }
@@ -1171,13 +1172,13 @@
 	if (!m->deps && !m->u.handle)
 	    delete_module(node);
 	return 0;
-    } else if(!args[0] || !args[1]) {
+    } else if (!args[0] || !args[1]) {
 	/* list dependencies */
 	for (node = firstnode(modules); node; incnode(node)) {
 	    m = (Module) getdata(node);
 	    if (m->deps && (!args[0] || !strcmp(args[0], m->nam))) {
 		LinkNode n;
-		if(ops['L']) {
+		if (ops['L']) {
 		    printf("zmodload -d ");
 		    if(m->nam[0] == '-')
 			fputs("-- ", stdout);
@@ -1202,7 +1203,7 @@
 	int ret = 0;
 	char *tnam = *args++;
 
-	for(; *args; args++)
+	for (; *args; args++)
 	    add_dep(tnam, *args);
 	return ret;
     }

-- 
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] 8+ messages in thread

end of thread, other threads:[~2000-08-15 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-15 15:18 Seg fault with zmodload -u Oliver Kiddle
2000-08-15 15:40 ` Thomas Köhler
2000-08-15 15:48   ` Thomas Köhler
2000-08-15 15:56     ` Thomas Köhler
2000-08-15 16:46       ` PATCH: " Bart Schaefer
2000-08-15 15:43 ` Andrej Borsenkow
2000-08-15 15:49   ` Andrej Borsenkow
2000-08-15 15:52 ` Peter Stephenson

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