* lpd memory violations
@ 1996-12-01 0:12 Jeff Odom
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Odom @ 1996-12-01 0:12 UTC (permalink / raw)
Does anyone know what the format of __ivaliduser is? It seems that under
RH 4.0, 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)
where fd is the file descriptor of either file, hostname is the remote
machine's full name, and baselen is the length of the machine's short name
(i.e. "foo" in foo.bar.gov).
It looks like lpd expects __ivaliduser to return 0 if the hostname is
found in one of the files. However, when called, all it gives is a line
that goes something like:
memory violation at pc=155556bfa20 rp=155556beba0 (bad address = 00000000)
and then dumps a core. I can bypass this by putting in my own routine, of
course, but that's not exactly the best fix. I'd really like to know what
the fields are that DUMMY fills in, too...
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
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <Pine.LNX.3.95.961130190432.5883B-100000@wehsal.mb.jhu.edu>]
* Re: lpd memory violations
[not found] <Pine.LNX.3.95.961130190432.5883B-100000@wehsal.mb.jhu.edu>
@ 1996-12-01 22:22 ` Michal Jaegermann
1996-12-02 3:51 ` Jeff Odom
0 siblings, 1 reply; 5+ messages in thread
From: Michal Jaegermann @ 1996-12-01 22:22 UTC (permalink / raw)
>
> 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 ...).
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
P.S. An attempt to send mail directly to the original poster fails
with this interesting, ahem, error :-)
--QAA10600.849477332/wehsal.mb.jhu.edu
The original message was received at Sun, 1 Dec 1996 16:55:30 -0500
from ellpspace.math.ualberta.ca [129.128.88.19]
----- The following addresses have delivery notifications -----
|/usr/bin/filter (unrecoverable error)
(expanded from: <zeus@wehsal.mb.jhu.edu>)
----- Transcript of session follows -----
sh: /usr/bin/filter: No such file or directory
554 |/usr/bin/filter... unknown mailer error 126
--QAA10600.849477332/wehsal.mb.jhu.edu
Content-Type: message/delivery-status
Reporting-MTA: dns; wehsal.mb.jhu.edu
Received-From-MTA: DNS; ellpspace.math.ualberta.ca
Arrival-Date: Sun, 1 Dec 1996 16:55:30 -0500
Final-Recipient: RFC822; zeus@wehsal.mb.jhu.edu
X-Actual-Recipient: RFC822; |/usr/bin/filter@wehsal.mb.jhu.edu
Action: failed
Status: 5.0.0
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: lpd memory violations
1996-12-01 22:22 ` Michal Jaegermann
@ 1996-12-02 3:51 ` Jeff Odom
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Odom @ 1996-12-02 3:51 UTC (permalink / raw)
> >
> > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lpd memory violations
@ 1996-12-02 4:28 Przemek Klosowski
0 siblings, 0 replies; 5+ messages in thread
From: Przemek Klosowski @ 1996-12-02 4:28 UTC (permalink / raw)
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.
Funny---I thought I posted this bug with a patch to this list and to
RedHat support about 2 weeks ago. Did anyone see it, or is my mail going
to the Big Bit Bucket?
p
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lpd memory violations
@ 1996-12-02 15:48 Przemek Klosowski
0 siblings, 0 replies; 5+ messages in thread
From: Przemek Klosowski @ 1996-12-02 15:48 UTC (permalink / raw)
Since several people told me that they haven't received my report
on lpr segfaults, so here is a copy.
Problem report with RH4.0: lpr
I upgraded to 4.0 from 3.0.3 and then installed the RPMs from
/pub/redhat/redhat-4.0/updates/axp, including lpr-0.12-1.axp.rpm
'lpr' dumps core when presented with unknown printer
# lpr -Pnosuchprinter
Segmentation fault
It looks like it is due to a questionable code in lpr.c:
fatal("%s: unknown printer", s);
where 'fatal()' is defined as follows:
fatal(msg, a1, a2, a3)
char *msg;
{
printf("%s: ", name);
printf(msg, a1, a2, a3);
putchar('\n');
exit(1);
}
The pointers are implicitly declared as integers, and are truncated.
The proper solution is to define fatal() using varargs; a simple
patch is to declare a1 a2 a3 as void *:
fatal(msg, a1, a2, a3)
char *msg;
+ void *a1, *a2, *a3;
{
There are 3 places where such unsavory practices take place in lpr-0.12-1:
common_source/common.c:338:/*VARARGS1*/
lpd/printjob.c:1291:/*VARARGS1*/
lpr/lpr.c:751:/*VARARGS1*/
przemek klosowski <przemek@nist.gov> (301) 975-6249
Reactor Division (bldg. 235), E111
National Institute of Standards and Technology
Gaithersburg, MD 20899, USA
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1996-12-02 15:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-12-01 0:12 lpd memory violations Jeff Odom
[not found] <Pine.LNX.3.95.961130190432.5883B-100000@wehsal.mb.jhu.edu>
1996-12-01 22:22 ` Michal Jaegermann
1996-12-02 3:51 ` Jeff Odom
-- strict thread matches above, loose matches on Subject: below --
1996-12-02 4:28 Przemek Klosowski
1996-12-02 15:48 Przemek Klosowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox