FS#78933 - [guvcview-qt] Renaming the binary to -qt breaks relaunching the process

Attached to Project: Arch Linux
Opened by Denilson Sá Maia (denilsonsa) - Friday, 30 June 2023, 07:53 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Balló György (City-busz)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Somewhere in guvcview-qt source-code, it uses its own precompiled binary name to (re)launch itself. Thus, when renaming from guvcview to guvcview-qt, this feature gets broken.


Additional info:
* package version: 2.0.8-3
* link to upstream bug report: nothing yet

Steps to reproduce:

1. Install guvcview-qt.
2. Open it, go to "Video Controls" tab.
3. Select a different device. (I hope you have multiple devices; if you don't, you may be able to create virtual ones using v4l2loopback or similar.)
4. guvcview-qt will ask if it should restart or launch a new process. Pick either choice.
5. It fails with the message (in stdout/stderr):

GUVCVIEW (Qt5): spawning new process (guvcview --device=/dev/video3) failed

Proposed solutions:

1. Make -qt version conflict with -gtk version.
2. Patch the -qt source-code to use a different binary name. Hopefully this is a constant defined somewhere and easy to change.
3. Send a patch upstream to extract the actual binary name from `argv[0]`. (Or from somewhere else, I just think `argv[0]` is the easiest place.)
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:18 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/guvcview/issues/1
Comment by Denilson Sá Maia (denilsonsa) - Friday, 30 June 2023, 08:01 GMT
Look at `MainWindow::devices_changed` function from https://sourceforge.net/p/guvcview/git-master/ci/master/tree/guvcview/gui_qt5_callbacks.cpp#l875
In the Qt version, it has a explicit string being passed to `process.startDetached("guvcview", args)`, at lines 903 and 922.

However, on the Gtk version, line 1148, it uses `g_get_prgname()`.
https://sourceforge.net/p/guvcview/git-master/ci/master/tree/guvcview/gui_gtk3_callbacks.c#l1148

Thus, it makes me believe the Gtk version is resilient against renaming the binary, but the Qt version breaks.
Comment by Denilson Sá Maia (denilsonsa) - Monday, 10 July 2023, 11:37 GMT
Bonus bug: the `guvcview-qt.desktop` is copied from the GTK version, and just the Exec entries are updated to add -qt. Unfortunately, the name still says "guvcview" (making it hard to see which version is which, in case both are installed), and the GenericName/X-GNOME-FullName still say "GTK", even tough it's launching the Qt version.

https://gitlab.archlinux.org/archlinux/packaging/packages/guvcview/-/blob/main/PKGBUILD#L68-70

Loading...