jangler / taffy

Command-line audio tagging tool
MIT License
34 stars 3 forks source link

Crash under Arch Linux #10

Open nguillaumin opened 4 months ago

nguillaumin commented 4 months ago

Hi, I am getting this crash when running Taffy on Arch Linux:

$ taffy --rename-fs "% T - % N" */*.ogg
<internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': /usr/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/taglib-ruby-1.1.3/taglib_base.so: undefined symbol: _ZN6TagLib7FileRef6createEPKcbNS_15AudioProperties9ReadStyleE - /usr/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/taglib-ruby-1.1.3/taglib_base.so (LoadError)
        from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.0.0/gems/taglib-ruby-1.1.3/lib/taglib/base.rb:3:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.0.0/gems/taglib-ruby-1.1.3/lib/taglib.rb:10:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.0.0/gems/taffy-1.4.2/bin/taffy:6:in `<top (required)>'
        from /usr/bin/taffy:25:in `load'
        from /usr/bin/taffy:25:in `<main>'

Not sure what to make of it?

jangler commented 4 months ago

Looks like the issue is coming from taglib-ruby. Maybe a packaging issue? I haven't used Ruby or Arch in a long time so I'm not set up to test it myself.

nguillaumin commented 4 months ago

I guess it could be a compatibility issue with TagLib 2: https://github.com/robinst/taglib-ruby/issues/127

It seems Arch packages both v1 and v2:

$ pacman -Q |grep taglib
ruby-taglib-ruby 1.1.3-3
ruby-taglib-ruby-debug 1.1.3-3
taglib 2.0-1
taglib1 1.13.1-2

However I'm not sure how I could force Taffy to use v1. v2 libs are in /usr/lib/ whereas v1 libs are in a sub-folder /usr/lib/taglib1. Do you know of any Ruby magic to force it to load the library from this sub-folder?

jangler commented 4 months ago

I looked into it briefly, but no. I actually don't understand why it's not using v1 already, since the ruby-taglib-ruby pkgbuild seems to specifically install against v1.

q234rty commented 2 months ago

Can't repro, could you try rebuilding ruby-taglib-ruby? If you are using paru or yay you can just run paru -Sa --rebuild ruby-taglib-ruby or yay -Sa --rebuild ruby-taglib-ruby. Also next time please leave a comment on the AUR as well so I get notified :)

nguillaumin commented 2 months ago

Same, unfortunately.

When I run ldd on taglib-ruby I get this:

$ ldd /usr/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/taglib-ruby-1.1.3/taglib_base.so 
        linux-vdso.so.1 (0x000077dac326e000)
        libruby.so.3.0 => /usr/lib/libruby.so.3.0 (0x000077dac2e00000)
        libtag.so.2 => /usr/lib/libtag.so.2 (0x000077dac2ce3000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x000077dac2a00000)
        libc.so.6 => /usr/lib/libc.so.6 (0x000077dac2814000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x000077dac31f4000)
        libz.so.1 => /usr/lib/libz.so.1 (0x000077dac31db000)
        libgmp.so.10 => /usr/lib/libgmp.so.10 (0x000077dac276e000)
        libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x000077dac31a7000)
        libm.so.6 => /usr/lib/libm.so.6 (0x000077dac2683000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x000077dac3270000)

/usr/lib/libtag.so.2 is TagLib v2 I think, so it looks like it's linking the wrong one?

q234rty commented 2 months ago

On my system it links to /usr/lib/libtag.so.1. As a first step, could you try installing extra/devtools, then git clone https://aur.archlinux.org/ruby-taglib-ruby.git, run extra-x86_64-build in the cloned directory then installing the resulting package with pacman -U ?

nguillaumin commented 2 months ago

Thanks, I didn't know about building packages in a chroot. I did it, and it linked to TagLib v1 this time:

$ ldd /usr/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/taglib-ruby-1.1.3/taglib_base.so 
        linux-vdso.so.1 (0x00007978f3846000)                                                    
        libruby.so.3.0 => /usr/lib/libruby.so.3.0 (0x00007978f3400000)
        libtag.so.1 => /usr/lib/libtag.so.1 (0x00007978f3306000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007978f3000000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007978f2e14000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007978f37cb000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007978f37b2000)
        libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007978f2d6e000)
        libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x00007978f32d4000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007978f2c83000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007978f3848000)

...and then Taffy works.

How to explain it's linking to the wrong library outside of the chroot?

q234rty commented 2 months ago

I can indeed repro this outside a chroot (I didn't repro because my paru was configured to build packages in chroot).

How to explain it's linking to the wrong library outside of the chroot?

I have no idea since I don't really understand how this mkmf thing works... Anyway, I pushed a workaround to the AUR for now, could you give it a try?

nguillaumin commented 2 months ago

Thanks, yes it works with the workaround!