orthecreedence / cl-async

Asynchronous IO library for Common Lisp.
MIT License
273 stars 40 forks source link

Running test TCP-CONNECT-FAIL fails in Mac #111

Closed rogersm closed 9 years ago

rogersm commented 9 years ago

Running test suite CL-ASYNC-TEST-CORE in MacBookPro from cl-async-20141217-git:

~ $ uname -a
Darwin MacBook.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
~ $ /usr/local/ccl/dx86cl64 --version
Version 1.9-r15759  (DarwinX8664)
~ $ brew info libuv
libuv: stable 0.10.29 (bottled), devel 1.0.0-rc2, HEAD
https://github.com/joyent/libuv
/usr/local/Cellar/libuv/HEAD (13 files, 492K) *
  Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/libuv.rb
==> Options
--universal
    Build a universal binary
--devel
    Install development version 1.0.0-rc2
--HEAD
    Install HEAD version

I get the following error:

~ $ /usr/local/ccl/dx86cl64
Welcome to Clozure Common Lisp Version 1.9-r15759  (DarwinX8664)!
? (ql:quickload :cl-async-test)
To load "cl-async-test":
  Load 1 ASDF system:
    cl-async-test
; Loading "cl-async-test"
.
(:CL-ASYNC-TEST)
? (cl-async-test:run-tests)

Running test suite CL-ASYNC-TEST-CORE
 Running test IPV4-ADDRESS ..........
 Running test DELAY-MULTI ...
 Running test POLL-FD .
 Running test DELAY-TIMER .
 Running test TCP-SERVER-CLOSE .
 Running test TCP-CONNECT-FAIL Assertion failed: (0), function uv_err_name, file src/uv-common.c, line 74.
Abort trap: 6
ivan4th commented 9 years ago

Unfortunately I don't have access to a Mac, would you please try adding (format t "~&status: ~s~%" status) before https://github.com/orthecreedence/cl-async/blob/master/socket.lisp#L165 and try running (debug! 'cl-async-test::tcp-connect-fail)?

rogersm commented 9 years ago

I removed the quicklist distributed cl-async release and clone it from github. After updating the socket.lisp and running the single test:

? (fiveam:debug! 'cl-async-test::tcp-connect-fail)

 Running test TCP-CONNECT-FAIL
status: -89
..
 Did 2 checks.
    Pass: 2 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

NIL

I've been checking around and seems to be related to this issue: Handle EHOSTDOWN

orthecreedence commented 9 years ago

btw i am seeing this too in windows. it seems there is an error value being thrown that isnt present in the headers which causes an assert failure. i can push a (hardcoded) fix out for this tonight.

orthecreedence commented 9 years ago

@rogersm can you do a pull and try again? I added in some errors to ignore when pulling out error names. If this doesn't work, would you mind doing a trace on the cl-async-util:error-str function before running the tests and letting me know what values are coming through?

Thanks!

rogersm commented 9 years ago

@orthecreedence this is getting better. We have no assert problems from base libuv. See current results (and encoding problems for DNS tests):

$ /usr/local/ccl/dx86cl64 -K utf-8
Welcome to Clozure Common Lisp Version 1.10-r16196  (DarwinX8664)!

CCL is developed and maintained by Clozure Associates. For more information
about CCL visit http://ccl.clozure.com.  To enquire about Clozure's Common Lisp
consulting services e-mail info@clozure.com or visit http://www.clozure.com.

? (ql:quickload :cl-async-test)
To load "cl-async-test":
  Load 1 ASDF system:
    cl-async-test
; Loading "cl-async-test"
.
(:CL-ASYNC-TEST)
? (cl-async-test:run-tests)

Running test suite CL-ASYNC-TEST-CORE
 Running test IPV4-ADDRESS ..........
 Running test DELAY-MULTI ...
 Running test POLL-FD .
 Running test SPAWN-SIMPLE .....
 Running test DELAY-TIMER .
 Running test TCP-SERVER-CLOSE .
 Running test TCP-CONNECT-FAIL ..
 Running test DNS-LOOKUP-IPV4 X
 Running test POINTER-CALLBACKS ...
 Running test PIPE-SERVER-STREAM .
 Running test FS-MONITOR .....
 Running test DNS-LOOKUP-IPV6 f
 Running test IDLE .
 Running test EVENT-LOOP-STARTS .
 Running test MKDTEMP-FAIL .
 Running test SPAWN-REDIRECT-OUTPUT ...........
 Running test STREAM-READ-WRITE-SEQUENCE ..
 Running test SPAWN-REDIRECT-STREAM ...........
 Running test PIPE-CONNECT-FAIL ..
 Running test INTERVAL .
 Running test PIPE-SIMPLE-CLIENT-SERVER .....
 Running test DATA-POINTERS .
 Running test EVENT-LOOP-EXIT .
 Running test MKDTEMP ..
 Running test TCP-SERVER-STREAM .
 Running test EXIT-CALLBACKS .
 Running test POINTER-DATA ...
 Running test DNS-FAIL ..
 Running test PIPE-SERVER-CLOSE .
 Running test TCP-SIMPLE-CLIENT-SERVER X
 Running test DATA-AND-FN-POINTERS ..
 Running test FS-WATCH-FAILURE .
 Running test SPAWN-REDIRECT-ERROR-OUTPUT ...........
 Running test DELAY-SIMPLE .
 Running test PROCESS-KILL ....
 Running test APPEND-ARRAY .
 Running test CATCH-APP-ERRORS .
 Running test SIGNAL-HANDLER-ADD-REMOVE .
 Running test NO-OVERLAP ....
 Running test SPAWN-EXEC-FAILURE .
 Running test DNS-MULTI XX
 Running test IPV6-ADDRESS ............
 Running test DNS-SIMPLE X
 Did 124 checks.
    Pass: 118 (95%)
    Skip: 0 ( 0%)
    Fail: 6 ( 4%)

 Failure Details:
 --------------------------------
 DNS-SIMPLE [Test a simple DNS request]:
      Unexpected Error: #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE #x30200216763D>
Illegal :UTF-8 character starting at position 0...
 --------------------------------
 --------------------------------
 DNS-MULTI [Test multiple DNS requests]:
      Unexpected Error: #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE #x30200207F3CD>
Illegal :UTF-8 character starting at position 0...
 --------------------------------
 --------------------------------
 DNS-MULTI [Test multiple DNS requests]:
      Unexpected Error: #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE #x3020020DF0ED>
Illegal :UTF-8 character starting at position 0...
 --------------------------------
 --------------------------------
 TCP-SIMPLE-CLIENT-SERVER [Test both tcp-connect and tcp-server]:
      Unexpected Error: #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE #x3020020BA64D>
Illegal :UTF-8 character starting at position 0...
 --------------------------------
 --------------------------------
 DNS-LOOKUP-IPV6 [Test IPV6 family (can fail in *nix)]:

IPV6

 evaluated to

"(-3005) EAI_FAMILY"

 which does not satisfy

IPV6-ADDRESS-P

.
 --------------------------------
 --------------------------------
 DNS-LOOKUP-IPV4 [Test IPV4 family]:
      Unexpected Error: #<BABEL-ENCODINGS:INVALID-UTF8-STARTER-BYTE #x302001F4E43D>
Illegal :UTF-8 character starting at position 0...
 --------------------------------

NIL
orthecreedence commented 9 years ago

Glad this is working better, although there are still some tests I need to iron out. Also, I think #118 might erase any remnants of the problem you originally reported.