From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1691109527f91e23b0a18a8231988091.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199612020351.TAA01165@gerbil.aod.com> Date: Sun, 1 Dec 1996 22:51:43 -0500 (EST) From: Jeff Odom Subject: Re: lpd memory violations In-Reply-To: <199612012222.PAA02989@ellpspace.math.ualberta.ca> > > > > lpd calls __ivaliduser to check if a host is in either > > /etc/hosts.equiv or /etc/hosts.lpr. The way it calls it is: > > > > __ivaliduser(fd, hostname, DUMMY, DUMMY, baselen) > > > > However, when called, all it gives is a line > > that goes something like: > > > > memory violation at pc=155556bfa20 rp=155556beba0 (bad address = 00000000) > > I do not have sources handy, but you have 99% chance that this problem > is caused by passing to __ivaliduser long, or pointer, where it > expects int, or vice-versa. __invaliduser may "know", for example, > that 'int' is long enough to keep length of a baselen but gets something > of size_t type and the whole stack gets out of whack. If you do not > have sources to __ivaliduser, and nobody will volunteer with a > prototype, then tracing the call in a debugger is likely the only > option (and probably on an assembler level - grrr ...). Yeesh. I just rewrote the section that uses it with my own function. I'll figure out __ivaliduser() later...actually, I think that rlogin/rsh uses it as well, as hosts.equiv is used by both rlogin and lpd. Something else to work on, I guess. > As long as __ivaliduser is not totally hosed and does not truncate > pointers to 32-bits thing can be likely rescued by a few casts on > call arguments. > > Good luck, > Michal Thanks. Actually, I got lpd to finally work. It seems there was another bug, this time in printjob.c. The function status() seems to do varargs incorrectly (I don't think gcc likes k&r style very much), so I got an additional error with sprintf there too. The interesting thing is, the executable that comes with lpr-0.12.1 doesn't blow up there, but the executable that results from compiling the source does. If I figure out what's exactly wrong with __ivaliduser, I'll post a patch. > > P.S. An attempt to send mail directly to the original poster fails > with this interesting, ahem, error :-) Actually, that seems to have come from having my NFS server knocked off the network, so filter couldn't write to my mail file. I just love centralized networks, don't you? :) Jeff -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com