[GE users] Segmentation Fault

Ron Chen ron_chen_123 at yahoo.com
Wed Mar 2 08:09:52 GMT 2005


Seems like there is a bug in SGE?

In libs/uti/sge_uidgid.c, we have:

while (getgrgid_r(gid, &grentry, buf, size, &gr) != 0)
{
  if (!retries--)
  {
   ERROR((SGE_EVENT, ...));
  }
}

BTW, the Solaris 9 manpage mentioned that there are 2
implementation of getgrgid_r:
 a) POSIX which returns int;
 b) the default one which returns struct group *

Also the manpage says:

RETURN VALUES
  The  getgrnam(), getgrnam_r(), getgrgid(), and
  getgrgid_r() functions  each  return  a pointer
  to a struct group if they successfully locate the
  requested  entry;  otherwise  they return NULL.

So, if the gid is not resolved, then the pointer is
NULL, but the return value is still 0.

I tested the behaviour of the functions on Linux with
some invalid gids, and seems like the Solaris manpage
is correct that checking the result (the last
argument) against NULL will tell us whether the data
is valid or not.

 -Ron

--- Fred L Youhanaie <fly at anydata.co.uk> wrote:
> I can reproduce this, if my gid does not have a
> corresponding entry in 
> the groups file (probably same for nis etc.) then
> qhost will segfault!
> 
> Joyce, make sure that your group id is present in
> the /etc/group and/or 
> your nis tables.
> 
> Cheers
> f.
> 
> 
> 
> Rayson Ho wrote:
> > Since it dies in sge_gid2group(), what is the
> output of "id" on that
> > machine??
> > 
> > Rayson
> > 
> > 
> > 
> >>I did the following and get the output as below:
> >>1.  I did ". $SGE_ROOT/util/dl.sh .
> >>2. then I did;
> >>
> >>>dl 10
> >>>qhost  then last few lines of the output display
> as following:
> >>
> >>  226  21915 1 <-- sge_malloc()
> ../libs/uti/sge_stdlib.c 83 }
> >>  227  21915 1 --> sge_uid2user() {
> >>  228  21915 1 <-- sge_uid2user()
> ../libs/uti/sge_uidgid.c 488 }
> >>  229  21915 1 --> sge_gid2group() {
> >>  230  21915 1 --> sge_malloc() {
> >>  231  21915 1 <-- sge_malloc()
> ../libs/uti/sge_stdlib.c 83 }
> >>Segmentation Fault
> >>
> >>>dl 0
> >>
> >>Joyce
> > 
> >
>
---------------------------------------------------------
> > Get your FREE E-mail account at
> http://www.eseenet.com !
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> > For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> > 
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> 
> 




	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list