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

Avidemux startup error, missing library (libADM_coreVideoCodec6.so) #239424

Closed
revuwa opened this issue Jun 23, 2023 · 8 comments · Fixed by #281173
Closed

Avidemux startup error, missing library (libADM_coreVideoCodec6.so) #239424

revuwa opened this issue Jun 23, 2023 · 8 comments · Fixed by #281173
Labels
0.kind: bug Something is broken

Comments

@revuwa
Copy link

revuwa commented Jun 23, 2023

Describe the bug

avidemux could not be started since a few days/weeks. (Worked well before).

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix-shell -p avidemux
  2. avidemux
  3. message: avidemux: error while loading shared libraries: libADM_coreVideoCodec6.so: cannot open shared object file: No such file or directory

Expected behavior

The application starts without any problems, as it does some days (and nixos-rebuild switch --upgrade) cycles before.

Additional context

I sadly have no idea, since when the error occurs exactly, and why. Because the package itself wasn't touched for a while:
https://github.com/NixOS/nixpkgs/commits/nixos-unstable/pkgs/applications/video/avidemux/default.nix
and it definitely worked with this last commit. So something other have to be changed, or it is just on my side. Hopefully someone could verify it the 'steps to reproduce' works for other people?

I searched for the missing library in the path where it seems to be missed:
"/nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1/bin/avidemux: error while loading shared libraries: libADM_coreVideoCodec6.so: cannot open shared object file: No such file or directory"
and found it two times:

  • /nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1/lib/libADM_coreVideoEncoder6.so (symlinked from lib64)
  • /nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1/lib64/libADM_coreVideoCodec6.so

Notify maintainers

@abbradar

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.3.8, NixOS, 23.11 (Tapir), 23.11pre496992.e603dc5f061`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.15.1`
 - channels(root): `"nixos"`
 - channels({user}): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Thanks in advance for any support ❤️

@revuwa revuwa added the 0.kind: bug Something is broken label Jun 23, 2023
@revuwa
Copy link
Author

revuwa commented Jun 24, 2023

Tried:
sudo nix store repair /nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1
to enforce rebuild the package, and after that by override an attribute inside my configuration.nix, which let avidemux recompile completely. With the same result/error.

Grateful for any hint.

@mgurlitz
Copy link

I used git bisect to identify #223861 as the possible breaking change, and as you noticed avidemux seems to be expecting the missing library in its lib64 directory.

I'm not sure how to fix the derivation, but setting LD_LIBRARY_PATH to /nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1/lib/ should work. For example: LD_LIBRARY_PATH=$(dirname $(readlink -f $(which avidemux)))/../lib/ avidemux

@revuwa
Copy link
Author

revuwa commented Jun 28, 2023

I used git bisect to identify #223861 as the possible breaking change, and as you noticed avidemux seems to be expecting the missing library in its lib64 directory.

I'm not sure how to fix the derivation, but setting LD_LIBRARY_PATH to /nix/store/4m7z30fmc4pkivr55ww84sjpqxy4gppi-avidemux-2.8.1/lib/ should work. For example: LD_LIBRARY_PATH=$(dirname $(readlink -f $(which avidemux)))/../lib/ avidemux

Thanks for looking into this. 💕
In my case which avidemux points to /run/current-system/sw/, and under its lib folder, the missing lib doesn't exists.

I tried setting the environment variable over my configuration.nix like this:

environment.variables = {
LD_LIBRARY_PATH = "${lib.getLib pkgs.avidemux}/lib";
};

Whith this result:

$ set | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH /nix/store/jdzg2ghp71gg07yn3cvwdp66fgc5z8pd-avidemux-2.8.1/lib

(Also tried: [...]-avidemux-2.8.1/lib/).

But still with the same result:
/nix/store/jdzg2ghp71gg07yn3cvwdp66fgc5z8pd-avidemux-2.8.1/bin/avidemux: error while loading shared libraries: libADM_coreVideoCodec6.so: cannot open shared object file: No such file or directory

Thanks again, it sounded promising. 🚀

@revuwa
Copy link
Author

revuwa commented Jul 1, 2023

Short summary, because in the meanwhile I know that other people have the same issue with unstable:
$ nix run nixpkgs#avidemux
/nix/store/jdzg2ghp71gg07yn3cvwdp66fgc5z8pd-avidemux-2.8.1/bin/avidemux: error while loading shared libraries: libADM_coreVideoCodec6.so: cannot open shared object file: No such file or directory

But stable (23.05) works like a charm:
$ nix run nixpkgs/nixos-23.05#avidemux

If someone is searching for a workaround...

@Pauan
Copy link
Contributor

Pauan commented Jul 9, 2023

@mgurlitz I can confirm that env LD_LIBRARY_PATH=$(dirname $(readlink -f $(which avidemux)))/../lib/ avidemux does work.

@mgurlitz
Copy link

I tried messing with patchelf and makeWrapper to fix the issue but wasn't able to. When I run strace on the broken avidemux, it looks for these .so files in many directories, but I was only able to control this search using LD_LIBRARY_PATH.

If you want to embed that workaround in an overlay for now, I ended up using this:

final: prev:
{
  avidemux = prev.avidemux.overrideAttrs (oldAttrs: {
    buildCommand = oldAttrs.buildCommand + ''
      mv $out/bin/avidemux $out/bin/avidemux3
      echo 'LD_LIBRARY_PATH=$(dirname $(readlink -f $(which avidemux3)))/../lib/ avidemux3 "$@"' >> $out/bin/avidemux
      chmod +x $out/bin/avidemux

      mv $out/bin/avidemux3_cli $out/bin/avidemux3_cli_old
      echo 'LD_LIBRARY_PATH=$(dirname $(readlink -f $(which avidemux3_cli)))/../lib/ avidemux3_cli_old "$@"' >> $out/bin/avidemux3_cli
      chmod +x $out/bin/avidemux3_cli
      '';
  });
}```

@revuwa
Copy link
Author

revuwa commented Jul 12, 2023

I'm so sorry for my #239424 (comment) whilte this seems to work, but I forgot that I've wrapped avidemux with firejail. 🙄

So the workarounds from #239424 (comment) and #239424 (comment) working for me, too (without firejail wrap).

For those who're interested in the firejail-wrap, the following works for me:

firejail = {
  enable = true;
  wrappedBinaries = {
    "avidemux" = {
      executable = "${lib.getBin pkgs.avidemux}/bin/avidemux";
      extraArgs = [ "--env=QT_QPA_PLATFORM=xcb" "--env=LD_LIBRARY_PATH=${lib.getLib pkgs.avidemux}/lib"]
    };
  };
};

Very big thanks to all of you 🥰

doronbehar added a commit to doronbehar/nixpkgs that referenced this issue Oct 24, 2023
@doronbehar
Copy link
Contributor

Marking it as broken at: #263171

jerith666 added a commit to jerith666/nixpkgs that referenced this issue Nov 5, 2023
jerith666 added a commit to jerith666/nixpkgs that referenced this issue Nov 5, 2023
by adding $out/lib to LD_LIBRARY_PATH, as suggested by @revuwa and
@mgurlitz in NixOS#239424

fixes NixOS#239424
jerith666 added a commit to jerith666/nixpkgs that referenced this issue Jan 14, 2024
by adding $out/lib to LD_LIBRARY_PATH, as suggested by @revuwa and
@mgurlitz in NixOS#239424

fixes NixOS#239424
@ghost ghost closed this as completed in #281173 Jan 16, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
4 participants