Skip to content

Commit

Permalink
* src/code/warm-mswin.lisp (mswin-spawn): zero out startupinfo, fixin…
Browse files Browse the repository at this point in the history
…g a subtle bug causing hard-to-reproduce access violations in CreateProcess.
  • Loading branch information
akovalenko committed Aug 23, 2011
1 parent 66106c2 commit 7117347
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/code/warm-mswin.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
(case arg (-1 default) (otherwise (setf inheritp t) arg)))))
(with-alien ((process-information process-information)
(startup-info startup-info))
(sb-kernel:system-area-ub8-fill
0 (alien-sap startup-info)
0 (alien-size startup-info :bytes))
(setf (slot startup-info 'cb) (alien-size startup-info :bytes)
(slot startup-info 'stdin) (maybe-std-handle stdin)
(slot startup-info 'stdout) (maybe-std-handle stdout)
Expand All @@ -99,7 +102,7 @@
(close-handle (slot process-information 'thread-handle))
(if waitp
(do () ((/= 1 (with-local-interrupts (wait-object-or-signal child)))
(multiple-value-bind (got code) (get-exit-code-process child)
(if got code -1))))
(multiple-value-bind (got code) (get-exit-code-process child)
(if got code -1))))
child))
-1))))))

0 comments on commit 7117347

Please sign in to comment.