Discussion:
ldapd(8) assertion fails on amd64 Dell PowerEdge R710
Seiya Kawashima
2017-05-25 19:04:39 UTC
Permalink
Hi Stuart,
I get different results,
adding new entry "dc=example,dc=org"
ldap_add: Invalid syntax (21)
...
May 25 19:50:46.852 [65476] adding entry dc=example,dc=org
May 25 19:50:46.853 [65476] createTimestamp: invalid syntax
May 25 19:50:46.853 [65476] syntax = Generalized Time
May 25 19:50:46.853 [65476] value: [20170525185046Z]
May 25 19:50:46.853 [65476] sending response 9 with result 21
May 25 19:50:46.854 [65476] consumed 7 bytes
This might be an issue that I filed a bug report named "Invalid syntax error from syntax_is_time() on ldapd(8) when adding entries" at http://marc.info/?l=openbsd-bugs&m=149398332032741&w=2 on 05/05/2017.

Thank you
Seiya

________________________________________
From: owner-***@openbsd.org [owner-***@openbsd.org] on behalf of Stuart Henderson [***@spacehopper.org]
Sent: Thursday, May 25, 2017 1:53 PM
To: Allan Streib
Cc: ***@openbsd.org
Subject: Re: ldapd(8) assertion fails on amd64 Dell PowerEdge R710
Synopsis: ldapd(8) assertion fails on amd64 Dell PowerEdge R710
Category: system
System : OpenBSD 6.1
Details : OpenBSD 6.1 (GENERIC.MP) #20: Sat Apr 1 13:45:56 MDT 2017
Architecture: OpenBSD.amd64
Machine : amd64
Upon adding the first entry to a new directory using ldapadd(1), an
assertion fails with the following message...
assertion "p->upper >= p->lower" failed: file "/usr/src/usr.sbin/ldapd/btree.c", line 1949, function "btree_add_node"
...and ldapd(8) exits.
1. Newly-installed 6.1-release on Dell PowerEdge R710, with
openldap-client from packages.
2. Create /etc/ldapd.conf, owner root, group wheel, mode 0600
listen on "/var/run/ldapd.sock"
rootdn "cn=admin,dc=example,dc=org"
rootpw "test1234"
schema "/etc/ldap/core.schema"
namespace "dc=example,dc=org" {
index objectClass
}
3. As root, start ldapd(8) in debug mode
ldapd -d -v
4. As a normal user in another login session, create init.ldif
dn: dc=example,dc=org
objectClass: top
objectClass: domain
dc: example
description: test
cat init.ldif | ldapadd -H ldapi://%2Fvar%2Frun%2Fldapd.sock -D "cn=admin,dc=example,dc=org" -W
adding new entry "dc=example,dc=org"
ldap_result: Can't contact LDAP server (-1)
I get different results,

adding new entry "dc=example,dc=org"
ldap_add: Invalid syntax (21)

...
May 25 19:50:46.852 [65476] adding entry dc=example,dc=org
May 25 19:50:46.853 [65476] createTimestamp: invalid syntax
May 25 19:50:46.853 [65476] syntax = Generalized Time
May 25 19:50:46.853 [65476] value: [20170525185046Z]
May 25 19:50:46.853 [65476] sending response 9 with result 21
May 25 19:50:46.854 [65476] consumed 7 bytes
...
May 24 14:08:09.938 [42637] accepted local connection by uid 1001
May 24 14:08:09.947 [42637] consumed 48 bytes
May 24 14:08:09.948 [42637] got request type 0, id 1
May 24 14:08:09.948 [42637] bind dn = cn=admin,dc=example,dc=org
May 24 14:08:09.948 [42637] successfully authenticated as cn=admin,dc=example,dc=org
May 24 14:08:09.948 [42637] sending response 1 with result 0
May 24 14:08:09.957 [42637] consumed 106 bytes
May 24 14:08:09.957 [42637] got request type 8, id 2
May 24 14:08:09.957 [42637] adding entry dc=example,dc=org
assertion "p->upper >= p->lower" failed: file "/usr/src/usr.sbin/ldapd/btree.c", line 1949, function "btree_add_node"
May 24 14:08:09.997 [28992] ldapd: removing unix socket /var/run/ldapd.sock
May 24 14:08:10.008 [28992] ldapd: exiting
Have not found fix or workaround. Running the same steps on my
desktop machine (ASUS w/AMI BIOS) or another available desktop (Dell
Optiplex 960 w/Dell "A05" BIOS) does not generate the assertion
failure. It happens on two different but identical Dell PowerEdge
R710 servers that I have tried. I have tried with all syspatches as
of this date and without any patches and the problem is the same.
Are the working machines running the same code? (amd64 MP 6.1-release)?
Allan Streib
2017-05-26 15:42:53 UTC
Permalink
I can explain that. The page size is being set based on the file
system block size.
Yes, I just discovered exactly this.

I was looking at the btree.c code and saw:

if (fstat(fd, &sb) == 0)
psize = sb.st_blksize;
else
psize = PAGESIZE;

On my desktop, from dumpfs(8):

bsize 16384 shift 14 mask 0xffffc000

And on the server:

bsize 65536 shift 16 mask 0xffff0000
Either indx_t needs to be changed to uint32_t or an upper bound
needs to be placed on psize, perhaps 0x7fff.
I'm not familiar enough with that code to say which is better.
I naively tried changing indx_t to uint32_tthat and got:

May 26 10:44:03.382 [27298] opening namespace dc=example,dc=org
btree_read_header:908: header has invalid magic

Currently, BT_MAGIC is #defined as 0xB3DBB3DB but I don't know what
comprises that value.

I think my short term workaround is going to be a smaller partition
mounted on /var/db/ldap.


Allan

Loading...