[6257] in s-news-athena

home help back first fref pref prev next nref lref last post

SOLUTIONS TO postscript problem: Unix command exit status -1

daemon@ATHENA.MIT.EDU (Emily Dickinson)
Wed Jan 25 12:06:58 1995

Date: Wed, 25 Jan 95 09:14:40 MST
From: emily@predict.com (Emily Dickinson)
To: s-news@utstat.toronto.edu

##############################################################################
Subject: Re: postscript problem: Unix command exit status -1
##############################################################################

I'm posting the useful responses I received to my query yesterday.
The query was:

Rather unpredictably, when invoking the postscript() function, 
my Splus session grinds to a sudden halt with the following message:

Unix command exit status -1
Error in unix(paste("rm", paste("'", x,  , "'", se..: Error exit from unix
	command "rm '/tmp/unix29444'"
Dumped

> traceback()
Message: Error exit from unix command "rm '/tmp/unix29444'" 
13: unix(paste("rm", paste("'", x,  , "'", sep = "", collapse = " ")), output = F)
12: invisible(unix(paste("rm", paste("'", x,  , "'", sep = "", collapse = " ")), 
11: unlink(file)
10: unix("sed 's/[^:]*: *//'", input = matches[[1]])
9: sgraphrc.print("ps.command", getenv("S_POSTSCRIPT_PRINT_COMMAND"))
8: ".F8"(expression(sgraphrc.print("ps.command", getenv(
7: lapply(ps.options(), eval)
6: postscript(file = psFile, horizontal = horizontal, onefile = T)
...

I checked my S_POSTSCRIPT_PRINT_COMMAND env variable:

> getenv("S_POSTSCRIPT_PRINT_COMMAND")
 S_POSTSCRIPT_PRINT_COMMAND 
 "lpr -r -h"               


Has anyone else run into this problem?
I find the only cure is to quit my Splus session and restart it, and
then things run fine.  This is a terrible cure.

##############################################################################

Some useful responses included these:

1) From Jim McCarter:

> getenv("S_POSTSCRIPT_PRINT_COMMAND")
>  S_POSTSCRIPT_PRINT_COMMAND 
>  "lpr -r -h"               

Your lpr command is removing the file after printing (the -r option).
The postscript function has assumed that the file needs to be removed
after printing.  So the unix command to remove the file generates an
error.  To fix take the "-r" out of the S_POSTSCRIPT_PRINT_COMMAND
environment variable.  Or modify the postscript() function removing the
command to remove the file.

##############################################################################

##############################################################################

2) From Donald H. MacQueen macq@llnl.gov

I had a similar error message not to long ago. Here is what
StatSci had to say:

Thank you for your email question.  In your messasge you indicated that after
quitting and restarting Splus, your source file worked.  Here is an 
explanation of what could be happening:

If you get an error: unix exit status -1

When unix(..., out=F) returns -1, it means that the subprocess could
not be started.  The most common reason for this is that there is
not enough virtual memory to fork Splus (duplicate its address space).
This will appear to happen randomly because the amount of free virtual
memory depends on all the processes currently running on that machine.

(This is noted in the Programmer's Manual, chapter on the unix function).

If you continue to have problems with this source file, send us a copy and
we will see if it could be due to something else.

I hope this helps.  If you have further questions, do not
hesitate to contact us at support.

##############################################################################
For those interested, Don Maclean was also kind enough to include the
address for StatSci:

*********************************
*  StatSci			
*  A Division of MathSoft, Inc. 
*  Email: support@statsci.com
*  Phone: 206-283-8802		
*  FAX  : 206-283-8691	

##############################################################################

A *hearty* thanks to all those who responded!

Emily Dickinson
emily@predict.com

##############################################################################



home help back first fref pref prev next nref lref last post