Raymond Toy pushed to branch master at cmucl / cmucl
Commits: b8841170 by Raymond Toy at 2018-01-27T13:04:52-08:00 Fix #49: CLM crashes
When invoking motifd, the program name is #p:'library:motifd". This is passed directly to spawn (a C routine), which only accepts strings. So, before calling spawn, convert the program path to a unix namestring.
This allows the example from the bug to run without crashing.
- - - - - 87c07e5d by Raymond Toy at 2018-01-27T18:19:56-08:00 Make sure spawn is called with a string
The previous commit worked for search lists, but the program could be a string. Take care to convert pathnames to strings so that spawn is always called with a string.
- - - - - 99eb4311 by Raymond Toy at 2018-01-28T02:54:17+00:00 Merge branch 'rtoy-fix-49-clm-crash' into 'master'
Fix #49: CLM crashes
Closes #49
See merge request cmucl/cmucl!32 - - - - -
1 changed file:
- src/code/run-program.lisp
Changes:
===================================== src/code/run-program.lisp ===================================== --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -522,8 +522,18 @@ ;; Make sure all the args are okay. (unless (every #'simple-string-p args) (error (intl:gettext "All args to program must be simple strings -- ~S.") args)) + + ;; Make sure program is a string that we can use with spawn. + (setf program + (if (pathnamep program) + (lisp::with-pathname (p program) + (or (unix::unix-namestring p) + (namestring p))) + (namestring program))) + (check-type program string) + ;; Prepend the program to the argument list. - (push (namestring program) args) + (push program args) ;; Clear random specials used by GET-DESCRIPTOR-FOR to communicate cleanup ;; info. Also, establish proc at this level so we can return it. (let (*close-on-error* *close-in-parent* *handlers-installed* proc) @@ -566,9 +576,10 @@ (cdr entry))) env)) (let ((child-pid - (without-gcing - (spawn program argv envp pty-name - stdin stdout stderr)))) + (without-gcing + (spawn program + argv envp pty-name + stdin stdout stderr)))) (when (< child-pid 0) (error (intl:gettext "Could not fork child process: ~A") (unix:get-unix-error-msg)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/b464fc941ebe07fb0e11ef8d2...
--- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/b464fc941ebe07fb0e11ef8d2... You're receiving this email because of your account on gitlab.common-lisp.net.