zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Extend (z) test with data that seemed to cause fail
@ 2017-03-09  8:16 ` Sebastian Gniazdowski
  2017-03-09 10:05   ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Gniazdowski @ 2017-03-09  8:16 UTC (permalink / raw)
  To: zsh-workers

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

Hello,
I have a finished script where I use (z). I once feed it a data:

^FZUI^_ text-field example:
^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\

on which for 4th "^Z..." segment it was returning multiple segments.
This happened for 5 minutes, then it stopped. Because I wasn't touching
the script-black-box, I think it's really a (z) thing. I suspect some
missing "calloc" instead of "malloc", etc. So maybe it's worth adding
this test case (patch attached) to D04parameter with this exact data:

  foo="^FZUI^_ text-field example:
  ^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\"
  print "${#${(z@)foo}}"
0:Test real-world data that once seemed to fail
>4

-- 
  Sebastian Gniazdowski
  psprint3@fastmail.com

[-- Attachment #2: z_realworld.diff --]
[-- Type: text/plain, Size: 490 bytes --]

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index fba95cc..ec799f2 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -640,6 +640,11 @@
 >echo
 >$(|||) bar
 
+  foo="\x06ZUI\x1f text-field example: \x1azuitfieldtfield1_1\x1a''\x1a''\x1a1\x1aZUI\[my_tfield1_width\]\x1aZUI\[my_tfield1_start\]\x1aZUI\[my_tfield1_data\]\x1c"
+  print "${#${(z@)foo}}"
+0:Test real-world data that once seemed to fail
+>4
+
   psvar=(dog)
   setopt promptsubst
   foo='It shouldn'\''t $(happen) to a %1v.'

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

* Re: [PATCH] Extend (z) test with data that seemed to cause fail
  2017-03-09  8:16 ` [PATCH] Extend (z) test with data that seemed to cause fail Sebastian Gniazdowski
@ 2017-03-09 10:05   ` Peter Stephenson
  2017-03-09 11:32     ` Sebastian Gniazdowski
  2017-03-10  4:35     ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Stephenson @ 2017-03-09 10:05 UTC (permalink / raw)
  To: zsh-workers

On Thu, 09 Mar 2017 00:16:36 -0800
Sebastian Gniazdowski <psprint3@fastmail.com> wrote:
> I have a finished script where I use (z). I once feed it a data:
> 
> ^FZUI^_ text-field example:
> ^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\
> 
> on which for 4th "^Z..." segment it was returning multiple segments.
> This happened for 5 minutes, then it stopped. Because I wasn't touching
> the script-black-box, I think it's really a (z) thing. I suspect some
> missing "calloc" instead of "malloc", etc. So maybe it's worth adding
> this test case (patch attached) to D04parameter with this exact data:
> 
>   foo="^FZUI^_ text-field example:
>   ^Zzuitfieldtfield1_1^Z''^Z''^Z1^ZZUI\[my_tfield1_width\]^ZZUI\[my_tfield1_start\]^ZZUI\[my_tfield1_data\]^\"
>   print "${#${(z@)foo}}"
> 0:Test real-world data that once seemed to fail
> >4

I've turned the file text into printable characters like this.

pws

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index fba95cc..704c599 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -640,6 +640,11 @@
 >echo
 >$(|||) bar
 
+  foo=$'\x06ZUI\x1f text-field example: \x1azuitfieldtfield1_1\x1a\'\'\x1a\'\'\x1a1\x1aZUI\[my_tfield1_width\]\x1aZUI\[my_tfield1_start\]\x1aZUI\[my_tfield1_data\]\x1c'
+  print "${#${(z@)foo}}"
+0:Test real-world data that once seemed to fail
+>4
+
   psvar=(dog)
   setopt promptsubst
   foo='It shouldn'\''t $(happen) to a %1v.'


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

* Re: [PATCH] Extend (z) test with data that seemed to cause fail
  2017-03-09 10:05   ` Peter Stephenson
@ 2017-03-09 11:32     ` Sebastian Gniazdowski
  2017-03-09 11:49       ` Peter Stephenson
  2017-03-10  4:35     ` Bart Schaefer
  1 sibling, 1 reply; 6+ messages in thread
From: Sebastian Gniazdowski @ 2017-03-09 11:32 UTC (permalink / raw)
  To: zsh-workers

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

On Thu, Mar 9, 2017, at 02:05 AM, Peter Stephenson wrote:
> I've turned the file text into printable characters like this.
(...)
> +  foo=$'\x06ZUI\x1f text-field example:
> \x1azuitfieldtfield1_1\x1a\'\'\x1a\'\'\x1a1\x1aZUI\[my_tfield1_width\]\x1aZUI\[my_tfield1_start\]\x1aZUI\[my_tfield1_data\]\x1c'

Checked with echo -E and print -r that \\[ is also needed, otherwise the
same
-- 
  Sebastian Gniazdowski
  psprint3@fastmail.com

[-- Attachment #2: z_realworld3.diff --]
[-- Type: text/plain, Size: 561 bytes --]

diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index fba95cc..f1f054d 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -640,6 +640,12 @@
 >echo
 >$(|||) bar
 
+  foo=$'\x06ZUI\x1f text-field example: \x1azuitfieldtfield1_1\x1a\'\'\x1a\'\'\x1a1\x1aZUI\\[my_tfield1_width\\]\x1aZUI\\[my_tfield1_start\\]\x1aZUI\\[my_tfield1_data\\]\x1c'
+  echo -E "$foo" > ~/output3
+  print "${#${(z@)foo}}"
+0:Test real-world data that once seemed to fail
+>4
+
   psvar=(dog)
   setopt promptsubst
   foo='It shouldn'\''t $(happen) to a %1v.'

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

* Re: [PATCH] Extend (z) test with data that seemed to cause fail
  2017-03-09 11:32     ` Sebastian Gniazdowski
@ 2017-03-09 11:49       ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2017-03-09 11:49 UTC (permalink / raw)
  To: zsh-workers

On Thu, 09 Mar 2017 03:32:50 -0800
Sebastian Gniazdowski <psprint3@fastmail.com> wrote:
> On Thu, Mar 9, 2017, at 02:05 AM, Peter Stephenson wrote:
> > I've turned the file text into printable characters like this.
> (...)
> > +  foo=$'\x06ZUI\x1f text-field example:
> > \x1azuitfieldtfield1_1\x1a\'\'\x1a\'\'\x1a1\x1aZUI\[my_tfield1_width\]\x1aZUI\[my_tfield1_start\]\x1aZUI\[my_tfield1_data\]\x1c'
> 
> Checked with echo -E and print -r that \\[ is also needed, otherwise the
> same

Oh, you mean that both the \['s and the \]'s in the original are literal
two-character strings.  I'll change that.

pws


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

* Re: [PATCH] Extend (z) test with data that seemed to cause fail
  2017-03-09 10:05   ` Peter Stephenson
  2017-03-09 11:32     ` Sebastian Gniazdowski
@ 2017-03-10  4:35     ` Bart Schaefer
  2017-03-10 10:57       ` Peter Stephenson
  1 sibling, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2017-03-10  4:35 UTC (permalink / raw)
  To: zsh-workers

On Mar 9, 10:05am, Peter Stephenson wrote:
} Subject: Re: [PATCH] Extend (z) test with data that seemed to cause fail
}
} I've turned the file text into printable characters like this.

There are a bunch of similar unprintable characters in V11db_gdbm
if you would like to have a go at that, too.

Plus the comment at the top of V11 still says zsh/param/private when
it should say zsh/db/gdbm


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

* Re: [PATCH] Extend (z) test with data that seemed to cause fail
  2017-03-10  4:35     ` Bart Schaefer
@ 2017-03-10 10:57       ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2017-03-10 10:57 UTC (permalink / raw)
  To: zsh-workers

On Thu, 9 Mar 2017 20:35:51 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Mar 9, 10:05am, Peter Stephenson wrote:
> } Subject: Re: [PATCH] Extend (z) test with data that seemed to cause fail
> }
> } I've turned the file text into printable characters like this.
> 
> There are a bunch of similar unprintable characters in V11db_gdbm
> if you would like to have a go at that, too.

The only non-ASCII characters I can see are UTF-8 characters which show
up fine on my system.  They may or may not show up properly here:

漢字

They are Unicode characters 0x6f22 and 0x5b57.

I don't think it's worth hacking these into \u sequences, particularly
as it makes comparing the output more difficult.  We already need to
edit D07 in UTF-8 mode; a note should be good enough.

As they're not being treated as characters I don't think it matters
if they're not valid in other locales, either.  Or, to put it another
way, that would be a bug we ought to fix.

pws

diff --git a/Test/V11db_gdbm.ztst b/Test/V11db_gdbm.ztst
index 02bdae2..6d74cef 100644
--- a/Test/V11db_gdbm.ztst
+++ b/Test/V11db_gdbm.ztst
@@ -1,4 +1,6 @@
-# Tests for the zsh/param/private module
+# Tests for the zsh/db/gdbm module.
+# This contains literal UTF-8 characters; if editing, use
+# UTF-8 mode.
 
 %prep
 


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

end of thread, other threads:[~2017-03-10 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170309082643epcas1p442c9a88050e6607dc8eeb9e9138e8068@epcas1p4.samsung.com>
2017-03-09  8:16 ` [PATCH] Extend (z) test with data that seemed to cause fail Sebastian Gniazdowski
2017-03-09 10:05   ` Peter Stephenson
2017-03-09 11:32     ` Sebastian Gniazdowski
2017-03-09 11:49       ` Peter Stephenson
2017-03-10  4:35     ` Bart Schaefer
2017-03-10 10:57       ` 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).