flathub / org.frescobaldi.Frescobaldi

https://flathub.org/apps/details/org.frescobaldi.Frescobaldi
1 stars 3 forks source link

Qt5 WebEngine error (for Documentation browser) #1

Closed fedelibre closed 3 years ago

fedelibre commented 3 years ago

Qt5 WebEngine module is built incorrectly because:

  1. Frescobaldi Documentation Browser cannot load the documentation from lilypond.org
  2. In the logs the following message is printed continuously:
LaunchProcess: failed to execvp:
/app/bin

I've verified that this does not occur if I build the flatpak without WebEngine module.

Short term workaround might be disabling this module. But I'd prefer fixing it.

Debugging

Enter the sandbox:

flatpak run --command=sh org.frescobaldi.Frescobaldi

Here's the culprit:

[📦 org.frescobaldi.Frescobaldi ~]$ QtWebEngineProcess 
LaunchProcess: failed to execvp:
/app/bin
QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function.
QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function.
QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QtWebEngine::initialize() in your main() function.
[3:8:1115/014847.661728:ERROR:browser_gpu_channel_host_factory.cc(138)] Failed to launch GPU process.

Now if I disable GPU in the module:

$ git diff
diff --git a/org.frescobaldi.Frescobaldi.yaml b/org.frescobaldi.Frescobaldi.yaml
index 443f144..b9a13e1 100644
--- a/org.frescobaldi.Frescobaldi.yaml
+++ b/org.frescobaldi.Frescobaldi.yaml
@@ -212,6 +212,7 @@ modules:
         QMAKE_INCDIR+=/app/include/QtWebEngine
         QMAKE_INCDIR+=/app/include/QtWebEngineCore
         QMAKE_INCDIR+=/app/include/QtWebEngineWidgets
+        QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu"
       - make -j $FLATPAK_BUILDER_N_JOBS
       - make install
     sources:

I get this error:

[📦 org.frescobaldi.Frescobaldi ~]$ QtWebEngineProcess 
LaunchProcess: failed to execvp:
/app/bin
[3:3:1115/020534.341004:FATAL:zygote_communication_linux.cc(260)] Cannot communicate with zygote
Rilevato trace/breakpoint (core dump creato)
fedelibre commented 3 years ago

I'm now testing the latest release (5.15.2) of PyQtWebEngine and I see different errors in the terminal.

When I launch Frescobaldi:

[2:2:1220/231455.045194:ERROR:network_service_instance_impl.cc(262)] Network service crashed, restarting service.
LaunchProcess: failed to execvp:
/app/bin

When I launch QtWebEngineProcess:

[📦 org.frescobaldi.Frescobaldi ~]$ QtWebEngineProcess 
LaunchProcess: failed to execvp:
/app/bin
LaunchProcess: failed to execvp:
/app/bin
[4:10:1220/231534.533016:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye.
Rilevato trace/breakpoint (core dump creato)

I'll try the --disable-gpu flag.

fedelibre commented 3 years ago

Here's what I get after building with --disable-gpu. See the qtwebengine-fix branch.

Note the two different messages:

[📦 org.frescobaldi.Frescobaldi ~]$ QtWebEngineProcess 
LaunchProcess: failed to execvp:
/app/bin
[3:3:1221/234651.580983:FATAL:zygote_communication_linux.cc(260)] Cannot communicate with zygote
Rilevato trace/breakpoint (core dump creato)
[📦 org.frescobaldi.Frescobaldi ~]$ 
[📦 org.frescobaldi.Frescobaldi ~]$ QtWebEngineProcess 
LaunchProcess: failed to execvp:
/app/bin
LaunchProcess: failed to execvp:
/app/bin
[22:28:1221/234715.009174:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye.
Rilevato trace/breakpoint (core dump creato)

I need some help.

aleixpol commented 3 years ago

Does passing --device=dri maybe help?

fedelibre commented 3 years ago

I've added it, but it doesn't help:

$ flatpak info --show-permissions org.frescobaldi.Frescobaldi
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=dri;all;
filesystems=home;xdg-config/kdeglobals:ro;

[Session Bus Policy]
com.canonical.AppMenu.Registrar=talk

[Environment]
QTWEBENGINEPROCESS_PATH=/app/bin
hfiguiere commented 3 years ago
[Environment]
QTWEBENGINEPROCESS_PATH=/app/bin

If you search QTWEBENGINEPROCESS_PATH in the flathub organisation on github you'll find that the two other occurences are as follow:

--env=QTWEBENGINEPROCESS_PATH=/app/bin/QtWebEngineProcess

Which given the error

LaunchProcess: failed to execvp:
/app/bin

make sense...

hfiguiere commented 3 years ago

Does passing --device=dri maybe help?

For the record --device=all includes dri.

fedelibre commented 3 years ago

For the record --device=all includes dri.

Are you sure? Then why Flatseal uses separate/indipendent items?

flatseal-permissions

hfiguiere commented 3 years ago

Back then, I did look at the flatpak source code to answer the question:

https://github.com/flatpak/flatpak/blob/b3321e91791ee09eb302cf27f6555b7c2e83e56b/common/flatpak-run.c#L1203

--device=all expose all the devices but shm.

Flatseal expose the options as they are available.

fedelibre commented 3 years ago

--env=QTWEBENGINEPROCESS_PATH=/app/bin/QtWebEngineProcess

Thank you @hfiguiere ! This fixes the problem. And --device=dri is not needed.

BTW, I cannot remember why I put --device=all. Perhaps to be able to open files from USB disks? I'll have to check if I can remove it.

hfiguiere commented 3 years ago

BTW, I cannot remember why I put --device=all. Perhaps to be able to open files from USB disks? I'll have to check if I can remove it.

You need this for MIDI and/or ALSA sound.

It won't help to open files from USB disks.