Segmentation Fault when using cerbero built Gstreamer
Hello all,
First off thank you all for this project. It's been very helpful to me. I've been using it successfully with the distributed gstreamer application (installed via apt) and things have been working really well. However, I'm trying to use the latest Gstreamer code base (not yet distributed) but it's segfaulting when I attempt to import the lib in python.
You can reproduce this with the following Dockerfile
:
FROM ubuntu:22.04
RUN apt-get upgrade && \
apt-get update && \
apt-get install -y \
cmake \
curl \
flex \
g++ \
git \
libssl-dev \
openjdk-8-jdk \
python3 \
python3-distro \
python3-pip \
python3-setuptools \
python3-wheel \
pkg-config \
vim \
wget
RUN git config --global user.email "cerbero@gstreamer.freedesktop.org"
RUN git config --global user.name "Cerbero Build System"
# FIXME: might cause problems if the image is used outside CI
# https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765
RUN git config --global --replace-all safe.directory '*'
WORKDIR /opt/
# # build gstreamer 1.0 from cerbero source
RUN git clone https://gitlab.freedesktop.org/gstreamer/cerbero
RUN apt-get update && \
cd cerbero && \
./cerbero-uninstalled bootstrap -y \
&& ./cerbero-uninstalled package gstreamer-1.0
WORKDIR /opt/cerbero
RUN echo "time to run gst"
RUN . "/opt/cerbero/build/dist/linux_x86_64/share/gstreamer/gst-env" && python3 -c "from gi.repository import Gst"
You'll see this is just a basic installation with no fancy plugins or configuration done. However, the import segfaults. I'm not sure the best way you all like stacktraces pulled but using gdb
, I can pull the following:
root@ad22006a4c0b:/opt# python3 test.py
Segmentation fault
root@ad22006a4c0b:/opt# gdb python3
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 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-linux-gnu".
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 python3...
(No debugging symbols found in python3)
(gdb)
(gdb) run test.py
Starting program: /usr/bin/python3 test.py
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) backtrace
#0 0x0000000000000000 in ?? ()
#1 0x00007ff86abc1e2e in ?? () from /lib/x86_64-linux-gnu/libffi.so.8
#2 0x00007ff86abbe493 in ?? () from /lib/x86_64-linux-gnu/libffi.so.8
#3 0x00007ff86adcf722 in ?? () from /usr/lib/python3/dist-packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
#4 0x00007ff86adcd826 in ?? () from /usr/lib/python3/dist-packages/gi/_gi.cpython-310-x86_64-linux-gnu.so
#5 0x0000561ab9c1930b in _PyObject_MakeTpCall ()
#6 0x0000561ab9c11c67 in _PyEval_EvalFrameDefault ()
#7 0x0000561ab9c07cc6 in ?? ()
#8 0x0000561ab9cfceb6 in PyEval_EvalCode ()
#9 0x0000561ab9d024bd in ?? ()
#10 0x0000561ab9c23219 in ?? ()
#11 0x0000561ab9c0d8c4 in _PyEval_EvalFrameDefault ()
#12 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#13 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#14 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#15 0x0000561ab9c0b5c9 in _PyEval_EvalFrameDefault ()
#16 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#17 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#18 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#19 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#20 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#21 0x0000561ab9c22429 in ?? ()
#22 0x0000561ab9c385af in _PyObject_CallMethodIdObjArgs ()
#23 0x0000561ab9c36bcd in PyImport_ImportModuleLevelObject ()
#24 0x0000561ab9c46b58 in ?? ()
#25 0x0000561ab9c2276e in ?? ()
#26 0x0000561ab9c312fb in PyObject_Call ()
#27 0x0000561ab9c0d8c4 in _PyEval_EvalFrameDefault ()
#28 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#29 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#30 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#31 0x0000561ab9c22429 in ?? ()
#32 0x0000561ab9c385af in _PyObject_CallMethodIdObjArgs ()
#33 0x0000561ab9c37321 in PyImport_ImportModuleLevelObject ()
#34 0x0000561ab9c0e036 in _PyEval_EvalFrameDefault ()
#35 0x0000561ab9c07cc6 in ?? ()
#36 0x0000561ab9cfceb6 in PyEval_EvalCode ()
#37 0x0000561ab9d024bd in ?? ()
#38 0x0000561ab9c23219 in ?? ()
#39 0x0000561ab9c0d8c4 in _PyEval_EvalFrameDefault ()
#40 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#41 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#42 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#43 0x0000561ab9c0b5c9 in _PyEval_EvalFrameDefault ()
#44 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#45 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#46 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#47 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#48 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#49 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#50 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#51 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#52 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#53 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#54 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#55 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#56 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#57 0x0000561ab9c0b5c9 in _PyEval_EvalFrameDefault ()
#58 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#59 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#60 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#61 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#62 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#63 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#64 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#65 0x0000561ab9c0b483 in _PyEval_EvalFrameDefault ()
#66 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#67 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#68 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#69 0x0000561ab9c1125a in _PyEval_EvalFrameDefault ()
#70 0x0000561ab9c22fbc in _PyFunction_Vectorcall ()
#71 0x0000561ab9c0b5c9 in _PyEval_EvalFrameDefault ()
Would be interested in what anybody thinks. Happy to provide more detail if needed. Thanks!