ec: Install reports installed/ok when the client thread did not start

Open Beginner friendly
#2,910 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Read src/quest/combat/ec.cpp around InstallAt and inspect how pthread_create failure affects the returned install result. Add or use a host test that simulates thread start failure and checks the returned result; done means it reports partial with the failure reason when the thread did not start. The issue notes that this module has no row in src/quest/combat/combat_install.cpp in the referenced release.

Written by the indexing model from the issue text.

Description

bug

Found by a code-smell sweep over the kept combat code and verified by reading the code on the release.

Evidence at 1ab81980e (release/v6.20.0)
  • src/quest/combat/ec.cpp, InstallAt (about lines 766 to 779): when pthread_create fails the install logs combat_ec_install with result: partial, reason: thread_not_started and the consequence "nothing is sent: the EC client is idle". It then computes full from g_listOn, the log gate, the observer and the settings, which do not include the thread, and returns InstallLine(full ? "installed" : "partial", full ? "ok" : ...). With the other four parts up and the thread not started, the module reports installed / ok although it does nothing.
  • The module has no row in the combat install table (src/quest/combat/combat_install.cpp), so this cannot happen in this build today. It becomes live when the row is added.
Not shown
  • That pthread_create fails on a headset in practice.
Falsifier

A host test that makes the thread start fail (for example a thread-start seam that returns an error) and reads the install result: installed / ok is the defect.

Work
  1. Test first: an install whose thread did not start reports partial with the reason, in the returned result and not only in the earlier record.
  2. Include the thread in full.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.