Opened 17 years ago

Closed 10 years ago

#160 closed defect (fixed)

IZ960: Buffer sent to getgrgid_r is too small

Reported by: uddeborg Owned by:
Priority: normal Milestone:
Component: sge Version: 6.0beta
Severity: minor Keywords: Sun Solaris kernel


[Imported from gridengine issuezilla]

        Issue #:      960              Platform:     Sun       Reporter: uddeborg (uddeborg)
       Component:     gridengine          OS:        Solaris
     Subcomponent:    kernel           Version:      6.0beta      CC:    None defined
        Status:       VERIFIED         Priority:     P3
      Resolution:     FIXED           Issue type:    DEFECT
                                   Target milestone: ---
      Assigned to:    adoerr (adoerr)
      QA Contact:     andreas
       * Summary:     Buffer sent to getgrgid_r is too small
   Status whiteboard:

     Issue 960 blocks:
   Votes for issue 960:

   Opened: Wed Apr 7 05:18:00 -0700 2004 

My attempt to install on Solaris failed.  "qconf
-sh" returned the error message:

error: getgrgid(13) failed: No such file or directory

I tried to track this down.  It appears to be
because the buffer sent to getgrgid_r is too
small.  In the function sge_gid2group() in
source/libs/uti/sge_uidgid.c there is a call of
getgrgid_r with a buffer with a size of 2048.
This call fails when I run it on our 64 bit
Solaris machines.

According to the Solaris manual for getgrgid_r,
the maximum size which could be needed can be
found with the call sysconf(_SC_GETGR_R_SIZE_MAX).
 I tried this on a couple of platforms I have
available here, and got those figures:

Sparc, Solaris 8, 32 bit app: 7296
Sparc, Solaris 8, 64 bit app: 10496
PowerPC, AIX 5.2, 32 and 64 bit app: 20023
PARisc, HP-UX 11, 32 and 64 bit app: 2048
AMD64, Red Hat EL 3, 32 and 64 bit app: 1024
IA32, Red Hat EL 3, 32 bit app: 1024

It varies quite a lot, and 2048 obviously is too
small in several cases.  We have some groups with
rather many members, a bit over 100, which
probably affects this.  But not so many members
that an application should break.

Preferably, I'd suggest allocating a buffer with a
size taken from the return value of sysconf().
Otherwise, I would suggest to at least increase
the static size by an order of magnitude.

   ------- Additional comments from andreas Tue May 4 03:17:28 -0700 2004 -------
There is more than one function where this needs to be changed.

   ------- Additional comments from adoerr Tue May 11 05:57:48 -0700 2004 -------

   ------- Additional comments from adoerr Sat May 22 07:33:41 -0700 2004 -------

   ------- Additional comments from uddeborg Thu May 27 02:38:42 -0700 2004 -------
I've rebuilt locally with source/libs/uti/sge_uidgid.c taken from
HEAD, and it seems to work fine now.

Change History (1)

comment:1 Changed 10 years ago by dlove

  • Resolution set to fixed
  • Severity set to minor
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.