Error when interactive threads list is empty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
In toplevel REPL, run this code and type 0 (continue) in the debugger (run in thread 2) before 10 seconds :
(progn
;; Create a new thread
(sb-
;; Wait for the debugger to be called
(sleep 1)
;; Main thread releases foreground (and Thread 2 gets it, displaying debugger)
(sb-
;; Type 0 (continue) to end Thread 2 while main thread is waiting
(sleep 10))
SBCL should return to REPL in main thread, then main thread sould call get-foreground et get foreground.
What happens : infinite loop displaying errors.
With Ctrl + S or recreating the error with Thread 2 by calling sb-thread:
Displaying (sb-thread:
Pushing main-thread in (sb-thread:
I don't understand from the backtrace where the error happens exactly but it seems that get-foreground don't like the list of interactive threads being empty.
what seems happening : the second thread gets foreground, main-thread releases foreground (release-foreground checks if there is something else in the list of interacive threads and yes : Thread 2 is in the list), then Thread 2 ends and there is nothing remaining in the list (the thread is probably removed from the list without being replaced by another one). Calling get-foreground at this time signals a type error somewhere (which is the main problem). Then debugger is called and calls get-foreground too, which signals a second error because of a non-recursive lock in get-foreground (this second problem is not the important one, but it generates an infinite error loop).
(is get-foreground intented to be used by user ? it is noted in SBCL manuel with release-foreground and seems useful but it is an internal symbol)
------------
$ sbcl --version
SBCL 1.3.15
$ uname -a
Linux yggdrasil 4.10.9-1-ARCH #1 SMP PREEMPT Sat Apr 8 12:39:59 CEST 2017 x86_64 GNU/Linux
* *features*
(:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:C-STACK-
:COMPARE-
:FP-AND-
:IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
:LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-THREAD :SB-UNICODE :SBCL :STACK-
:STACK-
:STACK-
:UNBIND-N-VOP :UNDEFINED-
:X86-64)
Changed in sbcl: | |
status: | New → In Progress |
assignee: | nobody → Jan Moringen (scymtym) |
importance: | Undecided → Low |
Changed in sbcl: | |
status: | In Progress → Fix Committed |
assignee: | Jan Moringen (scymtym) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |