[Date Prev][Date Next] [Chronological] [Thread] [Top]

OpenLDAP segfaults with back_perl and BerkeleyDB (ITS#2393)



Full_Name: John Browne
Version: 2.1.16
OS: Slackware Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (63.175.160.199)



Hello,

I had been fighting this for a-couple of days until I figured out what was going
on.   I thought I better submit an issue report, as it appears to be a bug. I
was having problems getting back-perl to make a connection to MySQL, using DBI
and DBD.  As soon as the MySQL connection was made from my back-perl module,
OpenLDAP would segfault.  I recompiled OpenLDAP *without* the BerkeleyDB
support, and the problem went away.  Here is the relevant information:


##################################
Version information:
##################################
Openldap versions: 2.1.16, also tried 2.1.12 (stable-20030107)
BerkeleyDB version: 4.1.25
MySQL version: 3.23.56
Perl DBI version: 1.35
Perl MySQL DBD version: 2.1026



##################################
slapd.conf database definition
##################################

database        perl
suffix          "dc=mydomain,dc=com"
rootdn          "cn=Manager,dc=mydomain,dc=com"
rootpw          alpha1

perlModulePath  /home/openldap
perlModule  MY_LDAP



#######################################################
Output of "slapd -d -1", with BerkeleyDB support:
#######################################################

r $ co $ personalTitle $ documentLocation $ documentVersion $ documentTitle $
documentIdentifier $ host $ userClass $ roomNumber $ drink $ info $
textEncodedORAddress $ uid $ labeledURI $ dmdName $ houseIdentifier $
dnQualifier $ generationQualifier $ initials $ givenName $ destinationIndicator
$ physicalDeliveryOfficeName $ postOfficeBox $ postalCode $ businessCategory $
description $ title $ ou $ o $ street $ st $ l $ c $ serialNumber $ sn $
knowledgeInformation $ cn $ name $ ref $ vendorVersion $ vendorName $
supportedSASLMechanisms ) )
    2.5.13.1 (distinguishedNameMatch): matchingRuleUse: ( 2.5.13.1 NAME
'distinguishedNameMatch' APPLIES ( dITRedirect $ associatedName $ secretary $
documentAuthor $ manager $ seeAlso $ roleOccupant $ owner $ member $
distinguishedName $ aliasedObjectName $ namingContexts $ subschemaSubentry $
modifiersName $ creatorsName ) )
    2.5.13.0 (objectIdentifierMatch): matchingRuleUse: ( 2.5.13.0 NAME
'objectIdentifierMatch' APPLIES ( supportedApplicationContext $
supportedFeatures $ supportedExtension $ supportedControl $
structuralObjectClass $ objectClass ) )
slapd startup: initiated.
PERL: BEGIN INIT METHOD
Segmentation fault
root@mail:/usr/local/openldap/libexec#



#######################################################
Output of "slapd -d -1", *without* BerkeleyDB support:
#######################################################

r $ co $ personalTitle $ documentLocation $ documentVersion $ documentTitle $
documentIdentifier $ host $ userClass $ roomNumber $ drink $ info $
textEncodedORAddress $ uid $ labeledURI $ dmdName $ houseIdentifier $
dnQualifier $ generationQualifier $ initials $ givenName $ destinationIndicator
$ physicalDeliveryOfficeName $ postOfficeBox $ postalCode $ businessCategory $
description $ title $ ou $ o $ street $ st $ l $ c $ serialNumber $ sn $
knowledgeInformation $ cn $ name $ ref $ vendorVersion $ vendorName $
supportedSASLMechanisms ) )
    2.5.13.1 (distinguishedNameMatch): matchingRuleUse: ( 2.5.13.1 NAME
'distinguishedNameMatch' APPLIES ( dITRedirect $ associatedName $ secretary $
documentAuthor $ manager $ seeAlso $ roleOccupant $ owner $ member $
distinguishedName $ aliasedObjectName $ namingContexts $ subschemaSubentry $
modifiersName $ creatorsName ) )
    2.5.13.0 (objectIdentifierMatch): matchingRuleUse: ( 2.5.13.0 NAME
'objectIdentifierMatch' APPLIES ( supportedApplicationContext $
supportedFeatures $ supportedExtension $ supportedControl $
structuralObjectClass $ objectClass ) )
slapd startup: initiated.
PERL: BEGIN INIT METHOD
PERL: END INIT METHOD
slapd starting
daemon: added 6r
daemon: select: listen=6 active_threads=0 tvp=NULL



###################################
"init" method in my perl module:
###################################

sub init
{
	print STDERR "PERL: BEGIN INIT METHOD\n";
	
	$vartesting = "TESTING123";

	# Connect to MySQL
	$dbname = "main_db";
	$hostname = "199.191.85.35";
	$username = "root";
	$password = "password";
	$dsn = "DBI:mysql:database=$dbname;host=$hostname";
	$dbh = DBI->connect($dsn, $username, $password) or print STDERR "PERL: Mysql
Connect Error: " . DBI::errstr;

	print STDERR "PERL: END INIT METHOD\n";
	if (defined $dbh) {
		return 0;
	}
	else {
		return 1;
	}

}




##################################################
end of strace output, with BDB-compiled OpenLDAP
##################################################

rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(7, "\t\t   \"BIGINT\"        => \"INTEGER"..., 4096) = 2307
brk(0x842a000)                          = 0x842a000
brk(0x842b000)                          = 0x842b000
brk(0x842c000)                          = 0x842c000
brk(0x842d000)                          = 0x842d000
brk(0x842e000)                          = 0x842e000
brk(0x842f000)                          = 0x842f000
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [RTMIN], 8) = 0
read(7, "", 4096)                       = 0
close(7)                                = 0
munmap(0x40015000, 4096)                = 0
stat64("/usr/lib/perl5/i386-linux/auto/DBD/mysql", 0x8238ec0) = -1 ENOENT (No
such file or directory)
stat64("/usr/lib/perl5/auto/DBD/mysql", 0x8238ec0) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so",
{st_mode=S_IFREG|0555, st_size=254540, ...}) = 0
stat64("/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.bs",
{st_mode=S_IFREG|0444, st_size=0, ...}) = 0
open("/usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so", O_RDONLY) =
7
read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\224\0"..., 1024) =
1024
fstat64(7, {st_mode=S_IFREG|0555, st_size=254540, ...}) = 0
old_mmap(NULL, 216352, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x40362000
mprotect(0x40384000, 77088, PROT_NONE)  = 0
old_mmap(0x40384000, 77824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7,
0x21000) = 0x40384000
close(7)                                = 0
open("/usr/local/mysql/lib/mysql/i686/mmx/libz.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/usr/local/mysql/lib/mysql/i686/mmx", 0xbfffeaec) = -1 ENOENT (No such
file or directory)
open("/usr/local/mysql/lib/mysql/i686/libz.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/local/mysql/lib/mysql/i686", 0xbfffeaec) = -1 ENOENT (No such file
or directory)
open("/usr/local/mysql/lib/mysql/mmx/libz.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/local/mysql/lib/mysql/mmx", 0xbfffeaec) = -1 ENOENT (No such file
or directory)
open("/usr/local/mysql/lib/mysql/libz.so.1", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/usr/local/mysql/lib/mysql", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
open("/usr/lib/i686/mmx/libz.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/i686/mmx", 0xbfffeaec) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libz.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/i686", 0xbfffeaec)     = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/libz.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/usr/lib/mmx", 0xbfffeaec)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libz.so.1", O_RDONLY)    = 7
read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \30\0\000"..., 1024) =
1024
fstat64(7, {st_mode=S_IFREG|0755, st_size=55668, ...}) = 0
old_mmap(NULL, 57616, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x40397000
mprotect(0x403a3000, 8464, PROT_NONE)   = 0
old_mmap(0x403a3000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7,
0xb000) = 0x403a3000
close(7)                                = 0
mprotect(0x40362000, 139264, PROT_READ|PROT_WRITE) = 0
mprotect(0x40362000, 139264, PROT_READ|PROT_EXEC) = 0
brk(0x8430000)                          = 0x8430000
brk(0x8431000)                          = 0x8431000
brk(0x8432000)                          = 0x8432000
open("/etc/ld.so.cache", O_RDONLY)      = 7
fstat64(7, {st_mode=S_IFREG|0644, st_size=14906, ...}) = 0
old_mmap(NULL, 14906, PROT_READ, MAP_PRIVATE, 7, 0) = 0x40015000
close(7)                                = 0
open("/lib/libnss_db.so.2", O_RDONLY)   = 7
read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\23\0"..., 1024) =
1024
fstat64(7, {st_mode=S_IFREG|0755, st_size=18756, ...}) = 0
old_mmap(NULL, 21240, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x403a6000
mprotect(0x403ab000, 760, PROT_NONE)    = 0
old_mmap(0x403ab000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7,
0x4000) = 0x403ab000
close(7)                                = 0
open("/lib/libdb-3.1.so", O_RDONLY)     = 7
read(7, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\361"..., 1024) =
1024
fstat64(7, {st_mode=S_IFREG|0755, st_size=494600, ...}) = 0
old_mmap(NULL, 489772, PROT_READ|PROT_EXEC, MAP_PRIVATE, 7, 0) = 0x403ac000
mprotect(0x40422000, 6444, PROT_NONE)   = 0
old_mmap(0x40422000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 7,
0x75000) = 0x40422000
close(7)                                = 0
munmap(0x40015000, 14906)               = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
root@mail:/usr/local/openldap/libexec#



Any thoughts???