Intermittent undefined hook removal assertion during cleanup
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reading src/Utils/ObjectList.pm (remove/clear) to see where the assertion is raised, then src/Plugins.pm (delHook) and src/InventoryList.pm (DESTROY) for the call chain. Try to reproduce with make test and, since it is intermittent, consider running the suite repeatedly or with a random test order. Note that pull request #4399 is already open against this issue, so coordinate there before writing code; done means the undefined handle is traced and the test command exits nonzero on a cleanup assertion.
Written by the indexing model from the issue text.
Description
Openkore version git
OpenKore git development tree; exact commit at the time of the warning was not recorded
XKore Mode
Empty
RO Server Name
N/A — unit tests; no Ragnarok server was involved
Link to RO server
N/A — unit tests; no server link applies
Result
During one execution of OpenKore's unit test suite, the TAP plan completed with all 1,923 tests passing, then Perl emitted:
(in cleanup) Assertion (Can't remove undefined item) failed!
The test runner returned exit code 0 despite the cleanup assertion. The warning appeared once and did not recur in four subsequent runs on either the development branch or its unchanged base. There is no confirmed reproduction sequence or root cause.
This was noticed while validating unrelated XSTools compatibility work. The cleanup code described below was unchanged by that work. No gameplay impact has been confirmed.
Potentially relevant current code:
src/InventoryList.pm,InventoryList::DESTROY, invokesPlugins::delHookfor stored hook handles before clearing the list.src/Plugins.pm,Plugins::delHook, gets an entry by saved hook index and passes it toremovewithout a defined check.src/Utils/ObjectList.pm,ObjectList::remove, asserts that the item is defined using the observed assertion text.
This code relationship is worth investigating, but it does not establish that this path caused the observed warning. Possible explanations include stale hook handles, duplicate removal, an invalidated index, or object destruction order.
Related history:
- #225 — Quitting has errors included an undefined entry passed to
ObjectList::removefromPlugins::delHookduring shutdown, along with an inventory cleanup assertion. It closed in 2017 after a comment that inventory lists had been updated. A shared root cause is unconfirmed. - #408 — Assertion (invIndex must be defined) failed, after running tests reported an intermittent post-test assertion in
InventoryList::DESTROY/ObjectList::clear. It was closed in November 2026 with a comment that it had not recurred for years. That assertion is distinct. - #4107 — Invalid hook handle passed to Plugins.delHook reported a shutdown-time invalid hook handle and was closed in 2025; the behavior differs from this observation.
This report does not attribute the warning to macOS, Apple Silicon, a particular Perl version, or XSTools.
Relevant Log Output
(in cleanup) Assertion (Can't remove undefined item) failed!
Expected Result
Ideally, test cleanup should complete without this assertion. If a cleanup assertion does occur, the test command should report failure with a nonzero exit status so automation does not silently pass.
How to Reproduce
The issue is intermittent and no deterministic reproduction is known. In one make test execution, all 1,923 TAP tests passed, then the cleanup assertion appeared and the command returned exit code 0. It did not recur in four subsequent runs on either the development branch or its unchanged base.
- Dominant language
- Perl
- Stars
- 1.5k
- Forks
- 1.2k
- Avg merge
- 11h
- Merged PRs (30d)
- 110
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenKore/openkore
-
fix(char-create): show the real reason a character is refusedPossibly taken @baphomello claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
fix(manner): show the real result of manner and mute packetsPossibly taken @baphomello claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
fix(utils): skip repeated delimiters in parseArgsPossibly taken @baphomello claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
fix(talknpc): bind server-started dialogs to the packet NPCPossibly taken @baphomello claimed this 2 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 1/100
Maintainers usually reply within 1 day
-
Will WX's interface get a dark mode?Possibly taken @baphomello claimed this 7 days ago. Openfeature request
Difficulty 5/5 Over a week Newbie friendliness 15/100
OpenKore/openkore#4316 · 4 comments ·
Maintainers usually reply within 1 day
All issues in OpenKore/openkore
Similar issues
-
Dev-output directory preparation accepts file-valued lib/include paths and fails on dangling linksOpenteam-cli
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 1/5 Under an hour Newbie friendliness 93/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
inverse-inc/packetfence#9728 ·
Maintainers usually reply within 1 day
-
area:cpan-port bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
fglock/PerlOnJava#2153 ·
Maintainers usually reply within 1 day