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

Re: pcre module help



Hi all,
First, thanks for the documentation patch. Secondly, I am unable to use the pcre module on Mac OS 10.3.4. Regarding the bus error:

% zsh -f
% print $ZSH_VERSION
4.2.0
% zmodload zsh/pcre
% text=d
% [[ "$text" -pcre-match ^d+$ ]] && print text variable contains only "d's".
zsh: bus error  zsh -f

(at that point the shell exits)

I haven't used gdb before, so please correct me if this is wrong:
1. In one shell, I do the following:
% zsh -f
% zmodload zsh/pcre

2. In another shell, I did:
% ps ax|grep "[z]sh -f"
18610  p4  S+     0:00.03 zsh -f
% gdb /usr/local/bin/zsh 18610
GNU gdb 5.3-20030128 (Apple version gdb-309) (Thu Dec 4 15:41:30 GMT 2003)
Copyright 2003 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 "powerpc-apple-darwin".
Reading symbols for shared libraries ... done
/Users/me/18610: No such file or directory.
Attaching to program: `/usr/local/bin/zsh', process 18610.
Reading symbols for shared libraries ..... done
0x9000eac4 in read ()
(gdb) bt
#0  0x9000eac4 in read ()
#1  0x000b65ec in ungetkeys ()
#2  0x000b677c in getkey ()
#3  0x000b5d5c in getkeymapcmd ()
#4  0x000b5c80 in getkeymapcmd ()
#5  0x000b5e80 in getkeycmd ()
#6  0x000b6ac8 in zlecore ()
#7  0x000b70c4 in zleread ()
#8  0x000287e0 in ingetc ()
#9  0x00028638 in ingetc ()
#10 0x000200f0 in iaddtoline ()
#11 0x0002ebe8 in gettok ()
#12 0x0002e1c0 in yylex ()
#13 0x00044d88 in parse_event ()
#14 0x00025594 in loop ()
#15 0x000282f0 in zsh_main ()
#16 0x00001c98 in start ()
#17 0x8fe1a558 in __dyld__dyld_start ()
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: `/usr/local/bin/zsh', process 18610 thread 0x307.


Please let me know if other/more information would help. Regarding the "pcre_compile: not available on this system" message:

% zsh -f
% zmodload zsh/pcre
% pcre_compile ^d+$
pcre_compile: not available on this system

I just attempted to compile zsh 4.2.0 with the --enable-pcre option again and noticed the following:

checking for pcre_compile... no
checking for pcre_study... no
checking for pcre_exec... no
...
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
...
checking for library containing pcre_compile... no

What could it be? I'm happy to get you more information/test patches, etc.

Thanks,
Ryan


On Jun 20, 2004, at 5:44 PM, Clint Adams wrote:

The shell crashing is consistent when I try to use -pcre-match after
attempting to run pcre_compile.  Also, the -pcre-match method is not
mentioned in the zshmodules manual.


Index: Doc/Zsh/mod_pcre.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_pcre.yo,v
retrieving revision 1.4
diff -u -r1.4 mod_pcre.yo
--- Doc/Zsh/mod_pcre.yo	16 Mar 2004 15:14:39 -0000	1.4
+++ Doc/Zsh/mod_pcre.yo	20 Jun 2004 22:42:20 -0000
@@ -32,3 +32,15 @@
 case it will set the array var(arr).
 )
 enditem()
+
+The tt(zsh/pcre) module makes available the following test condition:
+startitem()
+findex(pcre-match)
+item(expr tt(-pcre-match) pcre)(
+Matches a string against a perl-compatible regular expression.
+
+For example,
+
+[[ "$text" -pcre-match ^d+$ ]] && print text variable contains only "d's".
+)
+enditem()



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