Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest nightly Flatpak builds fail with "Broken pipe" error #5893

Open
penyuan opened this issue Mar 26, 2024 · 14 comments
Open

Latest nightly Flatpak builds fail with "Broken pipe" error #5893

penyuan opened this issue Mar 26, 2024 · 14 comments
Labels

Comments

@penyuan
Copy link

penyuan commented Mar 26, 2024

Problem Description

I've been successfully running the nightly Flatpak Linux builds on Rocky Linux 9.3 (Linux kernel 5.14 and GNOME 40.4.0) for a while with no problems. I install with with this command:

flatpak install fr.handbrake.ghb-20240323140926-e337e98de-master-x86_64.flatpak

However, since approximately last week, the builds fail to start at all.

For example, I just installed fr.handbrake.ghb-20240323140926-e337e98de-master-x86_64.flatpak nightly build from March 25, 2024. If I start this Handbrake build from GNOME, I see the GUI briefly flash before my eyes and disappear.

I also try to start from the commandline with this command:

flatpak run fr.handbrake.ghb

I then get an error message saying:

** (process:50180): WARNING **: 13:17:46.800: Error writing credentials to socket: Error sending message: Broken pipe

I have no idea what this error means.

Can anyone provide some guidance on how I may troubleshoot this? Thank you!

P.S. The same thing happens on my Fedora 39 system.

Activity Log, Crash Log or any other details

Here is the full contents of `Activity.log.2`: 


HandBrake 20240323140926-e337e98de-master (2024032501)
OS: GNOME 45 (Flatpak runtime)
Kernel: Linux 5.14.0-362.24.1.el9_3.x86_64 (x86_64)
CPU: AMD Ryzen 7 3700X 8-Core Processor x 16
Install Dir: /app/bin
Config Dir:  /home/[username]/.var/app/fr.handbrake.ghb/config/ghb
_______________________________

[13:17:46] Compile-time hardening features are enabled
Cannot load libnvidia-encode.so.1
[13:17:46] qsv: not available on this system
[13:17:46] hb_init: starting libhb thread
[13:17:46] hb_init: starting libhb thread
[13:17:46] hb_init: starting libhb thread

(fr.handbrake.ghb:2): Gtk-WARNING **: 13:17:46.766: GtkGrid 0x563a525f82a0 (grid) reported min width 251 and natural width 248 in measure() with for_size=-1; natural size must be >= min size

There is also an empty ghb.pid.2 file.



### What Operating System are you running?

Rocky Linux 9.3

### What version of HandBrake are you running?

Nightly 957a304

### Where did you download HandBrake from?

https://github.com/HandBrake/handbrake-snapshots/releases/tag/lin
@jstebbins
Copy link
Contributor

From what I can find, this error

** (process:50180): WARNING **: 13:17:46.800: Error writing credentials to socket: Error sending message: Broken pipe

indicates that the app is attempting to access gnome-keyring-daemon and it's not present.

I have no idea why HandBrake would be doing this. Perhaps it's something embedded in libgtk4 (which we just upgraded to).

Could you confirm if gnome-keyring-daemon is installed and running (it would normally start automatically on boot). If not, could you try installing it to see if the problem goes away?

@penyuan
Copy link
Author

penyuan commented Mar 27, 2024

Thanks for the quick response @jstebbins!

I checked, and see that gnome-keyring-daemon is installed and running on my system, and the problem still exists.

Anything else I can try??

@robxnano
Copy link
Contributor

I think the application is probably crashing, but the error message isn't shown due to Flatpak. If you run flatpak run --command=sh fr.handbrake.ghb followed by ghb, do you get something like Segmentation fault (core dumped)? If so I'll look into it but I'll probably need more information.

@penyuan
Copy link
Author

penyuan commented Mar 28, 2024

If you run flatpak run --command=sh fr.handbrake.ghb followed by ghb, do you get something like Segmentation fault (core dumped)?

@robxnano Yes, that's exactly the error I get! What should I do next??

@robxnano
Copy link
Contributor

I can't reproduce the crash on my end, so what I'd really need is a backtrace with debug symbols, but unfortunately the nightly builds don't include them. Would you be able to build the Flatpak yourself? I've just added a rule for creating the debug package, so it should just be a case of installing the right packages and running a few commands. Then you would just have to run HandBrake under the debugger and copy the backtrace information. If you're okay with that I'll give you the instructions, otherwise I'll try and find another solution.

@penyuan
Copy link
Author

penyuan commented Mar 29, 2024

Thanks @robxnano, I only have experience building code with the ./configure; make; make install commands, and zero experience building Flatpaks.

However, if you can give me specific instructions, I'm happy to give it a try.

@robxnano
Copy link
Contributor

Okay, here are the instructions. I tested them on a Rocky Linux VM but they should also work on Fedora. Just enter the commands below in a terminal, and press Y or Enter at all the confirmation prompts.

Enable optional repositories (Not needed on Fedora):

sudo dnf config-manager --set-enabled crb

Install prerequisites:

sudo dnf install autoconf automake bzip2 cmake flatpak flatpak-builder gcc-c++ git libtool m4 make meson ninja-build nasm numactl-devel patch pkgconf tar
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install org.gnome.Sdk//45 org.gnome.Platform//45 org.freedesktop.Sdk.Extension.llvm16//23.08

Clone the repository and build:

git clone https://github.com/HandBrake/HandBrake
cd HandBrake
./configure --enable-qsv --enable-nvenc --enable-nvdec --flatpak
cd build
make pkg.create.gui.debug.flatpak

Install the Flatpak bundles:

cd pkg/flatpak
flatpak install fr.handbrake.ghb-*.flatpak
flatpak install fr.handbrake.ghb.Debug-*.flatpak

Once you've done this, you should be ready to debug.

flatpak run --devel --command=sh fr.handbrake.ghb//development

You should now be in a terminal in the Flatpak environment, with a prompt that says [📦 fr.handbrake.ghb ~].

gdb ghb

You will now see a prompt that says (gdb). Enter:

run

Press Enter again and HandBrake will run. When it reaches the point where the crash occurs, it will freeze and the (gdb) prompt in the terminal will appear again.

backtrace -full

Press Enter again until you can see the full backtrace. Then copy the whole thing and post it here. When you've finished, enter quit and press Y, then type exit and press Enter to leave the Flatpak environment.

@penyuan
Copy link
Author

penyuan commented Mar 29, 2024

Wow thanks for the detailed instructions @robxnano! I copied and pasted the commands exactly into my terminal, and reached the point when the crash occurs. This time, I see a prompt asking if I want to force quite Handbrake or keep waiting:

handbrake crash

I can see in my terminal that the (gdb) prompt has already reappeared, so I entered backtrace -full, which only showed this really short output:

#0  0x00007ffff6375ab8 in __strcspn_sse42 ()
at /usr/lib/x86_64-linux-gnu/libc.so.6`

Is this information helpful????

@robxnano
Copy link
Contributor

Thanks, although I was hoping for a bit more information to go on. But nevertheless, it might just be enough, as there are only two direct uses of strcspn in HandBrake. This one looks to be the most likely culprit.
Do you have {codec} in your auto-naming template by any chance? You can check by opening ~/.var/app/fr.handbrake.ghb/config/ghb/preferences.json and looking for "auto_name_template".

@penyuan
Copy link
Author

penyuan commented Mar 29, 2024

@robxnano: Yes! My preferences.json has this line:

"auto_name_template": "{source}-{codec}-{quality}"

I tried removing {codec} from that line but Handbrake still crashes...

Anything else I can try?

@robxnano
Copy link
Contributor

Could you try debugging again without {codec} to see if there's a different error? If that was the problem it could be crashing in a different place.

@penyuan
Copy link
Author

penyuan commented Mar 29, 2024

Could you try debugging again without {codec} to see if there's a different error? If that was the problem it could be crashing in a different place.

Thanks. I tried removing only {codec} from that line in preferences.json, or removing the entire auto_name_template altogether. In both cases, when I run the debug command, I see the Handbrake GUI with the "not responding" error (see screenshot above).

However, now when I force quit, my terminal window shows:

...
[Thread 0x7fffe9ffb6c0 (LWP 31) exited]
[Thread 0x7fffea7fc6c0 (LWP 30) exited]
[Thread 0x7fffeaffd6c0 (LWP 29) exited]
[Thread 0x7ffff1dfd6c0 (LWP 27) exited]
[Thread 0x7ffff25fe6c0 (LWP 26) exited]
[Thread 0x7fffebfff6c0 (LWP 25) exited]
[Thread 0x7ffff2dff6c0 (LWP 24) exited]
[Thread 0x7ffff54899c0 (LWP 21) exited]
[Thread 0x7fffa69fb6c0 (LWP 52) exited]
[New process 21]

Program terminated with signal SIGKILL, Killed.
The program no longer exists.

And now when I run backtrace -full, I only get No stack. (there's no mention of "segmentation fault" like before...)

Did I do something wrong when debugging???

@robxnano
Copy link
Contributor

No, you've been a great help. One last thing you could try is to move the ~/.var/app/fr.handbrake.ghb folder to a different location in order to see if the crash still happens without any modified settings or presets.

@penyuan
Copy link
Author

penyuan commented Mar 31, 2024

@robxnano Thanks. I tried moving ~/.var/app/fr.handbrake.ghb away as you suggested, and the problem persists. I still get to the same place as the screenshot above.

Anything else to try?

@sr55 sr55 added the LinuxUI label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants