zsh-workers
 help / color / mirror / code / Atom feed
* Re: pcre module help
       [not found]   ` <20040620173608.GA38615@quark.hightek.org>
       [not found]     ` <20040620193711.GA15629@scowler.net>
@ 2004-06-20 22:44     ` Clint Adams
  2004-06-21  3:38       ` lists
  1 sibling, 1 reply; 4+ messages in thread
From: Clint Adams @ 2004-06-20 22:44 UTC (permalink / raw)
  To: Vincent Stemen; +Cc: zsh-workers

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


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

* Re: pcre module help
  2004-06-20 22:44     ` Clint Adams
@ 2004-06-21  3:38       ` lists
  0 siblings, 0 replies; 4+ messages in thread
From: lists @ 2004-06-21  3:38 UTC (permalink / raw)
  To: zsh-workers

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


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

* Re: pcre module help
  2004-06-20 21:30         ` pcre module help Clint Adams
@ 2004-06-21  9:28           ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2004-06-21  9:28 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:
> [Moving to -workers]
> 
> > I would still think it should not crash because of a missing feature.
> > If you still would like a backtrace to find that problem, I will try
> > to get around to recompiling it with debugging turned on and generate
> > one for you.  Just let me know.
> 
> Yes, there could be something wrong with bin_notavail or cond_match.
> A backtrace could shed some light on this.

I'm kind of down on bin_notavail anyway.  It's pointless compiling the
module if it's not going to provide anything.  Failing to load it
with zmodload is a much more transparent way of finding that the
feature isn't available.  Otherwise, you're lulled into a false sense
of security about something which could fail to work in a lot of
different ways --- as in this case, we're not always concerned just
with builtins.  These multiple possible failure modes are asking for
trouble.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, 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.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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

* Re: pcre module help
       [not found]       ` <20040620212037.GA39276@quark.hightek.org>
@ 2004-06-20 21:30         ` Clint Adams
  2004-06-21  9:28           ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2004-06-20 21:30 UTC (permalink / raw)
  To: Vincent Stemen; +Cc: zsh-workers

[Moving to -workers]

> I would still think it should not crash because of a missing feature.
> If you still would like a backtrace to find that problem, I will try
> to get around to recompiling it with debugging turned on and generate
> one for you.  Just let me know.

Yes, there could be something wrong with bin_notavail or cond_match.
A backtrace could shed some light on this.


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

end of thread, other threads:[~2004-06-21  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <D289C58E-C2AF-11D8-8B47-000A95D2C79E@kalama.no-ip.org>
     [not found] ` <20040620144844.GA24131@scowler.net>
     [not found]   ` <20040620173608.GA38615@quark.hightek.org>
     [not found]     ` <20040620193711.GA15629@scowler.net>
     [not found]       ` <20040620212037.GA39276@quark.hightek.org>
2004-06-20 21:30         ` pcre module help Clint Adams
2004-06-21  9:28           ` Peter Stephenson
2004-06-20 22:44     ` Clint Adams
2004-06-21  3:38       ` lists

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