READ-CHAR-NO-HANG hangs on SB-SYS:WAIT-UNTIL-FD-USABLE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
READ-CHAR-NO-HANGS hung on me with 100% CPU usage after I tried to read from a freshly closed socket.
This socket was freshly closed though, so I suspect some kind of race condition.
If I read the docstrings at https:/
I'm on SBCL 1.4.9.
-------
Interrupt from Emacs
[Condition of type SIMPLE-ERROR]
Restarts:
0: [CONTINUE] Continue from break.
1: [RETRY] Retry SLIME REPL evaluation request.
2: [*ABORT] Return to SLIME's top level.
3: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1002EC83E3}>)
Backtrace:
0: ("bogus stack frame")
[No Locals]
1: (SB-SYS:
Locals:
SB-IMPL::FD = 7
TIMEOUT = NIL
2: (SB-IMPL:
Locals:
COUNT = 0
ERRNO = 0
FD = 7
STREAM = #<SB-SYS:FD-STREAM for "socket 127.0.0.1:44262, peer: 127.0.0.1:38347" {1007E3F583}>
3: (SB-IMPL:
Locals:
EOF-ERROR = T
EOF-VALUE = NIL
IBUF = #S(SB-IMPL::BUFFER :SAP #.(SB-SYS:INT-SAP #X7F32EA374000) :LENGTH 4096 :HEAD 0 :TAIL 0)
SIZE = NIL
STREAM = #<SB-SYS:FD-STREAM for "socket 127.0.0.1:44262, peer: 127.0.0.1:38347" {1007E3F583}>
Catch-tags:
4: (READ-CHAR-NO-HANG #<SB-SYS:FD-STREAM for "socket 127.0.0.1:44262, peer: 127.0.0.1:38347" {1007E3F583}> T NIL #<unused argument>)
Locals:
STREAM = #<SB-SYS:FD-STREAM for "socket 127.0.0.1:44262, peer: 127.0.0.1:38347" {1007E3F583}>
5: (PEEK-CHAR-NO-HANG #<SB-SYS:FD-STREAM for "socket 127.0.0.1:44262, peer: 127.0.0.1:38347" {1007E3F583}> T NIL NIL)
Locals:
EOF-ERROR-P = T
EOF-VALUE = NIL
RECURSIVE-P = NIL
...
Changed in sbcl: | |
status: | New → Invalid |
When I compile a function in slime (via C-c C-c), the loop is broken and the execution continues. I assume this is because SBCL serves some other events and then it discovers that the FD is (un)usable and it is capable of proceeding with computation.