zsh-workers
 help / color / mirror / code / Atom feed
* [bug] "zmodload -F zsh/system -p:errnos" disables $sysparams instead of $errnos
@ 2016-09-07  9:39 Stephane Chazelas
  2016-09-07 10:35 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Stephane Chazelas @ 2016-09-07  9:39 UTC (permalink / raw)
  To: zsh-workers

/not/ related to the other $errnos issue I just raised,
on Debian amd64 with the git head like for the 5.2 installed
there:

$ zmodload zsh/system
$ zmodload -Fl zsh/system
+b:syserror
+b:sysread
+b:syswrite
+b:sysopen
+b:sysseek
+b:zsystem
+f:systell
+p:errnos
+p:sysparams
$ zmodload -F zsh/system -p:errnos
$ zmodload -Fl zsh/system
+b:syserror
+b:sysread
+b:syswrite
+b:sysopen
+b:sysseek
+b:zsystem
+f:systell
+p:errnos      !!!
-p:sysparams   !!!
$ echo $+errnos $+sysparams
1 0

That could be a regression as it worked OK with 4.3.12-dev-1-cvs
on Ubuntu 12.04.

After fixing the other issue (using gcc -E -P), this issue
remains.

-- 
Stephane


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

* Re: [bug] "zmodload -F zsh/system -p:errnos" disables $sysparams instead of $errnos
  2016-09-07  9:39 [bug] "zmodload -F zsh/system -p:errnos" disables $sysparams instead of $errnos Stephane Chazelas
@ 2016-09-07 10:35 ` Peter Stephenson
  2016-09-07 13:39   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2016-09-07 10:35 UTC (permalink / raw)
  To: zsh-workers

On Wed, 7 Sep 2016 10:39:18 +0100
Stephane Chazelas <stephane.chazelas@gmail.com> wrote:
> $ zmodload -F zsh/system -p:errnos
> $ zmodload -Fl zsh/system
> +b:syserror
> +b:sysread
> +b:syswrite
> +b:sysopen
> +b:sysseek
> +b:zsystem
> +f:systell
> +p:errnos      !!!
> -p:sysparams   !!!

It looks like this is because math functions were never properly counted
--- there are very few in modules so no one noticed.  We could do with
some tests for this.

(I suspect it worked if you fired the blue portal at the wall over math
functions, then the orange portal onto the floor, and jumped through
it.)

diff --git a/Src/module.c b/Src/module.c
index 368254c..46a7d77 100644
--- a/Src/module.c
+++ b/Src/module.c
@@ -3350,6 +3350,8 @@ setfeatureenables(Module m, Features f, int *e)
     if (f->mf_size) {
 	if (setmathfuncs(m->node.nam, f->mf_list, f->mf_size, e))
 	    ret = 1;
+	if (e)
+	    e += f->mf_size;
     }
     if (f->pd_size) {
 	if (setparamdefs(m->node.nam, f->pd_list, f->pd_size, e))


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

* Re: [bug] "zmodload -F zsh/system -p:errnos" disables $sysparams instead of $errnos
  2016-09-07 10:35 ` Peter Stephenson
@ 2016-09-07 13:39   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2016-09-07 13:39 UTC (permalink / raw)
  To: zsh-workers

On Wed, 7 Sep 2016 11:35:29 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> It looks like this is because math functions were never properly counted
> --- there are very few in modules so no one noticed.  We could do with
> some tests for this.

pws

diff --git a/Test/V01zmodload.ztst b/Test/V01zmodload.ztst
index 349ae9c..092f9d1 100644
--- a/Test/V01zmodload.ztst
+++ b/Test/V01zmodload.ztst
@@ -271,6 +271,80 @@
 0:Listing feature autoloads includes unloaded modules
 >zmodload -Fa zsh/zftp b:zftp
 
+  if ! zmodload zsh/system >/dev/null 2>&1; then
+    ZTST_skip="zsh/system module not available"
+  else
+    zmodload -lF zsh/system
+    zmodload -F zsh/system -p:errnos
+    print ${+errnos}
+    zmodload -lF zsh/system
+    zmodload -F zsh/system +p:errnos
+    print ${+errnos}
+    zmodload -lF zsh/system
+  fi
+0:Regression tests for index bug with math functions.
+>+b:syserror
+>+b:sysread
+>+b:syswrite
+>+b:sysopen
+>+b:sysseek
+>+b:zsystem
+>+f:systell
+>+p:errnos
+>+p:sysparams
+>0
+>+b:syserror
+>+b:sysread
+>+b:syswrite
+>+b:sysopen
+>+b:sysseek
+>+b:zsystem
+>+f:systell
+>-p:errnos
+>+p:sysparams
+>1
+>+b:syserror
+>+b:sysread
+>+b:syswrite
+>+b:sysopen
+>+b:sysseek
+>+b:zsystem
+>+f:systell
+>+p:errnos
+>+p:sysparams
+
+  if ! zmodload zsh/system >/dev/null 2>&1; then
+    ZTST_skip="zsh/system module not available"
+  else
+    zmodload -F zsh/system -f:systell
+    zmodload -lF zsh/system
+    (print $(( systell(-1) )))
+    zmodload -F zsh/system +f:systell
+    zmodload -lF zsh/system
+    (print $(( systell(-1) )))
+  fi
+1:Module Features for math functions
+>+b:syserror
+>+b:sysread
+>+b:syswrite
+>+b:sysopen
+>+b:sysseek
+>+b:zsystem
+>-f:systell
+>+p:errnos
+>+p:sysparams
+>+b:syserror
+>+b:sysread
+>+b:syswrite
+>+b:sysopen
+>+b:sysseek
+>+b:zsystem
+>+f:systell
+>+p:errnos
+>+p:sysparams
+?(eval):6: unknown function: systell
+?(eval):9: file descriptor out of range
+
 %clean
 
  eval "$deps"


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

end of thread, other threads:[~2016-09-07 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07  9:39 [bug] "zmodload -F zsh/system -p:errnos" disables $sysparams instead of $errnos Stephane Chazelas
2016-09-07 10:35 ` Peter Stephenson
2016-09-07 13:39   ` 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).