Rotator Read fields never update after Engage (timer removed in dfb7b02)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
src/gtk-rot-ctrl.c の gtk_rot_ctrl_new() から始め、rot_ctrl_timeout_cb() と gtk_rot_ctrl_destroy() を調べて、タイマーの設定とクリーンアップを理解してください。Cycle の値を 10 に設定して再現し、Engage の後に Azimuth/Elevation の Read ラベルが更新されるか確認してください。更新され、既存のウィンドウを閉じる際のクラッシュガードが維持されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Alex,
While testing the most recent version in the repo, I encountered a loss of connectivity to my HamLi controlled, LVB Tracker mediated Yaesu G-5500 az/el rotor controller. This has also been an intermittent issue for me before but I could not understand why. The that end, I used the Claude LLM to help troubleshoot the problem. A summary of what was reported back, and a solution that is now working for me is below.
Best,
Bob
N6RFM
Summary
gtk_rot_ctrl_new() no longer starts the rotator widget's own periodic
display-refresh timer. As a result, the Azimuth/Elevation "Read:"
labels in the Rotator Control window can remain permanently stuck at
--- after clicking Engage, even though the underlying rotctld
connection and hardware communication are completely healthy.
Whether this is visible depends on an unrelated setting (the Cycle
spinbox's saved value), which makes it intermittent and hard to
pin down from user reports alone.
Environment
- Reproduced on current
master(9399b12, "Fix spelling error")
and on every tagged release from 2.4 through 2.6.4 - GTK 3.24.41, GLib 2.80.0, built from source on Ubuntu 24.04
- Also reproduced in a headless sandbox using Hamlib's "Dummy"
rotator backend, so it is not specific to any particular rotator
hardware orrotctldmodel
Steps to reproduce
- Configure any rotator device (Preferences → Interfaces → Rotators)
with rotctld connection details. - Ensure the rotator's saved
Cyclevalue in its.rotconfig file
is exactly10(see "Root cause" below for why this specific
value matters). - Open a module's Rotator Control window and click Engage.
Expected: The Azimuth/Elevation "Read:" fields update
periodically with the rotator's actual reported position.
Actual: The fields remain at --- indefinitely. The Engage
button correctly toggles to "Disengage," rotctld logs successful
position queries, and a manual rotctl -m 2 -r <host>:<port> p query
returns correct live values — but the GUI never reflects it.
Disengaging and re-engaging, restarting rotctld, or rebuilding from
a clean checkout does not change the outcome.
Root cause
Commit dfb7b02276a9f2887be5de62a32e36c79c128637 ("Closing the rotor
control window while a rotor is engaged no longer crashes Gpredict")
fixed a real double-free/crash-on-close bug, but in doing so removed
the only unconditional call that created the widget's periodic
refresh timer:
--- a/src/gtk-rot-ctrl.c
+++ b/src/gtk-rot-ctrl.c
@@ -1681,9 +1681,6 @@ GtkWidget *gtk_rot_ctrl_new(GtkSatModule * module)
gtk_box_pack_start(GTK_BOX(rot_ctrl), table, FALSE, FALSE, 5);
gtk_container_set_border_width(GTK_CONTAINER(rot_ctrl), 5);
- rot_ctrl->timerid = g_timeout_add(rot_ctrl->delay,
- rot_ctrl_timeout_cb, rot_ctrl);
-
if (module->target > 0)
gtk_rot_ctrl_select_sat(rot_ctrl, module->target);
The satellite module's own periodic loop still calls
gtk_rot_ctrl_update() on the widget every cycle, but this alone is
not sufficient to drive the display — confirmed by explicitly
wiring module->rotctrl to a test-instrumented widget (matching the
production code path in gtk-sat-module-popup.c's rotctrl_cb
exactly) and still observing the labels never update. Without
rot_ctrl->timerid being set at creation, the widget's own refresh
cycle is simply never established.
Why it's intermittent rather than always broken
A separate, unrelated handler happens to recreate the same timer as
a side effect:
static void delay_changed_cb(GtkSpinButton * spin, gpointer data)
{
GtkRotCtrl *ctrl = GTK_ROT_CTRL(data);
ctrl->delay = (guint) gtk_spin_button_get_value(spin);
if (ctrl->conf)
ctrl->conf->cycle = ctrl->delay;
if (ctrl->timerid > 0)
g_source_remove(ctrl->timerid);
ctrl->timerid = g_timeout_add(ctrl->delay, rot_ctrl_timeout_cb, ctrl);
}
This fires on the Cycle spinbox's "value-changed" signal, which
GTK also emits when the value is set programmatically — as
happens automatically at startup when a saved rotator device is
auto-selected via rot_selected_cb():
gtk_spin_button_set_value(GTK_SPIN_BUTTON(ctrl->cycle_spin), ctrl->conf->cycle);
The Cycle spinbox is constructed with
gtk_spin_button_new_with_range(10, 10000, 10), so its value is 10
before any config is applied. GTK only fires "value-changed" when
the new value differs from the current one — so:
Saved Cycle |
Signal fires? | Timer created? | Display works? |
|---|---|---|---|
10 |
No | No | Stuck at --- |
| Anything else | Yes | Yes | Works |
DEFAULT_CYCLE_MS (1000) is used whenever a .rot file has no
Cycle key at all — the normal case for a rotor configured fresh
through Preferences, since that dialog doesn't expose a Cycle field.
So the bug mostly surfaces for users who have, at some point, set
the live Cycle field to exactly its minimum value (e.g. chasing the
fastest possible update rate), or copied/adapted a .rot file from
elsewhere with that value already present.
How this was isolated
Manual testing on real GS-232-protocol hardware confirmed rotctld
and the serial link were always healthy, which ruled out everything
except the GUI code itself. To pin down the exact commit, a headless,
fully automated reproduction was built:
- Xvfb virtual display + Hamlib's built-in Dummy rotator backend
(no physical hardware required) - A small instrumentation hook that creates the Rotator Control
widget, engages it programmatically, waits, then reads the
AzRead/ElReadlabel text directly and reports pass/fail — no
GUI clicking or screenshots git bisect runagainst this script between a confirmed-good
commit and current master
This identified dfb7b02 as the exact point where behavior changed,
and follow-up tests confirmed the Cycle-value mechanism specifically
(rather than just the commit boundary) — including confirming that
toggling Engage/Disengage, which is a natural first troubleshooting
step, cannot fix it, since that code path never touches the timer.
Suggested fix
Restore the timer creation, keeping the ctrl->timerid = 0 reset in
gtk_rot_ctrl_destroy() (added in b74d9bdf9fcfc27d7ea606d779a8f6d6f33a6cb7,
the commit immediately after dfb7b02) as the existing guard against
the original double-free:
rot_ctrl->timerid = g_timeout_add(rot_ctrl->delay,
rot_ctrl_timeout_cb, rot_ctrl);
Verified in the sandboxed reproduction above: with this line restored,
the Read fields update correctly even with Cycle set to 10 — the
exact value that leaves current master permanently broken.
Happy to open a PR with this change if useful.
- 主要言語
- C
- スター
- 1.2k
- フォーク
- 305
- 平均マージ
- 8時間 48分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
csete/gpredict のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1時間未満 初心者へのやさしさ 60/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 78/100
-
rotator
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
VirusTotal/yara#2255 ·
-
[BUG] Filename sequence expansion (`+`) panics on numeric values exceeding `i32::MAX`対応中かも @muntasir-396 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
CCExtractor/ccextractor#2402 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
FujiNetWIFI/fujinet-lib#204 ·
メンテナーはふだん 1 日以内に返信
-
os:linux
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mpv-player/mpv#18649 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
facebookincubator/muse-gadget-sdk#249 ·
メンテナーはふだん 1 日以内に返信