mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-29 20:28:53 +01:00
Windows crash chain (exposed by the embedded-node default): - main.cpp: force the QtQuick software renderer. The Mining tab's QQuickWidget drove the default RHI/GL path and faulted (0xc0000005) on broken-GL hosts (VirtualBox VMSVGA), crashing the app and orphaning the embedded node. Real hardware was unaffected. - ChildProcessGuard + DaemonManager/TorManager: kernel-level die-with-parent (Windows Job Object KILL_ON_JOB_CLOSE / Linux PR_SET_PDEATHSIG) so the embedded wownerod and bundled tor never survive a wowlet exit or crash. - DaemonManager: verify-before-adopt via get_info (nettype/height) instead of trusting a bare open RPC port, so a stale/orphan node is never adopted. Node/Tor lifecycle + remote-node connectivity: - config: torPrivacyLevel default -> allTorExceptNode. NEVER sync blocks over Tor; the wallet's node connection is always clearnet. Tor is only for tx broadcast, so remote nodes work with or without Tor. - nodes: add Nodes::reconnect() (clear failure blocklist + force reconnect); node/Tor toggle handlers use it so a transient outage no longer strands the wallet at "Disconnected". - MainWindow/SettingsDialog: reconnect on node/Tor toggle and on the async daemonStateChanged (closes the start() race; a freshly-toggled local node connects immediately). - TorManager: reset retry/unpack state in init() so a system<->bundled Tor re-toggle can start again; quiesce on stop(). Linux unpackBins() rework (mkpath + presence-based unpack + graceful return-false), getVersion() arg fix, and a missing-binary start guard. - build.yml: derive TOR_VERSION from the embedded tor binary (a hardcoded bundle number made unpackBins rewrite Tor every launch). - depends/funcs.mk: confine cross-cmake find_package to the depends sysroot so host -dev libraries don't leak into the build.
34 lines
1.6 KiB
C++
34 lines
1.6 KiB
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// SPDX-FileCopyrightText: The Monero Project
|
|
|
|
#ifndef WOWLET_CHILDPROCESSGUARD_H
|
|
#define WOWLET_CHILDPROCESSGUARD_H
|
|
|
|
#include <QProcess>
|
|
|
|
// wowlet: OS-level "die with parent" for spawned child processes (embedded wownerod, bundled tor).
|
|
//
|
|
// QProcess does NOT kill its child when the parent exits or crashes; it only detaches. Feather's
|
|
// TorManager/DaemonManager relied solely on an explicit stop() in the normal-quit path, so an
|
|
// unhandled crash (e.g. a 0xc0000005 access violation) orphaned the children. This binds the
|
|
// child's lifetime to wowlet's at the kernel level, which survives a hard crash where no C++
|
|
// destructor and no Qt teardown runs.
|
|
//
|
|
// Windows: a single process-wide Job Object with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. Assign each
|
|
// child after start(); when wowlet's process dies the job's last handle closes and the
|
|
// kernel terminates every process still in the job.
|
|
// Unix: prctl(PR_SET_PDEATHSIG, SIGKILL) installed in the child (via setChildProcessModifier),
|
|
// so the kernel SIGKILLs the child when the parent dies.
|
|
namespace ChildProcessGuard
|
|
{
|
|
// Unix: arrange for `process` to receive SIGKILL when wowlet dies. Call BEFORE process->start().
|
|
// No-op on Windows (the Job Object handles it post-start).
|
|
void installPreStart(QProcess *process);
|
|
|
|
// Windows: assign the (now-running) child to wowlet's kill-on-close job. Call right AFTER start()
|
|
// returns and the child has a PID. No-op on Unix.
|
|
void adoptAfterStart(QProcess *process);
|
|
}
|
|
|
|
#endif //WOWLET_CHILDPROCESSGUARD_H
|