watchDogDaemon (kernel.cpp)
- Client lines are assembled in a buffer. readLine() on the non-blocking
socket dropped the bytes of a line that had only partly arrived.
- EOF (client closed or crashed without "-1") ends the monitoring of that
client. Before, EOF read as "no data", and after the deadline kill(9) went
to a PID that may belong to another process by then.
- The handler record is zeroed. "finished" was uninitialized (malloc), so
the accept loop could pthread_join() a live handler and block.
- Finished handlers are joined, freed and erased correctly. erase()
inside the for loop skipped the next one, and the records were never
freed. A record whose thread could not be created is freed.
pthread_create() returns an error number, not -1.
- The bind() result is checked.
- The log says which PID is watched or stopped, and for a stall how long
ago the last update was ("WD update STALLED! (PID n, last update N ms
ago)").
kernelPrototype
- Sends getpid() as the PID to kill (was gettid(): the same value only in
the main thread).
Tested with the rebuilt daemon: the kernel scenarios as before (normal,
6 s step: not killed; hang: killed). A client that closes without "-1":
its process isn't killed later. An update split into 3 pieces, 6 times
with a 4 s deadline: understood, not killed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
Standalone example of the Darknet C++ API (hank-ai Darknet/YOLO V3+):
load a network (cfg / names / weights), set the detection and NMS
thresholds, run Darknet::predict() on OpenCV frames, print the
detections (class, confidence, box) and draw them with
Darknet::annotate().
- Input: an image (annotated copy saved as <name>_output.jpg), a video
file or a camera index (shown in a window; without a display the
result is written to output.avi).
- Build: make (g++ -std=c++17 ... opencv4 ... -ldarknet); README covers
build, model files, usage and how it works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
- kernelEventFilterYOLO.h:
* Darknet V3+ (hank-ai) declares load_network(), load_network_custom()
and free_network_ptr() only when DARKNET_INCLUDE_ORIGINAL_API is
defined before darknet.h ("was not declared in this scope"): define it.
* Darknet installs the header as <prefix>/include/darknet.h, not
darknet/darknet.h: include <darknet.h>, fall back to
<darknet/darknet.h>, clear #error if neither exists.
* m_pNET was DarknetNetworkPtr * (void **) although DarknetNetworkPtr is
already void *: "invalid conversion from void* to void**".
- makefile / la_mojo.vpj: -ldarknet was only linked in Release86; the
build script uses Debug86. Added to Debug86 and Debug (the .vpj too,
so a SlickEdit regeneration keeps it).
- kernelEventFilterYOLO::initFilter(): load the settings first
(validate()); m_sYOLOFilterData was still zero, so fileExist("") made
initFilter() always fail. Logs why it fails, frees a previously loaded
network, logs the network dimensions. Destructor stops the thread
before freeing the network.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16