#13927: gpgme KDL's when test are enabled
--------------------------------------+----------------------------
Reporter: Begasus | Owner: axeld
Type: bug | Status: new
Priority: normal | Milestone: Unscheduled
Component: Network & Internet/TCP | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
--------------------------------------+----------------------------
Comment (by ambroff):
Unfortunately fixing this properly may result in a pretty large set of
changes.
Insert returns status_t, but most callers don't check the result. That's
kinda ok though cause we can just focus our effort in code that disabled
AutoExpand, which is only a handful.
There are many code paths which call BOpenHashTable<T>::InsertUnchecked,
which currently does not return an error at all, but I think that's
broken. The API conflates error checking with resizing here. There could
be a failure even if resizing is disabled (i.e., there is no more room in
the buffer).
I'm planning to submit a patch series that looks something like:
1. Add test suite for BOpenHashTable template with two failing tests (auto
expand disabled test and duplicate insertion test)
2. Fix the interface of BOpenHashTable so that Insert and InsertUnchecked
will return B_NO_MEMORY if auto expansion is disabled and the fTable
buffer is full.
3. Add error handling for all calls to Insert or InsertUnchecked where
auto expansion is disabled.
The remaining part is to address the duplicate entries issue that caused
the crash in this bug report. The main problem with this API is that it
implies that the same item can be inserted multiple times, since the
CheckForDuplicates non-type template parameter allows you to specify
whether to panic if a duplicate entry is inserted. This is flawed though.
While inserting multiple distinct object which could be looked up with the
same key is totally possible, inserting the same object multiple times is
not because it will create a reference cycle.
4. Would be changing the duplicate handling logic entirely.
--
Ticket URL: <https://dev.haiku-os.org/ticket/13927#comment:11>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.