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

mediainfo and libmediainfo throwing segmentation fault on files #707

Open
juesor opened this issue Apr 12, 2023 · 15 comments
Open

mediainfo and libmediainfo throwing segmentation fault on files #707

juesor opened this issue Apr 12, 2023 · 15 comments

Comments

@juesor
Copy link

juesor commented Apr 12, 2023

mediainfo-23.03-1.el7.x86_64
libmediainfo-23.03-1.el7.x86_64

On 10.4.2023 I upgraded to the above versions and ever since when I would do a check on an mkv file it would throw segmentation fault.

mediainfo -full MyFile.mkv
Segmentation fault

Pulling that file down to my PC I can play just fine in VLC.

I had this installed via epel.

The fix for me was downloading the old RPM for both files.

libmediainfo-22.12-1.el7.x86_64.rpm
mediainfo-22.12.x86_64.CentOS_7.rpm

And installing those directly.

Anything you can think of?

@JeromeMartinez
Copy link
Member

This may have been fixed with another update, please test latest development snapshots.

@ptr727
Copy link

ptr727 commented Apr 14, 2023

I started creating Alpine docker images (normally use ubuntu) using the community packaged mediainfo.
Last night I noticed that some files, e.g. VC1, WMV, cause a segmentation fault, while most others work fine.

E.g.

$ mediainfo --version
MediaInfo Command line,
MediaInfoLib - v23.03
~ $ mediainfo --Output=XML "/media/VC1 - foo.mkv"
Segmentation fault

Related, or different?

@JeromeMartinez
Copy link
Member

@ptr727 I think it is related, so dev snapshot or wait for next release in few weeks.

@ptr727
Copy link

ptr727 commented Apr 14, 2023

Thank you.
I did not see Alpine binaries for the releases, is there a runtime compatible version I can try out on Alpine, or could you consider building for Alpine (very small docker images) ?

@JeromeMartinez
Copy link
Member

I did not see Alpine binaries for the releases,

We don't have Alpine binaries, you need to build from sources.
If you have a compiler installed, it is just download e.g. this file and launch the script at the root directory.

@ptr727
Copy link

ptr727 commented Apr 15, 2023

Ok thx, I'll give it a try.

@ptr727
Copy link

ptr727 commented Apr 15, 2023

If you have a compiler installed, it is just download e.g. this file and launch the script at the root directory.

Confirmed it works.

@bugwelle
Copy link

I can also confirm that the segfault is gone (tried on openSUSE Tumbleweed).

@ptr727
Copy link

ptr727 commented Jul 20, 2023

Looks like a similar problem is back with v23.07 on Alpine, segfault.

@JeromeMartinez
Copy link
Member

@ptr727 no known issue if latest ZenLib is used. Does compiling e.g. from this dev snapshot fail too?

@ptr727
Copy link

ptr727 commented Jul 21, 2023

I'll try it out, this crash is different, it segfaults on using just --version.

@ptr727
Copy link

ptr727 commented Jul 21, 2023

@JeromeMartinez Compiling from code works:

docker run -it --rm --pull always --name Testing mcr.microsoft.com/dotnet/sdk:7.0-alpine /bin/sh
apk update && apk add p7zip wget build-base
wget -O MediaInfo_CLI_GNU_FromSource.tar.bz2 https://mediaarea.net/download/snapshots/binary/mediainfo/20230715/MediaInfo_CLI_23.07.20230715_GNU_FromSource.tar.bz2
7z x -so MediaInfo_CLI_GNU_FromSource.tar.bz2 | tar xf -
cd MediaInfo_CLI_GNU_FromSource
./CLI_Compile.sh
./MediaInfo/Project/GNU/CLI/mediainfo --version
MediaInfo Command line,
MediaInfoLib - v23.07

@ptr727
Copy link

ptr727 commented Jul 21, 2023

SegFault repro:

docker run -it --rm --pull always --name Testing mcr.microsoft.com/dotnet/sdk:7.0-alpine /bin/sh

apk update
apk add mediainfo --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/
mediainfo --version
Segmentation fault
apk add gdb
ldd /usr/bin/mediainfo
        /lib/ld-musl-x86_64.so.1 (0x7ffbb712c000)
        libmediainfo.so.0 => /usr/lib/libmediainfo.so.0 (0x7ffbb6a9d000)
        libzen.so.0 => /usr/lib/libzen.so.0 (0x7ffbb6a6b000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7ffbb681d000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7ffbb67ff000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7ffbb712c000)
        libcurl.so.4 => /usr/lib/libcurl.so.4 (0x7ffbb677a000)
        libtinyxml2.so.9 => /usr/lib/libtinyxml2.so.9 (0x7ffbb6765000)
        libz.so.1 => /lib/libz.so.1 (0x7ffbb674b000)
        libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x7ffbb6727000)
        libidn2.so.0 => /usr/lib/libidn2.so.0 (0x7ffbb66f5000)
        libssl.so.3 => /lib/libssl.so.3 (0x7ffbb666f000)
        libcrypto.so.3 => /lib/libcrypto.so.3 (0x7ffbb625c000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x7ffbb624e000)
        libunistring.so.5 => /usr/lib/libunistring.so.5 (0x7ffbb60a8000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x7ffbb6085000)
/ # gdb /usr/bin/mediainfo
GNU gdb (GDB) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/mediainfo...
(No debugging symbols found in /usr/bin/mediainfo)
(gdb) run --version
Starting program: /usr/bin/mediainfo --version
warning: Error disabling address space randomization: Operation not permitted

Program received signal SIGSEGV, Segmentation fault.
0x00007f5ad82a011a in std::basic_ostream<char, std::char_traits<char> >::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from /usr/lib/libstdc++.so.6

@ptr727
Copy link

ptr727 commented Sep 20, 2023

An update and closing out; installing mediainfo from Alpine Edge repo on Alpine 3.18 results in a segfault, looks like a C++ library mismatch of some kind, installing from latest-stable on 3.18 works, but is then out of date.

A statically linked version on Alpine may have greater compatibility, and / or making sure that all binary interfaces remain library version compatible.

@ptr727
Copy link

ptr727 commented Dec 8, 2023

Segfault is back in 23.07 on Alpine :(
https://pkgs.alpinelinux.org/package/v3.18/community/x86_64/mediainfo

Update:
And same issue as before, mismatch in .NET MCR image Alpine versions and package, pinning versions resolves issue.
A statically linked version of mediainfo on Alpine could prevent issues like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants