/usr/ucb/lpr Out of Memory

Graham D. Parrington Graham.Parrington%newcastle.ac.uk at nsfnet-relay.ac.uk
Sat May 6 23:00:10 AEST 1989


Aha! Someone else has come across this problem - we found it a couple of
weeks ago - however, you need source to fix it (maybe you can be clever
with the binary but we did not try it). The problem is lpr itself - it
includes a routine called mktemp (that is the same name as a library
routine) but which takes a different number of parameters to the library
routine. Unfortunately lpr calls 'getwd' which tries to call the library
version of 'mktemp' - guess which version it really gets....  The net
result of this is that the lpr version of 'mktemp' only gets supplied with
one parameter when it wants three -it picks up trash of the stack for the
rest and depending upon what these are lpr fails with an out of memory
error.  The solution is to rename the internal version so that it's name
doesn't class with a library name (we used lprmktemp). Another solution
that could work if you've the disk space for it is to up the swap space -
we found that in general the presumably arbitrary values on the stack
caused a malloc request for about 24Mb.  We've reported our findings to
Sun UK so expect a genuine fix at some point in the future.

Graham Parrington, Computing Laboratory, University of Newcastle upon Tyne, UK

JANET = Graham.Parrington at uk.ac.newcastle
ARPA  = Graham.Parrington at newcastle.ac.uk
UUCP  = ...!ukc!newcastle.ac.uk!Graham.Parrington
PHONE = +44 91 222 8067



More information about the Comp.sys.sun mailing list