Bug 1609 - 3.2beta MDS segfaults on static LDIF entries
: 3.2beta MDS segfaults on static LDIF entries
Status: VERIFIED FIXED
: MDS2
gt2_mds
: unspecified
: All All
: P2 major
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-02-27 17:49 by
Modified: 2005-12-06 16:59 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-02-27 17:49:45
The 3.2beta slapd dies with a segmentation fault when presented with
any static entry in /opt/globus/etc/grid-info-resource-ldif.conf.
For example:

---------------------------------------------------------------------------
dn: GlueServiceURI=ldap://some-host.cern.ch:2136, mds-vo-name=local, o=grid
objectclass: GlueTop
objectclass: GlueService
GlueServiceURI: ldap://some-host.cern.ch:2136
GlueServiceAccessPointURL: ldap://some-host.cern.ch:2136/mds-vo-
name=local,o=grid
GlueServiceType: gridice
objectclass: GlueKey
objectclass: GlueSchemaVersion
GlueSchemaVersionMajor: 1
GlueSchemaVersionMinor: 1
---------------------------------------------------------------------------

Only dynamic entries work.  For example:

---------------------------------------------------------------------------
dn: Mds-Vo-name=local,o=grid
objectclass: GlobusTop
objectclass: GlobusActiveObject
objectclass: GlobusActiveSearch
type: exec
path: /some/path/libexec
base: some-script
args: foo
cachetime: 60
timelimit: 20
sizelimit: 50
---------------------------------------------------------------------------

The problem is due to a bug in mds/openldap/ldapmodules/init.c.
On line 464 it has the following (indentation adapted for clarity):

---------------------------------------------------------------------------
    ((*glist)[ldt->total_inx])->dataobj_gris = (DataObj_gris **) calloc
        (((*glist)[ldt->total_inx])->mod, sizeof(DataObj_gris *));
---------------------------------------------------------------------------

But then on lines 479-481 it does this (indentation again adapted):
 
---------------------------------------------------------------------------
    if (!activeobj) {
        e = str2entry(ldif_strip_comments(obj));
        ((*glist)[ldt->total_inx])->dataobj_gris
            [((*glist)[ldt->total_inx])->current]->e = e;
---------------------------------------------------------------------------

I.e. a "dataobj_gris" array element is used as a pointer while it
still has a value of zero from the call to calloc().

The presence of this bug forces us to create a dynamic script to
produce the static result we used to be able to specify directly
with Globus 2.2.4 (the bug is also present in Globus 2.4.x).
Though the bug is not a showstopper, it does seem it should be
fairly easy for the MDS developers to fix it, so please do so!
------- Comment #1 From 2004-03-18 15:02:57 -------
Fixed.  Will be available in GT 3.2 final release.  The OpenLdap library 
utility routine str2entry(char *str) seems to not only create an entry from the 
static data but mangles the string itself, subsequent calls to the routine 
causes the slapd to crash.
------- Comment #2 From 2004-04-10 16:37:31 -------
The fix seems to work fine indeed.  Thanks!