Ticket #347 - IPA dirsvr seg-fault during system longevity test
https://fedorahosted.org/389/ticket/347
Resolves: Ticket 347
Bug Description: IPA dirsvr seg-fault during system longevity test
Reviewed by: nhosoi, mreynolds (Thanks!)
Branch: master
Fix Description: Somehow the DB_MULTIPLE_NEXT pointer is being set to
an invalid value (-5). This causes the next iteration to return memory
that points to before the stack buffer, causing a seg fault. Valid
values for the pointer are > -1. The value -1 is used as the list terminator
value. The code that constructs the buffer is in the libdb function
__bam_bulk in bt_cursor.c. The fix is to check for a value < -1,
assume the page or value has been deleted out from under us, and do
a dbc->get to get the next buffer full, if any. The code also needs to
check for duplicate IDs being returned. In the failure case described
above, it is possible that the last ID returned in the multiple buffer is
the first ID in the next buffer. In that case, we want to skip the ID that
was already added to the IDL.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 5d45dd8de06aaee3e0a52c85fa5b3e18febd7a27)