Issue 6494 - Various errors when using extended matching rule on vlv sort filter#6495
Issue 6494 - Various errors when using extended matching rule on vlv sort filter#6495progier389 merged 2 commits into389ds:mainfrom
Conversation
| /* | ||
| * Determine if vlv require extended matching rule evaluation | ||
| */ | ||
| static int |
There was a problem hiding this comment.
shoul use C11 bool
| dblayer_destroy_txn_stack(void) | ||
| { | ||
| /* Cleanup for the main thread to avoid false/positive leaks from libasan */ | ||
| void *txn_stack = PR_GetThreadPrivate(thread_private_txn_stack); |
There was a problem hiding this comment.
Unused variable, but why "get" it if you just "set" it to NULL on the next line?
There was a problem hiding this comment.
Indeed, something looks broken.
either the slapi_ch_free(&txn_stack); line is missing, or the PR_GetThreadPrivate should be deleted. (depending whether PR_SetThreadPrivate calls the cleanup callback or not) I will double check
|
There was a problem hiding this comment.
Clearly the dblayer_cleanup_txn_stack is called when using PR_SetThreadPrivate ==> No need to get the data to release it
#1 0x7f00d94601eb in slapi_ch_free /home/progier/sb/r67020/tst/source/389-ds-base/ldap/servers/slapd/ch_malloc.c:286
#2 0x7f00d22a6876 in dblayer_cleanup_txn_stack /home/progier/sb/r67020/tst/source/389-ds-base/ldap/servers/slapd/back-ldbm/dblayer.c:1373
#3 0x7f00d8b04920 in PR_SetThreadPrivate (/lib64/libnspr4.so+0x13920) (BuildId: e6dfe24882ade9ec65f7f1591a3e9e249e5a5780)
#4 0x7f00d22aac9f in dblayer_destroy_txn_stack /home/progier/sb/r67020/tst/source/389-ds-base/ldap/servers/slapd/back-ldbm/dblayer.c:1429
#5 0x7f00d22aad5d in dblayer_close /home/progier/sb/r67020/tst/source/389-ds-base/ldap/servers/slapd/back-ldbm/dblayer.c:500
mreynolds389
left a comment
There was a problem hiding this comment.
Did a covscan run as well, and didn't see any regressions. Ack!
|
Thanks for fixing those issues - re-ack! |
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec) (cherry picked from commit 223a202)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec) (cherry picked from commit 223a202) (cherry picked from commit 2800437)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec) (cherry picked from commit 223a202) (cherry picked from commit 2800437)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec) (cherry picked from commit 223a202) (cherry picked from commit 2800437)
…sort filter (#6495) * Issue 6494 - Various errors when using extended matching rule on vlv sort filter Various issues when configuring and using extended matching rule within a vlv sort filter: Race condition about the keys storage while indexing leading to various heap and data corruption. (lmdb only) Crash while indexing if vlv are misconfigured because NULL key is not checked. Read after block because of data type mismatch between SlapiValue and berval Memory leaks Solution: Serialize the vlv index key generation if vlv filter has an extended matching rule. Check null keys Always provides SlapiValue even ifg we want to get keys as bervals Free properly the resources Issue: #6494 Reviewed by: @mreynolds389 (Thanks!) (cherry picked from commit 4bd27ec) (cherry picked from commit 223a202) (cherry picked from commit 2800437)
Various issues when configuring and using extended matching rule within a vlv sort filter:
Solution:
Issue: #6494
Reviewed by: @mreynolds389 (Thanks!)