On 09/30/22 11:04, Daniel P. Berrangé wrote:
On Fri, Sep 30, 2022 at 09:41:02AM +0100, Richard W.M. Jones wrote:
> On Fri, Sep 30, 2022 at 08:55:02AM +0100, Daniel P. Berrangé wrote:
>> On Thu, Sep 29, 2022 at 07:12:15PM +0100, Richard W.M. Jones wrote:
>>> On Thu, Sep 29, 2022 at 04:47:34PM +0200, Laszlo Ersek wrote:
>>>>
http://lacos.interhost.hu/livecd-p2v-202209291608-gitc213ae00a337.iso
>>>>
>>>> (built at c213ae00a337)
>>>>
>>>> sha256: f3a149aeab0179213d74bb1eac30d5d6f807d4c9cf3a548667903d5434d5699a
>>>
>>> No spinner!
>>
>> BTW, is there any possibility your code is invoking GTK3 APIs
>> from a thread != main GTK event loop thread ? If so, that is
>> a sure way to get non-deterministic wierd behaviour with GTK.
>
> Maybe? This is the code which is run when the "Test Connection"
> button is clicked:
>
>
https://github.com/libguestfs/virt-p2v/blob/c213ae00a337cb04e63cbfe4fb4b3...
>
> It runs a thread (to test the connection using ssh) and that thread
> creates an idle {job? event?} in the new thread.
>
> However I documented it as:
>
> * Idle task called from C<test_connection_thread> (but run on the
> * main thread) to start the spinner in the connection dialog.
>
> Whether that is true or not and how I deduced that, I don't recall.
The test_connection_thread code is using g_idle_add to run all
GTK APIs, which results in it running in the main event loop
thread. That is the correct way to deal with GTK from multiple
threads.
As an idea to debug it more, try using the GTK inspector
$ GTK_DEBUG=interactive <app binary>
this will popup a second window, which lets you browse the
widget hierarchy, view properties, etc. This might let you
see something that's set in an incorrect way.
I've added this:
diff --git a/p2v.service b/p2v.service
index 2c431b5148e9..e57db5273c8f 100644
--- a/p2v.service
+++ b/p2v.service
@@ -32,6 +32,7 @@ ExecStart=/usr/bin/launch-virt-p2v
RemainAfterExit=yes
StandardOutput=journal+console
StandardError=inherit
+Environment=GTK_DEBUG=interactive
[Install]
WantedBy=multi-user.target
The SVG icon that the animation is supposed to display is
/usr/share/icons/Adwaita/scalable-up-to-32/status/process-working-symbolic.svg
(grep the "gtk-3-24" branch of the upstream gtk repo for
"process-working-symbolic".)
This file is present in the VM disk image as well.
In the GTK debug window, when I enable Visual | Show Graphic Updates,
the small rectangle where the spinner should be animated is highligted
in red (dimensions slightly changing as the animation progresses). This
highlighting is identical between the working and the broken cases. But
in the broken case, the actual (rotated) icon is not shown under the red
highlight.
The entire theme engine looks CSS based, which makes it very difficult
for me to debug :/
I'll try to install a simple WM (twm or icewm?) in the VM disk image;
perhaps that will make a difference.
Laszlo