USOCKET:NS-HOST-NOT-FOUND-ERROR condition has unbound host-or-ip slot on SBCL · Issue #46 · usocket/usocket · GitHub
Skip to content

USOCKET:NS-HOST-NOT-FOUND-ERROR condition has unbound host-or-ip slot on SBCL #46

Description

@svetlyak40wt

How to reproduce:

  1. Turn off networking on your computer.
  2. Eval this code in the repl:
(handler-case (usocket:get-hosts-by-name "github.com")
  (USOCKET:NS-HOST-NOT-FOUND-ERROR (c)
    (format nil "Slot bound: ~A"
            (slot-boundp c 'usocket::host-or-ip))))

It will output:

"Slot bound: NIL"

If you eval (usocket:get-hosts-by-name "github.com") then you'll see such traceback:

Condition USOCKET:NS-HOST-NOT-FOUND-ERROR was signalled.
   [Condition of type USOCKET:NS-HOST-NOT-FOUND-ERROR]

Restarts:
 0: [RETRY-REQUEST] Retry the same request.
 1: [RETRY] Retry SLY mREPL evaluation request.
 2: [*ABORT] Return to SLY's top level.
 3: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {1003C8BFF3}>)

Backtrace:
 0: (USOCKET::HANDLE-CONDITION #<SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR {1006D91CE3}> NIL)
 1: (SB-KERNEL::%SIGNAL #<SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR {1006D91CE3}>)
 2: (ERROR SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR :ERROR-CODE 8 :SYSCALL "getaddrinfo")
 3: (SB-BSD-SOCKETS::ADDRINFO-ERROR "getaddrinfo" 8)
 4: (SB-BSD-SOCKETS:GET-HOST-BY-NAME #<unavailable argument>)
 5: (USOCKET:GET-HOSTS-BY-NAME "api.github.com")
 6: (USOCKET:SOCKET-CONNECT "api.github.com" 443 :PROTOCOL :STREAM :ELEMENT-TYPE (UNSIGNED-BYTE 8) :TIMEOUT 10 :DEADLINE NIL :NODELAY T :LOCAL-HOST NIL :LOCAL-PORT NIL)

Inspecting condition object shows:

#<USOCKET:NS-HOST-NOT-FOUND-ERROR {1006D91DA3}>
--------------------
The object is a CONDITION of type USOCKET:NS-HOST-NOT-FOUND-ERROR.
HOST-OR-IP: #<unbound>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions