zsh-workers
 help / color / mirror / code / Atom feed
* V01zmodload fails on Cygwin
@ 2016-01-24 11:10 Jun T.
  2016-01-24 12:45 ` Sebastian Gniazdowski
  2016-01-24 18:22 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Jun T. @ 2016-01-24 11:10 UTC (permalink / raw)
  To: zsh-workers

V01zmodload.ztst fails on my Cygwin (on 64 bit Windows7):
CYGWIN_NT-6.1 2.4.0(0.293/5/3) 2016-01-15 16:16 x86_64
(probably the latest 64bit cygwin)

First of all, I want to be confirmed that the test fails
also on other cygwin systems.

If I run
% ZTST_verbose=2 make TESTNUM=V01 check
the last part of the output looks like

ZTST_getchunk: read code chunk:
 mods[(r)zsh/main]=()
 zmodunload $mods
 zmodload zsh/parameter
ZTST_test: examining line:

Running test: Unload the modules loaded by this test suite
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3560, output: /tmp/zsh.ztst.out.3560, error: /tmp/zsh.ztst.terr.3560
ZTST_execchunk: status 0
**************************************
0 successful test scripts, 1 failure, 0 skipped
**************************************

So the execchunk for
0d:Unload the modules loaded by this test suite
has succeeded but ztst.zsh seems to die before
0:Listing feature autoloads includes unloaded modules

With some experiment, I found that the following causes a core dump:

cygwin$ ~/bin/zsh -f    # the zsh I have just built
% zmodload zsh/param/private
% zmodload -u zsh/param/private
% local i

but I couldn't get any backtrace from the core.

The following is my *guess* as to what is going wrong.

On Cygwin, parm_private.dll is built by

gcc -g  -shared -Wl,--export-all-symbols -o param_private.dll param_private..o   ../../Src/libzsh-5.2-dev-1.dll  -liconv -ldl -lncursesw -lrt -lm  -lc

So it seems some symbols from libzsh-5.2-dev-1.dll also exists
in param_private.dll, and gethashnode2 is one of those symbols:

% nm libzsh-5.2-dev-1.dll | grep '[Tt] gethashnode2'
0000000514fd1b7f T gethashnode2
% nm Modules/param_private.dll | grep '[Tt] gethashnode2'
00000004bea72a58 T gethashnode2

In function cleanup_(), at line 628 of Src/Module/param_private.c:

    realparamtab->getnode2 = gethashnode2;

the gethashnode2 seems to point to the symbol in param_private.dll,
which can not be accessed after the module has been unloaded.

The following patch seems to work, but I hope someone who knows
cygwin better to confirm/improve the patch.

# do we need to use #ifdef __CYGWIN__ ?


diff --git a/Src/Modules/param_private.c b/Src/Modules/param_private.c
index e13813c..f0679a4 100644
--- a/Src/Modules/param_private.c
+++ b/Src/Modules/param_private.c
@@ -567,6 +567,8 @@ static struct features module_features = {
 };
 
 static struct builtin save_local;
+static GetNodeFunc save_getnode2;
+static ScanFunc save_printnode;
 static struct reswd reswd_private = {{NULL, "private", 0}, TYPESET};
 
 /**/
@@ -577,6 +579,8 @@ setup_(UNUSED(Module m))
 
     /* Horrible, horrible hack */
     getparamnode = realparamtab->getnode;
+    save_getnode2 = realparamtab->getnode2;
+    save_printnode = realparamtab->printnode;
     realparamtab->getnode = getprivatenode;
     realparamtab->getnode2 = getprivatenode2;
     realparamtab->printnode = printprivatenode;
@@ -624,8 +628,8 @@ cleanup_(Module m)
     removehashnode(reswdtab, "private");
     
     realparamtab->getnode = getparamnode;
-    realparamtab->getnode2 = gethashnode2;
-    realparamtab->printnode = printparamnode;
+    realparamtab->getnode2 = save_getnode2;
+    realparamtab->printnode = save_printnode;
 
     deletewrapper(m, wrapper);
     return setfeatureenables(m, &module_features, NULL);




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

* Re: V01zmodload fails on Cygwin
  2016-01-24 11:10 V01zmodload fails on Cygwin Jun T.
@ 2016-01-24 12:45 ` Sebastian Gniazdowski
  2016-01-24 18:22 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Sebastian Gniazdowski @ 2016-01-24 12:45 UTC (permalink / raw)
  To: Jun T.; +Cc: zsh-workers

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

I ran "ZTST_verbose=2 make TESTNUM=V01 check" on my Cygwin running on
virtual boxed Windows XP, all 32 bit. Attach the result. BTW, I
couldn't really run the test just like that because of space in my
user name. Had to make a simlink and enter zsh source tree through it.

CYGWIN_NT-5.1 tier-29462ac5e5 2.2.1(0.289/5/3) 2015-08-20 11:40 i686 Cygwin

Module loading works fine on that Cygwin, I use zmodload zsh/curses extensively.

Best regards,
Sebastian Gniazdowski

[-- Attachment #2: make_check_out.txt --]
[-- Type: text/plain, Size: 23931 bytes --]

if test -n "gcc"; then \
  cd .. && DESTDIR= \
  make MODDIR=`pwd`/Test/Modules install.modules > /dev/null; \
fi
if ZTST_testlist="`for f in ./V01*.ztst; \
           do echo $f; done`" \
 ZTST_srcdir="." \
 ZTST_exe=../Src/zsh.exe \
 ../Src/zsh.exe +Z -f ./runtests.zsh; then \
 stat=0; \
else \
 stat=1; \
fi; \
sleep 1; \
rm -rf Modules .zcompdump; \
exit $stat
./V01zmodload.ztst: starting.
ZTST_getsect: read section name: prep
ZTST_getchunk: read code chunk:
 mods=()
 deps="$(zmodload -Ld)"
 while read name modfile link auto load funcs
 do
   [[ $name == \#* ]] && continue
   eval "$name $modfile $link $auto $load"
   [[ $link == no ]] && continue
   mods=($mods $name)
   moddeps=
   modfile=$ZTST_srcdir/../$modfile
   eval ${${${(f)"$(<$modfile)"}[(r)moddeps=*]}:-:}
   [[ -n $moddeps ]] && zmodload -d $name $=moddeps
 done < $ZTST_testdir/../config.modules
ZTST_execchunk: status 0
ZTST_getchunk: read code chunk:
 zmodunload() {
   local m n=$#
   (( n == 0 )) && return 0
   for m
   do
     if [[ -z ${(M)${(f)"$(zmodload -d)"}:#*:* $m( *|)} ]]
     then
       zmodload -u $m && zmodload -ud $m || return 1
       shift
     else
       set $@[2,-1] $m
     fi
   done
   if (( $# < n ))
   then
     zmodunload $*
   else
     zmodload -u $*
   fi
 }
ZTST_execchunk: status 0
ZTST_getchunk: read code chunk:
 mkdir zmodload.tmp
 cd zmodload.tmp
ZTST_execchunk: status 0
ZTST_getchunk: read code chunk:

ZTST_getsect: read section name: test
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -L
ZTST_getchunk: read code chunk:
 zmodload -L
ZTST_test: examining line:
>zmodload zsh/main
ZTST_getredir: read redir for '>':
zmodload zsh/main
zmodload zsh/parameter
ZTST_test: examining line:

Running test: List the loaded modules
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
zmodload zsh/main
zmodload zsh/parameter
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload zsh/main
ZTST_getchunk: read code chunk:
 zmodload zsh/main
ZTST_test: examining line:

Running test: Test reloading an already-loaded module
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 for m in $mods
ZTST_getchunk: read code chunk:
 for m in $mods
 do
   zmodload $m || mods[(r)$m]=()
 done
ZTST_test: examining line:

Running test: Test loading of all compiled modules
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
The example module has now been set up.
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -e $mods
ZTST_getchunk: read code chunk:
 zmodload -e $mods
ZTST_test: examining line:

Running test: Check that zsh believes the modules did load
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 zmodload bogus/notamodule
ZTST_getchunk: read code chunk:
 zmodload bogus/notamodule
ZTST_test: examining line:

Running test: Check that loading a nonexistent module fails
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):1: failed to load module `bogus/notamodule': No such file or directory
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -u bogus/notamodule
ZTST_getchunk: read code chunk:
 zmodload -u bogus/notamodule
ZTST_test: examining line:

Running test: Check that unloading a nonexistent module fails
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: no such module bogus/notamodule
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -ab bogus
ZTST_getchunk: read code chunk:
 zmodload -ab bogus
 zmodload -ub bogus
ZTST_test: examining line:

Running test: Add/remove autoloaded builtin
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -ub bogus
ZTST_getchunk: read code chunk:
 zmodload -ub bogus
ZTST_test: examining line:
?(eval):zmodload:1: bogus: no such builtin
ZTST_getredir: read redir for '?':
(eval):zmodload:1: bogus: no such builtin
ZTST_test: examining line:

Running test: Fail to remove unautoloaded builtin
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: bogus: no such builtin
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -ac bogus
ZTST_getchunk: read code chunk:
 zmodload -ac bogus
 zmodload -uc bogus
ZTST_test: examining line:

Running test: Add/remove autoloaded condition
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -uc bogus
ZTST_getchunk: read code chunk:
 zmodload -uc bogus
ZTST_test: examining line:
?(eval):zmodload:1: bogus: no such condition
ZTST_getredir: read redir for '?':
(eval):zmodload:1: bogus: no such condition
ZTST_test: examining line:

Running test: Fail to remove unautoloaded condition
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: bogus: no such condition
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -ap bogus
ZTST_getchunk: read code chunk:
 zmodload -ap bogus
 zmodload -up bogus
ZTST_test: examining line:

Running test: Add/remove autoloaded parameter
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -up bogus
ZTST_getchunk: read code chunk:
 zmodload -up bogus
ZTST_test: examining line:
?(eval):zmodload:1: bogus: no such parameter
ZTST_getredir: read redir for '?':
(eval):zmodload:1: bogus: no such parameter
ZTST_test: examining line:

Running test: Fail to remove unautoloaded parameter
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: bogus: no such parameter
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -af bogus
ZTST_getchunk: read code chunk:
 zmodload -af bogus
 zmodload -uf bogus
ZTST_test: examining line:

Running test: Add/remove autoloaded math function
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -uf bogus
ZTST_getchunk: read code chunk:
 zmodload -uf bogus
ZTST_test: examining line:
?(eval):zmodload:1: bogus: no such math function
ZTST_getredir: read redir for '?':
(eval):zmodload:1: bogus: no such math function
ZTST_test: examining line:

Running test: Fail to remove unautoloaded math function
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: bogus: no such math function
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
   zmodload -u zsh/example
   zmodload -ab zsh/example example
   builtin example
   zmodload -e zsh/example
 else print -u$ZTST_fd Warning: zsh/example not linked: not checking autoloading
 fi
ZTST_test: examining line:

Running test: Autoload a module via a builtin
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
Options: 
Arguments:
Name: example

Integer Parameter: 42
String Parameter: example
Array Parameter: example array
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
  zmodload -u zsh/example
  builtin example
 fi
ZTST_test: examining line:

Running test: Autoloads are persistent
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
Options: 
Arguments:
Name: example

Integer Parameter: 42
String Parameter: example
Array Parameter: example array
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  (zmodload -u zsh/parameter
ZTST_getchunk: read code chunk:
  (zmodload -u zsh/parameter
  zmodload -aF zsh/parameter b:fail
  fail
  print "Shouldn't get here.")
ZTST_test: examining line:
?(eval):3: module `zsh/parameter' has no such feature: `b:fail': autoload cancelled
ZTST_getredir: read redir for '?':
(eval):3: module `zsh/parameter' has no such feature: `b:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define builtin: fail
ZTST_test: examining line:

Running test: Failed builtin autoload
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):3: module `zsh/parameter' has no such feature: `b:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define builtin: fail
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  (zmodload -u zsh/parameter
ZTST_getchunk: read code chunk:
  (zmodload -u zsh/parameter
  zmodload -aF zsh/parameter p:fail
  print $fail
  print "Shouldn't get here.")
ZTST_test: examining line:
?(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
ZTST_getredir: read redir for '?':
(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define parameter: fail
ZTST_test: examining line:

Running test: Failed parameter autoload
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define parameter: fail
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  (zmodload -u zsh/parameter
ZTST_getchunk: read code chunk:
  (zmodload -u zsh/parameter
  zmodload -aF zsh/parameter c:fail
  [[ -fail foo ]]
  print "Shouldn't get here.")
ZTST_test: examining line:
?(eval):3: module `zsh/parameter' has no such feature: `c:fail': autoload cancelled
ZTST_getredir: read redir for '?':
(eval):3: module `zsh/parameter' has no such feature: `c:fail': autoload cancelled
(eval):3: unknown condition: -fail
ZTST_test: examining line:

Running test: Failed condition autoload
ZTST_test: expecting status: 2
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 2
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):3: module `zsh/parameter' has no such feature: `c:fail': autoload cancelled
(eval):3: unknown condition: -fail
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  (zmodload -u zsh/parameter
ZTST_getchunk: read code chunk:
  (zmodload -u zsh/parameter
  zmodload -aF zsh/parameter f:fail
  (( fail() )) )
ZTST_test: examining line:
?(eval):3: module `zsh/parameter' has no such feature: `f:fail': autoload cancelled
ZTST_getredir: read redir for '?':
(eval):3: module `zsh/parameter' has no such feature: `f:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define math function: fail
ZTST_test: examining line:

Running test: Failed math function autoload
ZTST_test: expecting status: 2
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 2
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):3: module `zsh/parameter' has no such feature: `f:fail': autoload cancelled
(eval):3: autoloading module zsh/parameter failed to define math function: fail
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  zmodload -aF zsh/parameter f:fail2
ZTST_getchunk: read code chunk:
  zmodload -aF zsh/parameter f:fail2
ZTST_test: examining line:
?(eval):zmodload:1: module `zsh/parameter' has no such feature: `f:fail2'
ZTST_getredir: read redir for '?':
(eval):zmodload:1: module `zsh/parameter' has no such feature: `f:fail2'
ZTST_test: examining line:

Running test: Immediate autoload failure on non-existent feature when module loaded
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:
(eval):zmodload:1: module `zsh/parameter' has no such feature: `f:fail2'
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  (zmodload -u zsh/parameter
ZTST_getchunk: read code chunk:
  (zmodload -u zsh/parameter
  zmodload -aF zsh/parameter p:fail
  print $(( ${#modules} > 1 )) )
ZTST_test: examining line:
>1
ZTST_getredir: read redir for '>':
1
ZTST_test: examining line:
?(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
ZTST_getredir: read redir for '?':
(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
ZTST_test: examining line:

Running test: Autoloads checked on loading but don't necessarily effect current command
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
1
ZTST_test: and standard error:
(eval):3: module `zsh/parameter' has no such feature: `p:fail': autoload cancelled
Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  zmodload -laF zsh/parameter
ZTST_getchunk: read code chunk:
  zmodload -laF zsh/parameter
ZTST_test: examining line:
>p:aliases
ZTST_getredir: read redir for '>':
p:aliases
p:builtins
p:commands
p:dirstack
p:dis_aliases
p:dis_builtins
p:dis_functions
p:dis_galiases
p:dis_patchars
p:dis_reswords
p:dis_saliases
p:funcfiletrace
p:funcsourcetrace
p:funcstack
p:functions
p:functrace
p:galiases
p:history
p:historywords
p:jobdirs
p:jobstates
p:jobtexts
p:modules
p:nameddirs
p:options
p:parameters
p:patchars
p:reswords
p:saliases
p:userdirs
ZTST_test: examining line:

Running test: List default autoloads
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
p:aliases
p:builtins
p:commands
p:dirstack
p:dis_aliases
p:dis_builtins
p:dis_functions
p:dis_galiases
p:dis_patchars
p:dis_reswords
p:dis_saliases
p:funcfiletrace
p:funcsourcetrace
p:funcstack
p:functions
p:functrace
p:galiases
p:history
p:historywords
p:jobdirs
p:jobstates
p:jobtexts
p:modules
p:nameddirs
p:options
p:parameters
p:patchars
p:reswords
p:saliases
p:userdirs
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
   zmodload -u zsh/example
   zmodload -ac -I zsh/example ex
   [[ exam -ex ple ]]
   zmodload -e zsh/example
 else :
 fi
ZTST_test: examining line:

Running test: Autoload a module via a condition
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
   zmodload -u zsh/example
   zmodload -ap zsh/example exint
   : $exint
   zmodload -e zsh/example
 else :
 fi
ZTST_test: examining line:

Running test: Autoload a module via a parameter
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
   zmodload -u zsh/example
   zmodload -af zsh/example sum
   (( sum(1) ))
   zmodload -e zsh/example
 else :
 fi
ZTST_test: examining line:

Running test: Autoload a module via a math function
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -A example=zsh/example
ZTST_getchunk: read code chunk:
 zmodload -A example=zsh/example
 zmodload -A
ZTST_test: examining line:
>example -> zsh/example
ZTST_getredir: read redir for '>':
example -> zsh/example
ZTST_test: examining line:

Running test: Test creating a module alias
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
example -> zsh/example
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
ZTST_getchunk: read code chunk:
 if [[ $mods[(r)zsh/example] == zsh/example ]]; then
   zmodload -u example
   zmodload -ab example
   builtin example
   zmodload -e example
 else :
 fi
ZTST_test: examining line:

Running test: Unload/autoload the module via its alias
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:
Thank you for using the example module.  Have a nice day.
The example module has now been set up.
Options: 
Arguments:
Name: example

Integer Parameter: 42
String Parameter: example
Array Parameter: example array
ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
 zmodload -R example
ZTST_getchunk: read code chunk:
 zmodload -R example
 zmodload -e example
ZTST_test: examining line:

Running test: Delete the module alias again
ZTST_test: expecting status: 1
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 1
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:
  zmodload >zmodload_list
ZTST_getchunk: read code chunk:
  zmodload >zmodload_list
  print -l ${(o)mods} >mods_list
  diff zmodload_list mods_list
ZTST_test: examining line:

Running test: Listing with zmodload should give all our modules.
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
ZTST_test: test produced standard output:

ZTST_test: and standard error:

Test successful.
ZTST_test: looking for new test
ZTST_test: examining line:

ZTST_test: examining line:

ZTST_test: examining line:
 mods[(r)zsh/main]=()
ZTST_getchunk: read code chunk:
 mods[(r)zsh/main]=()
 zmodunload $mods
 zmodload zsh/parameter
ZTST_test: examining line:

Running test: Unload the modules loaded by this test suite
ZTST_test: expecting status: 0
Input: /tmp/zsh.ztst.in.3904, output: /tmp/zsh.ztst.out.3904, error: /tmp/zsh.ztst.terr.3904
ZTST_execchunk: status 0
**************************************
0 successful test scripts, 1 failure, 0 skipped
**************************************
Makefile:189: recipe for target 'check' failed

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

* Re: V01zmodload fails on Cygwin
  2016-01-24 11:10 V01zmodload fails on Cygwin Jun T.
  2016-01-24 12:45 ` Sebastian Gniazdowski
@ 2016-01-24 18:22 ` Bart Schaefer
  2016-01-25  1:28   ` Jun T.
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2016-01-24 18:22 UTC (permalink / raw)
  To: zsh-workers

On Jan 24,  8:10pm, Jun T. wrote:
}
} V01zmodload.ztst fails on my Cygwin (on 64 bit Windows7):
} CYGWIN_NT-6.1 2.4.0(0.293/5/3) 2016-01-15 16:16 x86_64
} (probably the latest 64bit cygwin)
} 
} So it seems some symbols from libzsh-5.2-dev-1.dll also exists
} in param_private.dll, and gethashnode2 is one of those symbols:

Interesting.  gethashnode2 should be declared external, so it should
be resolved for param_private.dll at link time.  Seems to have to do
with whether the external function is *called* vs. merely referenced
by name?

} The following patch seems to work, but I hope someone who knows
} cygwin better to confirm/improve the patch.

It's too bad the node functions are direct members of the hashtable
struct rather than encapsulated the way the parameter GSUs are.  In
the absence of an entire data structure to save/restore, your patch
looks fine.  Should probably save/restore ->getnode as well, just
for completeness.

Do you want to commit or should I?


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

* Re: V01zmodload fails on Cygwin
  2016-01-24 18:22 ` Bart Schaefer
@ 2016-01-25  1:28   ` Jun T.
  0 siblings, 0 replies; 4+ messages in thread
From: Jun T. @ 2016-01-25  1:28 UTC (permalink / raw)
  To: zsh-workers


On 2016/01/25, at 3:22, Bart Schaefer <schaefer@brasslantern.com> wrote:
> } So it seems some symbols from libzsh-5.2-dev-1.dll also exists
> } in param_private.dll, and gethashnode2 is one of those symbols:
> 
> Interesting.  gethashnode2 should be declared external, so it should
> be resolved for param_private.dll at link time.  Seems to have to do
> with whether the external function is *called* vs. merely referenced
> by name?

I'm not familiar with Cygwin (or Windows) dll.
Maybe create an import library libzsh.a?
Or explicitly dlopen("libzsh.dll") from the param_private.dll and
call dlsym("gethashnode2") ?

> Should probably save/restore ->getnode as well, just
> for completeness.

realparamtab->getnode is already saved in getparamnode in your
original code, and getparamnode() (not gethashnode()) is called
in getprivatenode().
On the other hand, gethashnode2() is called in getprivatenode2().

> Do you want to commit or should I?

Please commit it (with necessary modification if any).



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

end of thread, other threads:[~2016-01-25  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-24 11:10 V01zmodload fails on Cygwin Jun T.
2016-01-24 12:45 ` Sebastian Gniazdowski
2016-01-24 18:22 ` Bart Schaefer
2016-01-25  1:28   ` Jun T.

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