Re: ps -t seg faults under 1.3.97 with patch

Robert Wuest (rwuest@ix.netcom.com)
Mon, 06 May 1996 17:01:28 -0500


shaggenbunsenburner wrote:
>
> On Thu, 2 May 1996, Joel Maslak wrote:
>
> > On Thu, 2 May 1996, shaggenbunsenburner wrote:
> >
> > > i'm not 100% sure it's not a bad SIMM, i got new ones about a week ago,
> > > but i haven't seen any other problems that could be explained that way,
> > > so i'll test some more.
> >
> > I don't think I have memory problems (up times of 60 days with current
> > memory), but I have the ps -t segmentation fault.
> >
> > procps 0.99a
> > Linux 1.3.97
> > libc 5.3.12
>
> cool... this is the same setup i have, so it sounds like a definite bug.
> and also sounds like i don't have to worry about my memory too much! :)
>
> i'm cc'ing this to linux-kernel... any ideas, folks? i know the output
> of "ps" WRT tty's changed sometime around 1.3.85; since then it's shown
> virtual consoles as "1" or "10" rather than "v01" or "v10".
>
> is there any other setup info anyone needs?
>
> > The University of California at Berkeley has invented TWO things:
> > 1. LSD
> > 2. Unix
> > Coincidence? I think not.

I have no idea what happened to the first time I posted this. Anyway, here it
is again.

There is a bug in ps. The patch is below. I have mailed the author and he
promises it'll be in 0.99b.

Hope the patch is good. I know it works, just not too sure of myself when
making patches.

BTW, ps -t isn't really a valid command! ps -t1 is.

ps --help reveals:

usage: ps -acehjlnrsSuvwx{t<tty>|#|O[-]u[-]U..}

---------------- cut here -----------------------

--- ps.c Fri May 3 20:45:44 1996
+++ /usr/local/src/procps-0.99a/ps.c Sat Feb 24 14:50:04 1996
@@ -239,7 +239,7 @@
if (CL_run_only) { pflags |= PROC_STAT; args = "RD"; }
if (!CL_all) { pflags |= PROC_UID; args = uid; uid[0] = getuid(); pflags &= ~PROC_STAT; }
if (CL_pids) { pflags |= PROC_PID; args = CL_pids; pflags &= ~PROC_UID; pflags &= ~PROC_STAT; }
- if (CL_ctty && *CL_ctty != '\0') {
+ if (CL_ctty) {
if ((tty[0] = tty_to_dev(CL_ctty)) == (dev_t)-1) {
fprintf(stderr, "the name `%s' is not a tty\n", CL_ctty);
exit(1);
---------------- cut here -----------------------

-- 
mailto:rwuest@ix.netcom.com
Empowered by Linux.
mke2fs /dev/hda1