Calls of sb-ext:process-wait for exited process raise an error on Windows

Bug #1730286 reported by Eitaro Fukamachi on 2017-11-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

Calls of sb-ext:process-wait for an exited process raise a type-error.

This can be a regression commited at https://bugs.launchpad.net/sbcl/+bug/1724472 .
In SB-WIN32::WIN32-PROCESS-WAIT, it seems it doesn't care in the case of the process handle is already released.

## Reproducible Flow

1. Run a process

(defvar *p* (sb-ext:run-program "C:\\Windows\\System32\\Wbem\\WMIC.exe" '("Path" "Win32_Battery" "Get" "EstimatedChargeRemaining")))

2. See if the process is exited

*p*
;=> #<SB-IMPL::PROCESS :EXITED 0>

3. Call sb-ext:process-wait

(sb-ext:process-wait *p*)

debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {10027500C3}>:
  The value
    NIL
  is not of type
    (SIGNED-BYTE 64)
  when binding SB-ALIEN::VALUE

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-WIN32:WAIT-OBJECT-OR-SIGNAL NIL)
0] backtrace 20

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10027500C3}>
0: (SB-WIN32:WAIT-OBJECT-OR-SIGNAL NIL)
1: (SB-WIN32::WIN32-PROCESS-WAIT #<SB-IMPL::PROCESS :EXITED 0>)
2: (PROCESS-WAIT #<SB-IMPL::PROCESS :EXITED 0> #<unused argument>)
3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (PROCESS-WAIT *P*) #<NULL-LEXENV>)
4: (EVAL (PROCESS-WAIT *P*))
5: (INTERACTIVE-EVAL (PROCESS-WAIT *P*) :EVAL NIL)
6: (SB-IMPL::REPL-FUN NIL)
7: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
8: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL) {10039E2B4B}>)
9: (SB-IMPL::TOPLEVEL-REPL NIL)
10: (SB-IMPL::TOPLEVEL-INIT)
11: ((FLET "WITHOUT-INTERRUPTS-BODY-26" :IN SAVE-LISP-AND-DIE))
12: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))
13: ("foreign function: #x4362B8")
14: ("foreign function: #x4033C1")

## Environment

SBCL 1.4.1.51-7c350ccb7
Windows 10 Home
*features*
(:QUICKLISP :QUICKLISP-SUPPORT-HTTPS :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2
 :ASDF :OS-WINDOWS :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ROS.INIT :64-BIT
 :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
 :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS
 :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :FLOAT-EQL-VOPS :FP-AND-PC-STANDARD-SAVE
 :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS :INTEGER-EQL-VOP :LINKAGE-TABLE
 :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-PUTWC :PACKAGE-LOCAL-NICKNAMES :PRECISE-ARG-COUNT-ERROR
 :RAW-INSTANCE-INIT-VOPS :RAW-SIGNED-WORD :SB-DOC :SB-DYNAMIC-CORE :SB-EVAL
 :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-QSHOW :SB-SAFEPOINT
 :SB-SAFEPOINT-STRICTLY :SB-SIMD-PACK :SB-SOURCE-LOCATIONS :SB-THREAD
 :SB-THRUPTION :SB-UNICODE :SB-WTIMER :SBCL :STACK-ALLOCATABLE-CLOSURES
 :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS
 :UNBIND-N-VOP :UNDEFINED-FUN-RESTARTS :UNWIND-TO-FRAME-AND-CALL-VOP :WIN32
 :X86-64)

Stas Boukarev (stassats) wrote :

ce7eec29a758686a773273676fa390f4a8a1ecd2

Changed in sbcl:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers