#49066 Fix: memory leaks in ns-slapd, various components
Closed: wontfix None Opened 7 years ago by firstyear.

It was noticed that a number of components were leaking memory at server shutdown. This would interfere with legitimate attempts to detect leaks in new features.

None of these leaks are really "new", but due to the changes recently, it amplified their presence and effects.


There are a still a number of leaks, but they are all static and related to plugin start up / shutdown. It only leaks a static 5807 bytes. I'm investigating now.

Should say, this passes basic and dynamic test suites.

I think there is an issue with multiple backends on one of the tests. Will investigate.

Patch seems okay, but there are a ton of indentation issues.

Knew you were going to say that. I often miss the tabs vs space in my editor. Generally I prefer to go back and fix hardtabs to soft tabs in this case.

There is a single issue in the patch, so I'll need to submit a new review anyway. I'll submit two, one for the follow up fix (heap use after free in ldbm_backend_cleanup), one to fix the indentations. Does that seem okay?

I'll do a whitespace clean up in a follow up patch Mark

Indentation issue in plugin.c. Otherwise looks good, ack.

Regarding the indentation issues you keep having... What I do is review my patch in trac, because the patch viewer easily shows these problems. Then you can adjust your patch before you announce that it's ready to be reviewed. Thanks!

commit 4ce08bef615b4114924af4f3a391892ea097709a
Writing objects: 100% (50/50), 8.78 KiB | 0 bytes/s, done.
Total 50 (delta 42), reused 1 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
4973699..8cda4b1 master -> master

This resolves the remaining leaks in replication and the mutex leaks.
0001-Ticket-49066-Memory-leaks-in-server-part-2.patch

The first patch has introduced some regressions (these were not addressed in the second patch):. I'm not sure what the full impact is, but it could be bad. So after starting the server, several plugin entries log errors that they are missing "objectclass"

{{{
[20/Dec/2016:11:14:54.496832407 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=octetStringMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.499200636 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=octetStringOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.501304990 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=bitStringMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.503540095 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseExactIA5Match,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.505530643 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseExactMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.507707634 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseExactOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.509827407 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseExactSubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.512127380 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseExactIA5SubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.514656227 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=generalizedTimeMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.516669411 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=generalizedTimeOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.518666086 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=booleanMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.520819178 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreIA5Match,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.522869128 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreIA5SubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.525056472 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.527415364 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.529586489 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreSubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.531694815 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreListMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.533730994 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=caseIgnoreListSubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.535850888 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=objectIdentifierMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.537965518 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=directoryStringFirstComponentMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.540045476 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=objectIdentifierFirstComponentMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.542715088 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=distinguishedNameMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.545446617 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=integerMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.547555061 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=integerOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.549658231 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=integerFirstComponentMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.551903302 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=uniqueMemberMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.554015184 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=numericStringMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.556096932 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=numericStringOrderingMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.558229627 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=numericStringSubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.561065055 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=telephoneNumberMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.563190409 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=telephoneNumberSubstringsMatch,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.567063499 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Auto Membership postop plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.569535726 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Class of Service postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.571534855 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Class of Service internalpostoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.582928353 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Legacy replication preoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.585242357 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Legacy replication postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.587251409 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Legacy replication internal preoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.589290737 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Legacy replication internal postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.592701250 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Legacy replication entry plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.594861054 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Linked Attributes postop plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.597322306 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Managed Entries postop plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.599799355 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=memberof preop plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.602246366 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication preoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.604300048 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication bepreoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.606414442 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication betxnpostoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.608583089 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication betxnpreoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.610823206 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication bepostoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.613073138 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.615282536 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication internal preoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.617354069 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication internal postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.619418662 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication start extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.621577083 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication end extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.623949573 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication total update extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.626294331 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication extended response plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.628327775 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication cleanruv extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.630435658 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication cleanruv abort extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.632496886 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication cleanruv maxcsn extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.634632912 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Multimaster replication cleanruv status extended operation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.637614887 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Roles postoperation plugin,cn=plugins,cn=config" required attribute "objectclass" missing
[20/Dec/2016:11:14:54.643713658 -0500] - ERR - slapi_entry_schema_check_ext - Entry "cn=Password Modify extended operation,cn=plugins,cn=config" required attribute "objectclass" missing
}}}

Please investigate this.

I don't think it's "harmful". This has always been the case. It's just that by adding the plugins to be able to be freed at shutdown, it causes this message.

I'm going to investigate the message and submit a third part. This error is introduced by patch one, so the nack to patch 2 isn't really justified here. :(

Reworked this patch. There was a race condition in release mtnode for the replica.

That code is just ... messy, and I'm not sure there is a good way to solve this. The other fixes included are still valid.

This also contains the fix for schema checking on the plugin entries.

Thanks!

Looks good, except indentation issue in plugin.c. ack

commit 77382ddafb7a5c1546c5e48bbdd243664f25f43c
Writing objects: 100% (17/17), 3.58 KiB | 0 bytes/s, done.
Total 17 (delta 15), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
a79ae70..c87c57e master -> master

Metadata Update from @firstyear:
- Issue assigned to firstyear
- Issue set to the milestone: 1.3.6.0

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2125

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata