Porting newLISP (AIX)

Started by csstup, April 24, 2007, 11:09:33 AM

Previous topic - Next topic

nitralime

#30
I was just curious and performed the qa-cilk test for 32bit version of gcc and xlc.

Here are the results:
------------------------
IBM Compiler xlc (32bit)
------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -c -g -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (4792460 4280556 1069190 4083820 5017818 4001856 4489308 1732826 4178154 4534368)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 4280560 p1:400
pid: 4792464 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

--------------------------
GNU C Compiler gcc (32bit)
--------------------------
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aix_utf8_gcc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX newlisp.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-symbol.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-math.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-list.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-liststr.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-string.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-filesys.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-sock.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-import.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-xml.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-web.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-matrix.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-debug.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX nl-utf8.c
gcc -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX pcre.c
gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5210178 3985454 4087876 5427248 2719950 1069220 2875640 5550318 4284462 4792348)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5210182 p1:400
pid: 3985458 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

Does it mean that Cilk API is OK?

The 64bit versions also return the same result.

Lutz

#31
Yes, as it turns out the Cilk API always worked on AIX, only 'share' was affected. As it turns out from your results using test-mmap.c, the mmmap() function was working Ok in all compile flavors. The problem was only with the 'share' function in different portions of the code.



After a fix, 'share' should now work on AIX in all flavors too.



I posted/emailed a new newlisp-10.0.3.tgz in/to the usual places.



Looks like we will have both compilers and 32-bit and 64-bit supported on AIX :-)

nitralime

#32
Congratulation!

It works now out of the box:-)

Here is the output of all runs:
====================== xlc_r (32bit) =======================
# gmake
./build

Discovered AIX:
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gmake -f makefile_aixLP64_utf8_xlc
gmake[2]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
OBJECT_MODE=64 xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[2]: Leaving directory `/tmp/newlisp-10.0.3'
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5626

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5357676 1069250 4178148 5156980 2875452 4014164 5550282 5541938 2150542 4124856)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5357680 p1:400
pid: 1069254 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

====================== xlc_r (64bit) =======================
# gmake aix64
gmake -f makefile_aixLP64_utf8_xlc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
     729  1500-010: (W) WARNING in main: Infinite loop.  Program may not stop.
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
xlc_r  -q64 -c -g -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
OBJECT_MODE=64 xlc_r  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5622

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (4825322 4083744 2887814 4489406 4444260 5156966 761898 4329518 1732730 2363604)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 4825326 p1:400
pid: 4083748 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

======================= gcc (32bit) ========================
gmake aix_gcc
gmake -f makefile_aix_utf8_gcc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  newlisp.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-math.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-list.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-string.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-sock.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-import.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-xml.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-web.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-debug.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
gcc  -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DSUPPORT_UTF8 -DAIX  pcre.c
gcc  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5574

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5017634 4001928 4661376 5124250 4825114 4567256 1970358 4096020 4362456 4313180)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5017638 p1:400
pid: 4001932 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

======================= gcc (64bit) ========================
# gmake aix64_gcc
gmake -f makefile_aixLP64_utf8_gcc
gmake[1]: Entering directory `/tmp/newlisp-10.0.3'
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  newlisp.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-symbol.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-math.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-list.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-liststr.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-string.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-filesys.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-sock.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-import.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-xml.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-web.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-matrix.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-debug.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  nl-utf8.c
gcc  -maix64 -Wall -pedantic -fno-strict-aliasing -Wno-uninitialized -Wno-long-long -c -O2 -DNEWLISP64 -DSUPPORT_UTF8 -DAIX  pcre.c
gcc  newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o  -maix64 -lm  -ldl -lrt -lnsl -o newlisp
gmake[1]: Leaving directory `/tmp/newlisp-10.0.3'

# ./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5640

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed

# ./newlisp qa-cilk

(abort) -> true
(sync)  -> ()
(sync) -> (5541896 4124840 1069242 5357668 4313196 4325506 4284632 4087944 540726 4648974)
N of processes -> 10
waiting  to sync -> true
fibo(7) with 41 processes -> 21
pid: 5541900 p1:400
pid: 4124844 p2:500
true

>>>>> THE CILK API TESTED SUCESSFULL

Now I am about to start the more comprehensive test:
# gmake test
./newlisp qa-dot

Testing built-in functions ...

Testing contexts as objects and scoping rules ...

total time: 5992

>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:

UTF-8 upper-case: failed
UTF-8 lower-case: failed
./newlisp qa-dictionary

N associations: 10000
cells before creating Lex: 80770
aquire from association list: 18 ms
time to aquire one entry: 1.800 μs
time reading and verifying entries ... : 30 ms
time to read and verify one entry: 3.000 μs
time to only read one entry: 2.200 μs
cells after creating Lex: 120783
N symbols in Lex: 10000
save to file: 482 ms
time to delete namespace: 27 ms
time to delete one symbol: 2.700 μs
cells after deleting Lex: 110787
time to load namespace: 59 ms
cells after loading Lex: 120789
time to save Lex2: 436 ms

>>>>> DICTIONARY API TESTED SUCCESSFUL

./newlisp qa-xml

testing: xml-parse and xml-type-tags
true true true true

XML API OK

Testing xml-parse with callback feature
parsed expresson:(NAME "apple"), source:<NAME>apple</NAME>
parsed expresson:(COLOR "red"), source:<COLOR>red</COLOR>
parsed expresson:(PRICE "0.80"), source:<PRICE>0.80</PRICE>
parsed expresson:(NAME "orange"), source:<NAME>orange</NAME>
parsed expresson:(COLOR "orange"), source:<COLOR>orange</COLOR>
parsed expresson:(PRICE "1.00"), source:<PRICE>1.00</PRICE>
parsed expresson:(NAME "banana"), source:<NAME>banana</NAME>
parsed expresson:(COLOR "yellow"), source:<COLOR>yellow</COLOR>
parsed expresson:(PRICE "0.60"), source:<PRICE>0.60</PRICE>


>>>>> XML CALLBACK TESTED SUCCESSFUL

./newlisp qa-setsig

..sig-1 ..sig-2 ..sig-3 ..sig-4 ..sig-5 ..sig-6 ..sig-7 ..sig-8 ..sig-10 ..sig-11 ..sig-12 ..sig-13 ..sig-14 ..sig-15 ..sig-16
sent: (1 2 3 4 5 6 7 8 10 11 12 13 14 15 16)
received: (1 2 3 4 5 6 7 8 10 11 12 13 14 15 16)

>>>>> SIGNAL TESTING SUCCESSFUL

./newlisp qa-net

target URL: http://localhost:10001//tmp/newlisp-10.0.3/qa-junk.txt
host: localhost
port: 10001
path: /tmp/newlisp-10.0.3/qa-junk.txt
Server already running ...
waiting for server ...
net-eval poblem with normal mode ->ERROR

and it is hanging here:-(

Any idea?

Lutz

#33
Great news. The 'net-eval' fail is probably a timeout issue, it may go away by just repeating the test or executing "./newlisp net-eval" on its own.



Try out manually:


~/newlisp-10.0.3> ./newlisp -c -d 12345 &
[1] 11283
~/newlisp-10.0.3> ./newlisp
newLISP v.10.0.3 on OSX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "127.0.0.1" 12345 "(+ 3 4)")
7
>


if this works then the timeouts are too small in 66 and 70 in qa-net



If this does not work try this:


~/newlisp-10.0.3> ./newlisp -c -d 12345 &
[1] 11301
~/newlisp-10.0.3> telnet 127.0.0.1 12345
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
(symbols) <-- after connecting enter any expression to evaluate
(! != $ $0 $1 $10 $11 $12 ... lots of output ... xml-type-tags zero? | ~)


This checks if server mode works at all using telnet.

Lutz

#34
... I am surprised we see:


Server already running ...
waiting for server ...


We should see:


Starting server on localhost
waiting for server ...


why does it say the server is already running? Perhaps something else on your machine using port 10001, which is the port qa-net uses for newLISP server mode. This makes the client process think there is newLISP already on the server side.

nitralime

#35
I'm sorry that I didn't pay due attention to "Server already running ..." message myself.

The port 10001 as SCP configuration port on AIX is already in use. I changed the port

to 12321 in qa-comma, qa-dot and qa-net files and started the qa-net test manually.

It works as expected:
# ./newlisp -c -d 12321 &
[1] 5452018
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "127.0.0.1" 12321 "(+ 3 4)")
7
> (exit)
#

But
#./newlisp qa-net

target URL: http://localhost:12321//tmp/newlisp-10.0.3/qa-junk.txt
host: localhost
port: 12321
path: /tmp/newlisp-10.0.3/qa-junk.txt
Starting server on localhost
waiting for server ...
net-eval normal mode ->OK

is hanging again! Any idea?

By the way what/where is net-eval.c file? Maybe you have meant qa-net?!

Lutz

#36
Yes, I meant qa-net (now corrected in the post).



The next test is the following (manually):


> (net-eval "localhost" 4711 "(abc)")
"nERR: invalid function : (abc)n"
>


and in qa-net line 75, the output is checked to be correct. This checks if the servermode can recover the network connection after going through and initialization and resettting routine. You could check this manually by connecting to the server with telnet (as shown earlier) and enter: (abc) and it should come back with a an error message, and another command, e.g. (symbols) should still work.



We basically would have to go through all of qa-net's routines manually to find out what the problem is. I have seen qa-net fail only in the places where (sleep ..) statements are inserted, and only on older slower machines, or when running in VM environments like Virtual Box.



There are also a examples/server and examples/client test programs in the source distribution. Start the server first without parameters, then the client with only: localhost  as argument in another peocess. Lines entered in the client will be sent back uppercased by the server. The programs use the port 1111:


~/newlisp-10.0.3/examples> ./server &
[1] 12998
~/newlisp-10.0.3/examples>
Server started

~/newlisp-10.0.3/examples> ./client localhost

Connected!

input or 'quit' to exit:sdkjfghsldkjgh
received:sdkjfghsldkjgh

SDKJFGHSLDKJGH
input or 'quit' to exit:


These two programs also do a test of basic networking functions. Practically all of what is in there is also tested in qa-dot already. So I assume, its something peculiar about server mode in qa-net.



Another basic test for server mode would be, to start the server, just like before, but in a directory containing some HTML files. You should then be able to put http://localhost:12345/thePage.html">http://localhost:12345/thePage.html in a web browser and see the page.

nitralime

#37
The expression (net-eval "localhost" 12321 "(abc)") causes the problem.

Without a timeout value it will be hanging!! I treid it with different timeout values:
# ./newlisp -c -d 12321 &
[1] 1069264

#./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 10000)
nil
>

It would be reasonable to add a timeout to the expression (net-eval host port "(abc)")

at line 75 in "qa-net" file:
  +74  ; test error reporting
   +75  (if (= (net-eval host port "(abc)") "nERR: invalid function : (abc)n")
   +76          (set 'result2 (println "net-eval error reporting ->OK"))
   +77          (println "net-eval problem with error reporting ->ERROR"))

Any idea why we don't get back the expected error message?



I will also do the other tests that you have mentioned.

Lutz

#38
It would be interesting to know if the server still reacts to 'net-eval' with {(+ 3 4)} correctly after you have a 'nil' return.



Also after it returned with 'nil' do a: (net-error) and then a: (sys-error) to see error information from newLISP's own routines and perhaps from AIX when using: (sys-error).



Before that clear 'sys-error' to 0 by doing a: (sys-error 0), to be sure that the system error you get is not from something you did earlier.



When a 'net-xxx' routines returns 'nil' it is always an error condition, which can be checked for with 'net-error'. Sometimes 'sys-error' offers additional OS information.

nitralime

#39
The expression (net-eval "localhost" 12321 "(abc)") causes the problem.

Without a timeout value it will be hanging!! I tried it with different timeout values:
# ./newlisp -c -d 12321 &
[1] 1069264

#./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 10000)
nil
>

It would be reasonable to add a timeout to the expression (net-eval host port "(abc)")

at line 75 in "qa-net" file:
  +74  ; test error reporting
   +75  (if (= (net-eval host port "(abc)") "nERR: invalid function : (abc)n")
   +76          (set 'result2 (println "net-eval error reporting ->OK"))
   +77          (println "net-eval problem with error reporting ->ERROR"))

Any idea why we don't get back the expected error message?



I will also do the other tests that you have mentioned.

Lutz

#40
QuoteAny idea why we don't get back the expected error message?


Thats the crucial point. A timeout doesn't help here. That's why I want you do do the other tests, confirming the timeout with: (net-error), looking for AIX system error messages and finding out if the server is still reacting after the timeout. I guess it will not be responsive. Is it down? Use the Unix utility ps to see what it is doing. At this moment I have no idea why it doesn't come back with an error message.

nitralime

#41
I have started newlisp as follows
# ./newlisp -L./test_run.log -c -d 12321
And in another terminal done my tests
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-error)
(17 "ERR: Operation timed out")
> (sys-error)
(0 "Error 0")
> (net-eval "localhost" 12321 {(+ 3 4)} 1000)
7
> (net-eval "localhost" 12321 "(/ 1 0)" 1000)
nil
> (net-eval "localhost" 12321 {(+ 3 4)} 5000)
7
> (net-eval "localhost" 12321 "(abc)" 5000)
nil
> (net-eval "localhost" 12321 "(abc)" 50000)
nil
> (net-eval "localhost" 12321 "(* (* 4 5) (+ 30 45))" 1000)
1500
>

The content of log file:
# cat test_run.log
Connected to 127.0.0.1 on Sat Mar 14 19:53:33 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:53:46 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:54:23 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:54:38 2009
[cmd]
(/ 1 0)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:56:34 2009
[cmd]
(+ 3 4)(exit)
[/cmd]
7
Connected to 127.0.0.1 on Sat Mar 14 19:57:09 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 19:57:42 2009
[cmd]
(abc)(exit)
[/cmd]
Connected to 127.0.0.1 on Sat Mar 14 20:00:24 2009
[cmd]
(* (* 4 5) (+ 30 45))(exit)
[/cmd]
1500

And here is the output of server and client example:
-----------
Server side
-----------
# cd examples
# ../newlisp server

Server started
received:fischers fritz fischt frische fische
received:es hat geklappt!
received:quit

-----------
Client side
-----------
# cd examples
# ../newlisp client localhost

Connected!

input or 'quit' to exit:fischers fritz fischt frische fische

FISCHERS FRITZ FISCHT FRISCHE FISCHE
input or 'quit' to exit:es hat geklappt!

ES HAT GEKLAPPT!
input or 'quit' to exit:quit

bye bye!
input or 'quit' to exit:#

I have created the test.html file with the following content:
<html>
<head>Hello</head>
<body>
FISCHERS FRITZ FISCHT FRISCHE FISCHE
</body>
</html>

and opened the url http://myserver:12321/test.html">http://myserver:12321/test.html in my browser

from another PC in another network and got
HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE
in browser window! Considering only these tests it seems that my newlisp version on AIX should be OK!



Unfortunately the problem that we observed above is still open:-(

I have also check system logs. No trace of any errors which could eventually be related to newlisp!

Show goes on!!

Lutz

#42
Thanks for all the testing, the picture is getting clearer now. Adding the sever log was also a good idea. If the last text is literaly, what you see in the browser:




HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE

then something is eating line-feeds between the server and the client and the browser. The HTTP header should not be visible in the browser and seems to be merged with the content. Only content between body tags should be visible. This could happen if line feeds are removed. What we should see in the browser is just:


Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE

Also the Content length with 86 is exactly the content-length of  "test.html" with line-feeds removed. The header is written by newLISP server, that means that when it reads the file: test.html, it already got it without line-feeds. Try this in newLISP:


(length (read-file "test.html"))

It should give the file size, in my case 92. The same number you see, should be the number in Content-length.



Also lets try the following:


~/newlisp-10.0.3> ./newlisp -c -d 12321 &
[1] 14659
~/newlisp-10.0.3> telnet localhost 12321
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
(abc)

ERR: invalid function : (abc)
(append "fischersrn" "fritzn")
"fischersrnfritzn"



Lets check both CR-LF and LF only.



As you, I believe that your AIX compiled version, is generally Ok, except for (1) server mode, where the error message/string disappears. (2) HTTP content arriving at the browser with line-feeds removed. Maybe generally loosing line feeds when reading files?



Probably both things are related! Does AIX use special line feed characters? What does a HEX dump of test.html look like?

nitralime

#43
Yes, I got exactly this output
HTTP/1.0 200 OK Server: newLISP v.10003 (AIX) Content-length: 86 Content-type: text/html Hello FISCHERS FRITZ FISCHT FRISCHE FISCHE

in my browser window.
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (define s (read-file "test.html"))
"<html>n<head>Hello</head>n<body>nFISCHERS FRITZ FISCHT FRISCHE FISCHEn</body>n</html>n"
> (length s)
86
>

Why do you mean that the result should be 92? Maybe because of "rn" instead of just "n"?

Telnet test leads to
# ./newlisp -c -d 12321 &
[1] 4902916
# telnet localhost 12321
Trying...
Connected to localhost.
Escape character is '^]'.
(abc)


ERR: invalid function : (abc)
(append "fischersrn" "fritzn")

"fischersrnfritzn"

And here is the HEX dump of "test.html"
0x3c0x680x740x6d0x6c0x3e0x0a0x3c0x680x650x61
0x640x3e0x480x650x6c0x6c0x6f0x3c0x2f0x680x65
0x610x640x3e0x0a0x3c0x620x6f0x640x790x3e0x0a
0x460x490x530x430x480x450x520x530x200x460x52
0x490x540x5a0x200x460x490x530x430x480x540x20
0x460x520x490x530x430x480x450x200x460x490x53
0x430x480x450x0a0x3c0x2f0x620x6f0x640x790x3e
0x0a0x3c0x2f0x680x740x6d0x6c0x3e0x0a

As far as I know there is nothing special about LF on AIX. It is 'n' as on any other UNIX derivate.

I have done the same tests with our working version 10.0.3 on my Mac OSX (1.5.6) and everything worked very fine. No "problems" at all!

I'm a little bit confused at this moment. What goes here wrong?!

nitralime

#44
It is still more confusing if you look at the result of the following simple tests

which I have done with both versions of newlisp 10.0.3 compiled by xlc_r and gcc (the same for 32bit):
-----------------
IBM Compile xlc_r
-----------------
# ./newlisp -L./test_run.log -c -d 12321 &
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 "(+ 2 3)" 1000)
nil
> (net-error)
nil
> (sys-error)
(0 "Error 0")
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
> (net-error)
(17 "ERR: Operation timed out")
> (sys-error)
(0 "Error 0")
>
----------------------------------------------------------
# cat test_run.log
Connected to 127.0.0.1 on Sun Mar 15 18:15:38 2009
[cmd]
(+ 2 3)(exit)
[/cmd]
5
Connected to 127.0.0.1 on Sun Mar 15 18:16:03 2009
[cmd]
(abc)(exit)
[/cmd]

------------------
GNU C Compiler gcc
------------------
# ./newlisp -L./test_run.log -c -d 12321 &
# ./newlisp
newLISP v.10.0.3 64-bit on AIX IPv4 UTF-8, execute 'newlisp -h' for more info.

> (net-eval "localhost" 12321 "(+ 2 3)" 1000)
5
> (net-eval "localhost" 12321 "(abc)" 2000)
nil
>
----------------------------------------------------------
# cat test_run.log
Connected to 127.0.0.1 on Sun Mar 15 18:20:22 2009
[cmd]
(+ 2 3)(exit)
[/cmd]
5
Connected to 127.0.0.1 on Sun Mar 15 18:20:34 2009
[cmd]
(abc)(exit)
[/cmd]