zsh-workers
 help / color / mirror / code / Atom feed
* [UNFINISHED] email to zsh
@ 2005-06-29  4:26 Mac-arena the Bored Zo
  2005-06-29 10:15 ` Peter Stephenson
  2005-07-01 14:44 ` Peter Stephenson
  0 siblings, 2 replies; 10+ messages in thread
From: Mac-arena the Bored Zo @ 2005-06-29  4:26 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 5326 bytes --]

I am not on the list, so please CC me with any replies.

I'm running zsh 4.2.5 (built from sources) and 4.2.3 (stock Apple  
install) on Mac OS X 10.4.1. the bug existed in 10.4 as well. this is  
a consistently-repeatable crash.

my current working directory: /Users/boredzo/Projects/ 
@otherpeoplesprojects/adium

I type:
     twe[tab: twedit] plug[tab: Plugins/]webk[tab: WebKit\ Message\  
View/]aiwe[tab: AIWebKitMessageView]p[tab]

and it crashes (SIGSEGV). the full expansion, before the 'p', is:
     Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m

there is no file 'Plugins/WebKit Message View/ 
AIWebKitMessageViewPlugin.mp'; it was a typo. I recorded it for the  
sole reason that it's how to cause the crash. :)

this happened before I set up zshcompsys as well. my compctls:

compctl -g '*.z[12345678]' + frotz
compctl -g '*(/)' cd
hosts=(finch.fourx.org)
compctl -k hosts telnet ftp ssh
compctl -g '*.py' + -f python
compctl -M '' 'm:{a-zA-Z}={A-Za-z}'
bindkey "^I" expand-or-complete-prefix
bindkey "^X^I" expand-or-complete

it still happens with zshcompsys. since setting that up, I have  
removed the cd, python, and case-insensitivity compctls, and it did  
not help.

with zshcompsys, this also makes zsh crash:

twe[tab] plug/webk/aiwe[tab]p[tab]

my setopt output:

autocd
completeinword
correctall
interactive
nolistbeep
login
monitor
shinstdin
zle

with compctl, the crash log is:

Host Name:      Silent-Partner
Date/Time:      2005-05-05 04:04:49.967 -0700
OS Version:     10.4 (Build 8A428)
Report Version: 3

Command: zsh
Path:    /bin/zsh
Parent:  login [4228]

Version: ??? (???)

PID:    4229
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x002fffff

Thread 0 Crashed:
0   <<00000000>>     0xffff8c6c __memcpy + 1228 (cpu_capabilities.h:189)
1   complete.so     0x000bdbdc revert_cline + 476
2   complete.so     0x000bede0 match_str + 3572
3   complete.so     0x000bf478 comp_match + 300
4   compctl.so      0x000d24ac compctlread + 14432
5   compctl.so      0x000d3024 getcpat + 1684
6   compctl.so      0x000d674c getcpat + 15804
7   compctl.so      0x000d3c28 getcpat + 4760
8   compctl.so      0x000d3b48 getcpat + 4536
9   compctl.so      0x000d38dc getcpat + 3916
10  compctl.so      0x000d1ebc compctlread + 12912
11  complete.so     0x000b7d08 after_complete + 6224
12  complete.so     0x000b5df4 do_completion + 996
13  zle.so          0x0009a55c inststrlen + 980
14  zle.so          0x00097b1c parambeg + 3932
15  zle.so          0x000965ec expandorcomplete + 252
16  zle.so          0x0009be6c expandorcompleteprefix + 40
17  zle.so          0x0008b3f0 execzlefunc + 540
18  zle.so          0x0008aac4 zlecore + 268
19  zle.so          0x0008b0f0 zleread + 1124
20  zsh             0x000299e0 ingetc + 752
21  zsh             0x0002982c ingetc + 316
22  zsh             0x00020a94 iaddtoline + 476
23  zsh             0x000301f8 gettok + 72
24  zsh             0x0002f7d4 yylex + 48
25  zsh             0x000464f0 parse_event + 76
26  zsh             0x000266c8 loop + 200
27  zsh             0x00029470 zsh_main + 596
28  zsh             0x00001d18 start + 412
29  zsh             0x00001bb8 start + 60

Thread 0 crashed with PPC Thread State:
   srr0: 0xffff8c6c srr1: 0x0200f030                vrsave: 0xff000000
     cr: 0x4802224a  xer: 0x20000004   lr: 0x000bdbdc  ctr: 0x03fffb6b
     r0: 0x00000002   r1: 0xbfffe780   r2: 0x00000000   r3: 0x00312516
     r4: 0x0006f220   r5: 0xffffffea   r6: 0xffffffef   r7: 0xffffffdf
     r8: 0xffffffcf   r9: 0xffffffff  r10: 0xffffff9f  r11: 0xffffff7f
    r12: 0x00300000  r13: 0x00000000  r14: 0x00000022  r15: 0x0000000e
    r16: 0x00081776  r17: 0x0000001e  r18: 0x00081768  r19: 0x00081756
    r20: 0x00000001  r21: 0x00000001  r22: 0x00000000  r23: 0x000cdaf8
    r24: 0x000c9af0  r25: 0x00081776  r26: 0x000c9398  r27: 0x00081756
    r28: 0x0030d850  r29: 0x000cdaf8  r30: 0xfffffffb  r31: 0x000bdaf8

Binary Images Description:
     0x1000 -    0x6dfff zsh     /bin/zsh
    0x83000 -    0xa4fff zle.so     /usr/lib/zsh/4.2.3/zsh/zle.so
    0xb2000 -    0xc8fff complete.so     /usr/lib/zsh/4.2.3/zsh/ 
complete.so
    0xce000 -    0xd8fff compctl.so     /usr/lib/zsh/4.2.3/zsh/ 
compctl.so
0x8fe00000 - 0x8fe50fff dyld 43    /usr/lib/dyld
0x90000000 - 0x901a6fff libSystem.B.dylib     /usr/lib/libSystem.B.dylib
0x901fe000 - 0x90202fff libmathCommon.A.dylib     /usr/lib/system/ 
libmathCommon.A.dylib
0x92c9b000 - 0x92d89fff libiconv.2.dylib     /usr/lib/libiconv.2.dylib
0x9680c000 - 0x9683afff libncurses.5.4.dylib     /usr/lib/libncurses. 
5.4.dylib

with zshcompsys, the crash log is:

http://paste.lisp.org/display/9472 (this email would be over 20 K if  
I included it here.)

this is not a simple recursion-limit crash; it is worth pointing out  
that getfpfunc is called from all three of execif, execfor, and  
execwhile.

I have been unable to get debug symbols in zsh. I tried:

     CFLAGS=-g ./configure --with-curses-terminfo --enable-pcre -- 
enable-zsh-secure-free
     (these being the same configure options I normally use)

but no source code references appeared in the crash log, nor debug  
symbols in the built executable.
_________________________________________________
\ Mac-arena the Bored Zo / macrulez@softhome.net
PGP public key ID: 328A4FCC


[-- Attachment #1.2: Type: text/html, Size: 7873 bytes --]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

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

* Re: [UNFINISHED] email to zsh
  2005-06-29  4:26 [UNFINISHED] email to zsh Mac-arena the Bored Zo
@ 2005-06-29 10:15 ` Peter Stephenson
  2005-06-29 10:28   ` Mac-arena the Bored Zo
  2005-07-01 14:44 ` Peter Stephenson
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2005-06-29 10:15 UTC (permalink / raw)
  To: Mac-arena the Bored Zo, zsh-workers

Mac-arena the Bored Zo wrote:
> I type:
>      twe[tab: twedit] plug[tab: Plugins/]webk[tab: WebKit\ Message\  
> View/]aiwe[tab: AIWebKitMessageView]p[tab]
> 
> and it crashes (SIGSEGV). the full expansion, before the 'p', is:
>      Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m

Can't get this on my system, even with the simplified compctl form:
could you send a full directory listing?

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: email to zsh
  2005-06-29 10:15 ` Peter Stephenson
@ 2005-06-29 10:28   ` Mac-arena the Bored Zo
  2005-06-29 11:39     ` Peter Stephenson
  0 siblings, 1 reply; 10+ messages in thread
From: Mac-arena the Bored Zo @ 2005-06-29 10:28 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

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

(oops, forgot to remove that '[UNFINISHED]' tag. I always forget  
something like that. sorry.)

On Jun 29, 2005, at 03:15 AM, Peter Stephenson wrote:
> Can't get this on my system, even with the simplified compctl form:  
> could you send a full directory listing?

of what directory?
_________________________________________________
\ Mac-arena the Bored Zo / macrulez@softhome.net
PGP public key ID: 328A4FCC


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

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

* Re: email to zsh
  2005-06-29 10:28   ` Mac-arena the Bored Zo
@ 2005-06-29 11:39     ` Peter Stephenson
  2005-06-29 13:03       ` Mac-arena the Bored Zo
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2005-06-29 11:39 UTC (permalink / raw)
  To: Mac-arena the Bored Zo, Zsh hackers list

Mac-arena the Bored Zo wrote:
> On Jun 29, 2005, at 03:15 AM, Peter Stephenson wrote:
> > Can't get this on my system, even with the simplified compctl form:  
> > could you send a full directory listing?
> 
> of what directory?

The one it's completing in when it crashes.  compctl isn't sensitive
to the higher directories: compsys might be but it doesn't explain the
other crash.

pws


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: email to zsh
  2005-06-29 11:39     ` Peter Stephenson
@ 2005-06-29 13:03       ` Mac-arena the Bored Zo
  0 siblings, 0 replies; 10+ messages in thread
From: Mac-arena the Bored Zo @ 2005-06-29 13:03 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

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

On Jun 29, 2005, at 04:39 AM, Peter Stephenson wrote:
> Mac-arena the Bored Zo wrote:
>> On Jun 29, 2005, at 03:15 AM, Peter Stephenson wrote:
>>> Can't get this on my system, even with the simplified compctl  
>>> form: could you send a full directory listing?
>>
>> of what directory?
>
> The one it's completing in when it crashes.  compctl isn't  
> sensitive to the higher directories: compsys might be but it  
> doesn't explain the other crash.

mine is a clean checkout, so it's all of these files:

http://trac.adiumx.com/browser/trunk/Plugins/WebKit%20Message%20View? 
rev=12614

plus the .svn directory.
_________________________________________________
\ Mac-arena the Bored Zo / macrulez@softhome.net
PGP public key ID: 328A4FCC


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

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

* Re: email to zsh
  2005-06-29  4:26 [UNFINISHED] email to zsh Mac-arena the Bored Zo
  2005-06-29 10:15 ` Peter Stephenson
@ 2005-07-01 14:44 ` Peter Stephenson
  2005-07-06  9:50   ` Peter Stephenson
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2005-07-01 14:44 UTC (permalink / raw)
  To: Mac-arena the Bored Zo, Zsh hackers list

Mac-arena the Bored Zo wrote:
> I'm running zsh 4.2.5 (built from sources) and 4.2.3 (stock Apple  
> install) on Mac OS X 10.4.1. the bug existed in 10.4 as well. this is  
> a consistently-repeatable crash.

I can get this now.  From zsh -f, any recent version, in an empty
directory:

files=(AIWebKitMessageViewController.m
AIWebKitMessageViewPlugin.m
AIWebkitMessageViewStyle.m)
touch $files
chmod +x *.m
compctl -M '' 'm:{a-zA-Z}={A-Za-z}'
./AIWebKitMessagep

then TAB will cause it to happen.  I think the compctl -M is the key:
it's somewhere in the hairy matcher code.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: email to zsh
  2005-07-01 14:44 ` Peter Stephenson
@ 2005-07-06  9:50   ` Peter Stephenson
  2005-07-06 15:41     ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2005-07-06  9:50 UTC (permalink / raw)
  To: Mac-arena the Bored Zo, Zsh hackers list

Peter Stephenson wrote:
> I can get this now.  From zsh -f, any recent version, in an empty
> directory:
> 
> files=(AIWebKitMessageViewController.m
> AIWebKitMessageViewPlugin.m
> AIWebkitMessageViewStyle.m)
> touch $files
> chmod +x *.m
> compctl -M '' 'm:{a-zA-Z}={A-Za-z}'
> ./AIWebKitMessagep
> 
> then TAB will cause it to happen.  I think the compctl -M is the key:
> it's somewhere in the hairy matcher code.

This seems to fix the problem, and allow the completion to work as
expected, though I haven't a clue what the code I've fixed is doing.

Index: Src/Zle/compmatch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v
retrieving revision 1.42
diff -u -r1.42 compmatch.c
--- Src/Zle/compmatch.c	4 Jun 2004 06:00:40 -0000	1.42
+++ Src/Zle/compmatch.c	6 Jul 2005 09:47:39 -0000
@@ -803,14 +803,26 @@
 		    /* Probably add the matched strings. */
 		    if (!test) {
 			if (sfx)
-			    add_match_str(NULL, NULL, w, ow - w, sfx);
+			{
+			    if (ow >= w)
+				add_match_str(NULL, NULL, w, ow - w, sfx);
+			}
 			else
-			    add_match_str(NULL, NULL, ow, w - ow, sfx);
+			{
+			    if (w >= ow)
+				add_match_str(NULL, NULL, ow, w - ow, sfx);
+			}
 			add_match_str(mp, tl, tw, mp->wlen, sfx);
 			if (sfx)
-			    add_match_sub(NULL, NULL, 0, w, ow - w);
+			{
+			    if (ow >= w)
+				add_match_sub(NULL, NULL, 0, w, ow - w);
+			}
 			else
-			    add_match_sub(NULL, NULL, 0, ow, w - ow);
+			{
+			    if (w >= ow)
+				add_match_sub(NULL, NULL, 0, ow, w - ow);
+			}
 			add_match_sub(mp, tl, mp->llen, tw, mp->wlen);
 		    }
 		    if (sfx) {

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: email to zsh
  2005-07-06  9:50   ` Peter Stephenson
@ 2005-07-06 15:41     ` Bart Schaefer
  2005-07-06 15:56       ` Peter Stephenson
  0 siblings, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2005-07-06 15:41 UTC (permalink / raw)
  To: Zsh hackers list

On Jul 6, 10:50am, Peter Stephenson wrote:
} Subject: Re: email to zsh
}
} Peter Stephenson wrote:
} This seems to fix the problem, and allow the completion to work as
} expected, though I haven't a clue what the code I've fixed is doing.

As best I can tell, ow and w are supposed to bound a region of the
original string (from the command line) that is being added as a match;
add_match_str() sets up the fragment that matched the pattern, and
add_match_sub() sets up the fragment that should be inserted into the
command line to replace it (which in this case is the original text,
so the calls are the same).

sfx indicates whether this is a prefix or suffix match.  In that case
w should be tracking backwards from ow towards the beginning of the
string, otherwise w should be tracking forwards from ow.  At the end
of the inner loop ow = w is assigned, so the only way they ever move
apart is if one of the "continue" statements is hit.

So if you arrive at this point with (sfx && w > ow) || (!sfx && ow > w)
then there has already been an error somewhere else, and all that this
patch will do is mask that error to prevent a crash.

I don't have time right now to look at it any more closely ...


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

* Re: email to zsh
  2005-07-06 15:41     ` Bart Schaefer
@ 2005-07-06 15:56       ` Peter Stephenson
  2005-07-07  8:07         ` Felix Rosencrantz
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2005-07-06 15:56 UTC (permalink / raw)
  To: Zsh hackers list

Bart Schaefer wrote:
> So if you arrive at this point with (sfx && w > ow) || (!sfx && ow > w)
> then there has already been an error somewhere else, and all that this
> patch will do is mask that error to prevent a crash.

That always seemed highly likely, but until someone has six weeks to
work out what the function is doing...

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: email to zsh
  2005-07-06 15:56       ` Peter Stephenson
@ 2005-07-07  8:07         ` Felix Rosencrantz
  0 siblings, 0 replies; 10+ messages in thread
From: Felix Rosencrantz @ 2005-07-07  8:07 UTC (permalink / raw)
  To: Zsh hackers list

Seems like a good time to repost an outstanding problem from a year 
ago.  This seems to be matching code related.

-FR.

zsh-workers/20057
http://www.zsh.org/mla/workers/2004/msg00707.html

zsh -f
autoload -U compinit; compinit -C
zstyle ':completion:*' matcher-list 'r:|[ ]=** r:[^a-z]||[a-z]=**'
mkdir bug; cd bug
touch "steve green" "steve morrow" "peter stephenson"
more st<TAB>
peter\ stephenson  steve\ green       steve\ morrow
more ./st<TAB>

The first case looks correct.  Though when I type <TAB> in the last case, it
deletes the "st" and my line looks like: "more ./"  I'm guessing it might be
_path_files, because I get the error when it includes a leading path.


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

end of thread, other threads:[~2005-07-07  8:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-29  4:26 [UNFINISHED] email to zsh Mac-arena the Bored Zo
2005-06-29 10:15 ` Peter Stephenson
2005-06-29 10:28   ` Mac-arena the Bored Zo
2005-06-29 11:39     ` Peter Stephenson
2005-06-29 13:03       ` Mac-arena the Bored Zo
2005-07-01 14:44 ` Peter Stephenson
2005-07-06  9:50   ` Peter Stephenson
2005-07-06 15:41     ` Bart Schaefer
2005-07-06 15:56       ` Peter Stephenson
2005-07-07  8:07         ` Felix Rosencrantz

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