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/c213ae00a337cb04e63cbfe4fb4b3af4c003918f/gui.c#L404 > > 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. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On Fri, Sep 30, 2022 at 10:04:27AM +0100, Daniel P. Berrang? wrote:> 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.For future reference, inside the virt-p2v ISO environment I logged in as root/p2v and edited /usr/bin/launch-virt-p2v, changing: - exec /usr/bin/virt-p2v --iso --colours + exec bash -c 'GTK_DEBUG=interactive /usr/bin/virt-p2v --iso --colours' I then ran launch-virt-p2v from the text console. This starts X11 and does launches virt-p2v & the separate inspector window. If you look at the attached screenshot, the inspector window (lower) has the GtkSpinner widget in blue. The widget name is greyed out which makes it hard to read. I guess that corresponds to the spinner being hidden. If you click Test Connection then the widget name becomes visible, probably corresponding to the idle task being run and calling start_spinner which shows the widget. (The spinner itself still does not show up or "spin"). When Test connection finishes, the widget name again goes back to being greyed out, probably corresponding to stop_spinner being called. A few other notes: The GtkLabel below the blue bar in the screenshot is the spinner message. This is being displayed and updated properly. If you click to the right of the "Style Classes" column in the inspector, then the widget or box is flashed in blue briefly. When GtkSpinner is inactive nothing happens. BUT (and it is difficult to do the mouse gymnastics here) if you click "Test Connection" and while that is running click to the right of the GtkSpinner, it does highlight a small blue box (displaying nothing) to the left of the spinner message. So it seems that the spinner widget is occupying the expected place on the screen, even if it's not displaying anything. Clicking the second button along the top row of the inspector shows details of the spinner. There's a lot of stuff here. For example under "CSS nodes" I can see the -gtk-icon-transform CSS changing to "rotate(XXX)" (with "XXX" rapidly increasing) as the spinner is supposed to be animating, but again no animation is shown. Under "Visual" there are various buttons. If you enable "Show Graphic Updates" then the GtkSpinner widget space flashes in red (again the spinner itself does not display), so it seems to indicate that Gtk "knows" that the spinner should be updating even if for some reason it doesn't get rendered. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot_2022-09-30_10-15-47.png Type: image/png Size: 62899 bytes Desc: not available URL: <http://listman.redhat.com/archives/libguestfs/attachments/20220930/ace6de7b/attachment.png>
Hmm, here's an interesting stackoverflow posting ... https://stackoverflow.com/questions/3301023/gtk-spinner-not-appearing The first point is "Make sure librsvg is installed". librsvg is _not_ installed in the ISO. Laszlo, can you try building an ISO with this package explicitly added to the deps? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
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/c213ae00a337cb04e63cbfe4fb4b3af4c003918f/gui.c#L404 >> >> 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.targetThe 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