https://bugs.openldap.org/show_bug.cgi?id=9526
Issue ID: 9526 Summary: slapadd -w crashes Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: grapvar@gmail.com Target Milestone: ---
Let slapd.conf is:
database mdb suffix "o=Foo" sync_use_subentry
database is blank and we are adding this foo.ldif:
dn: o=FOO objectClass:organization
Let's load:
slapd -T add -v -l foo.ldif -w
then on Solaris:
added: "o=FOO" (00000001) Segmentation Fault (core dumped)
... on Linux:
added: "o=FOO" (00000001) => mdb_next_id: get failed: Invalid argument (22) => mdb_tool_next_id: next_id failed: Invalid argument (22) => mdb_tool_entry_put: txn_aborted! Invalid argument (22) slapadd: couldn't create context entry Closing DB...
This is because:
* mdb_tool_next_id() takes dead global [tools.c`static MDB_cursor *mcp] for further operations * cursor is dead because mdb_tool_entry_put() didn't initialized it * mdb_tool_entry_put() didn't initialized cursor because it thinks it is initialized, because there is an active global [tools.c`MDB_txn *mdb_tool_txn] * transaction was initialized by mdb_tool_dn2id_get(), which doesn't care about cursors.
Long story short: the global state in tools.c is not managed consistently and needs rethinking.
https://bugs.openldap.org/show_bug.cgi?id=9526
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #1 from Howard Chu hyc@openldap.org --- Thanks for the report, fixed in master.
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- Commits: • 8f392914 by Howard Chu at 2021-04-18T17:51:30+01:00 ITS#9526 slapd-mdb tools: fix cursor init check
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- RE24:
Commits: • 20af42df by Howard Chu at 2021-04-19T16:25:48+00:00 ITS#9526 slapd-mdb tools: fix cursor init check
https://bugs.openldap.org/show_bug.cgi?id=9526
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.4.59
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #4 from Konstantin Andreev grapvar@gmail.com --- Created attachment 815 --> https://bugs.openldap.org/attachment.cgi?id=815&action=edit unify diagnostic messages
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #5 from Konstantin Andreev grapvar@gmail.com --- Hi, I have also noted, that [-vw] gives
modified: "(null)" (00000001)
w/o [sync_use_subentry] config option, and keeps silence w/o it. Could you, please, fix the uniformity of diagnostic messages? Patch attached.
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #6 from Quanah Gibson-Mount quanah@openldap.org --- (In reply to Konstantin Andreev from comment #4)
Created attachment 815 [details] unify diagnostic messages
Your patch seems unrelated to this ITS, so would require a new one.
Additionally, it'd be a lot simpler if you'd just create MRs rather than patch sets.
https://bugs.openldap.org/show_bug.cgi?id=9526
--- Comment #7 from Konstantin Andreev grapvar@gmail.com ---
Additionally, it'd be a lot simpler if you'd just create MRs rather than patch sets.
yes, I remember.
Your patch seems unrelated to this ITS, so would require a new one.
It's ok/safe to ignore this patch, no problem.
https://bugs.openldap.org/show_bug.cgi?id=9526
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Resolution|TEST |FIXED