GNU bug report logs -
#36279
26.2.90; (process-attributes nonexistent-pid) segmentation fault
Previous Next
Reported by: Xu Chunyang <mail <at> xuchunyang.me>
Date: Tue, 18 Jun 2019 13:27:02 UTC
Severity: normal
Tags: fixed
Found in version 26.2.90
Fixed in version 26.3
Done: Robert Pluim <rpluim <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Date: Wed, 19 Jun 2019 00:23:20 +0800
> From: xuchunyang <mail <at> xuchunyang.me>
> Cc: 36279 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
>
> It fixes the issue for me too. (process-attributes 123456) returns nil instead of crashing Emacs.
>
> >
> > diff --git a/src/sysdep.c b/src/sysdep.c
> > index 1e35e06b63..518ecebcf6 100644
> > --- a/src/sysdep.c
> > +++ b/src/sysdep.c
> > @@ -3798,7 +3798,7 @@ system_process_attributes (Lisp_Object pid)
> > CONS_TO_INTEGER (pid, int, proc_id);
> > mib[3] = proc_id;
> >
> > - if (sysctl (mib, 4, &proc, &proclen, NULL, 0) != 0)
> > + if (sysctl (mib, 4, &proc, &proclen, NULL, 0) != 0 || proclen == 0)
> > return attrs;
> >
> > uid = proc.kp_eproc.e_ucred.cr_uid;
> >
Thanks. Robert, please push to the emacs-26 branch.
(I understand this problem is quite old, is that right?)
This bug report was last modified 5 years and 342 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.