Summary: mmldif crashes in PK11_CreateDigestContext
https://bugzilla.redhat.com/show_bug.cgi?id=491215
Description of problem:
Reported by Neuron Ring.
1. I need to merge to input files using mmldif tool
2. I m exporting it to a ldif file using db2ldif tool
/opt/dirsrv/slapd-<instance1> /db2ldif -n <backend_instance1>
/opt/dirsrv/slapd-<instance1> /db2ldif -n <backend_instance2>
3. I got two ldif files by exporting two directory server instance databases.
One.ldif
dn: sn=Jensen,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Babs Jensen
sn: Jensen
telephoneNumber: 555-5550
createTimestamp: 100
dn: sn=Minsky,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Pete Minsky
sn: Minsky
telephoneNumber: 555-5551
createTimestamp: 100
dn: sn=Rose,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Paula Rose
sn: Rose
telephoneNumber: 555-5552
createTimestamp: 100
Two.ldif
dn: sn=Jensen,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Babs Jensen
sn: Jensen
telephoneNumber: 555-5550
createTimestamp: 100
dn: sn=Minsky,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Pete Minsky
sn: Minsky
telephoneNumber: 555-5559
modifyTimestamp: 200
dn: sn=Morris,dc=siroe,dc=com
objectclass: top
objectclass: person
cn: Ted Morris
sn: Morris
telephoneNumber: 555-5558
createTimestamp: 200
dn: sn=Rose,dc=siroe,dc=com
objectclass: nsTombstone
deleteTimestamp: 200
4. Now I m trying to use mmldif tool.
5. /opt/dirsrv/bin/mmldif -c -D -o /home/neuronring/output.ldif /home/
neuronring/one.ldif /home/ neuronring/two.ldif
6. Finally everything IN VAIN, I got the following error:
[18/Mar/2009:11:35:04 +051800] - finger printing directory 0
[18/Mar/2009:11:35:04 +051800] - db0: dn: sn=Jensen,dc=siroe,dc=com
/opt/dirsrv/bin/mmldif[50]: 18247 Memory fault(coredump)
The following files are created in my path.
1. one.ldif.delta
2. two.ldif.delta
These two files has no data 0 bytes size.
3. core – size 1882552 bytes
Even I tried exporting the database with –r option (for replica) after stopping
the instance. I m getting this error continuously with different error numbers
like, /opt/dirsrv/bin/mmldif[50]: 10854 Memory fault(coredump).
Somebody please suggest me to resolve this issue.
Thanks in advance,
Neuron Ring.
[Stacktrace from the crash]
Core was generated by `/usr/bin/mmldif-bin -o exampleM.ldif ./example0.ldif
./example1.ldif'.
Program terminated with signal 11, Segmentation fault.
[New process 31424]
#0 0x00007f57fac11acb in NSSRWLock_LockRead_Util (rwlock=0x0) at nssrwlk.c:177
177 PZ_Lock(rwlock->rw_lock);
Missing separate debuginfos, use: debuginfo-install cyrus-sasl.x86_64
e2fsprogs.x86_64 keyutils.x86_64 krb5.x86_64 libselinux.x86_64 svrcore.x86_64
(gdb) bt
#0 0x00007f57fac11acb in NSSRWLock_LockRead_Util (rwlock=0x0) at nssrwlk.c:177
#1 0x00007f57fb0791bb in SECMOD_GetReadLock (modLock=0x0) at pk11list.c:71
#2 0x00007f57fb09d43e in PK11_GetAllTokens (type=544, needRW=0, loadCerts=1,
wincx=0x0) at pk11slot.c:1786
#3 0x00007f57fb09d67a in PK11_GetBestSlotMultiple (type=0x7fff03620438,
mech_count=1, wincx=0x0) at pk11slot.c:1876
#4 0x00007f57fb09d8e0 in PK11_GetBestSlot (type=544, wincx=0x0)
at pk11slot.c:1937
#5 0x00007f57fb07741a in PK11_CreateDigestContext (hashAlg=SEC_OID_SHA1)
at pk11cxt.c:411
#6 0x0000000000402d99 in hashname (seed=-76 '�', attrib=0x7f57fa686cb0,
hashkey=0x7fff03620660 "�\212�\034<")
at ldap/servers/slapd/tools/mmldif.c:936
#7 0x00000000004014b0 in mm_diff (statsp=0x7fff036206c0)
at ldap/servers/slapd/tools/mmldif.c:375
#8 0x00000000004045f5 in main (argc=5, argv=0x7fff03620828)
at ldap/servers/slapd/tools/mmldif.c:1479
Cause: secmod module list / module list lock is NULL.
[Proposed fix]
Created an attachment (id=335932)
--> (
https://bugzilla.redhat.com/attachment.cgi?id=335932)
cvs diff ldapserver/ldap/servers/slapd/tools/mmldif.c
Description: NSS was not initialized. Since cert db, key db, or secmod db are
not needed, changed to call NSS_NoDB_Init to initialize NSS.