使用 gstreamer 启动 webrtc 管道时出现段错误
Segfault when starting webrtc pipeline using gstreamer
我正在尝试编译 gstreamer 1.14.4 以利用 webrtc 模块。我能够在我的 raspberry pi 上使用 cerbero 成功编译它,但是我有一个问题,在测试我的 webrtc 应用程序时,我在发送报价并且管道开始播放后收到段错误:
Thread 2 "gst-pc-ops" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x75595470 (LWP 19541)]
__GI___libc_free (mem=0xe59ff000) at malloc.c:2966
2966 malloc.c: No such file or directory.
(gdb) bt
#0 __GI___libc_free (mem=0xe59ff000) at malloc.c:2966
#1 0x7608867c in g_callable_info_free_closure (callable_info=<optimized out>,
closure=0x76ff0008) at girepository/girffi.c:426
#2 0x760db72c in ?? ()
from /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-arm-linux-gnueabihf.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
我似乎无法在我的 pi 上获得完整的回溯。
在 valgrind 中出现段错误时我得到以下信息:
==20539== Thread 2 gst-pc-ops:
==20539== Invalid read of size 8
==20539== at 0x4865DD0: ??? (in /usr/lib/arm-linux-gnueabihf/libarmmem.so)
==20539== Address 0x55ffab4 is 4 bytes inside a block of size 11 alloc'd
==20539== at 0x4847568: malloc (vg_replace_malloc.c:299)
==20539== by 0x63B4AEB: g_malloc (gmem.c:94)
==20539== by 0x63CF46B: g_strdup (gstrfuncs.c:363)
==20539== by 0x63341DF: g_signal_newv (gsignal.c:1644)
==20539== by 0x633534B: g_signal_new_valist (gsignal.c:1902)
==20539== by 0x63353C3: g_signal_new (gsignal.c:1437)
==20539== by 0xCE1B427: gst_srtp_enc_class_init (gstsrtpenc.c:330)
==20539== by 0xCE1B427: gst_srtp_enc_class_intern_init (gstsrtpenc.c:198)
==20539== by 0x633FF03: type_class_init_Wm (gtype.c:2232)
==20539== by 0x633FF03: g_type_class_ref (gtype.c:2947)
==20539== by 0x6324EBF: g_object_new_with_properties (gobject.c:1935)
==20539== by 0x63256DF: g_object_new (gobject.c:1637)
==20539== by 0x6CA134B: gst_element_factory_create (gstelementfactory.c:372)
==20539== by 0x6CA154F: gst_element_factory_make (gstelementfactory.c:445)
剪断....
==20539== Invalid free() / delete / delete[] / realloc()
==20539== at 0x4848B8C: free (vg_replace_malloc.c:530)
==20539== by 0x62E467B: g_callable_info_free_closure (girffi.c:426)
==20539== by 0x629A72B: ??? (in /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-arm-linux-gnueabihf.so)
==20539== Address 0xe59ff000 is not stack'd, malloc'd or (recently) free'd
==20539==
==20539==
==20539== Process terminating with default action of signal 6 (SIGABRT)
==20539== at 0x498E45C: raise (raise.c:51)
==20539== by 0x498F823: abort (abort.c:89)
==20539== by 0x64B31DF: ffi_closure_free (in /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.4)
==20539==
==20539== HEAP SUMMARY:
==20539== in use at exit: 12,292,940 bytes in 41,975 blocks
==20539== total heap usage: 102,319 allocs, 60,345 frees, 45,174,025 bytes allocated
==20539==
==20539== LEAK SUMMARY:
==20539== definitely lost: 1,368 bytes in 26 blocks
==20539== indirectly lost: 607 bytes in 15 blocks
==20539== possibly lost: 3,243,651 bytes in 137 blocks
==20539== still reachable: 8,839,230 bytes in 40,653 blocks
==20539== of which reachable via heuristic:
==20539== newarray : 1,332 bytes in 41 blocks
==20539== suppressed: 0 bytes in 0 blocks
==20539== Rerun with --leak-check=full to see details of leaked memory
==20539==
==20539== For counts of detected and suppressed errors, rerun with: -v
==20539== Use --track-origins=yes to see where uninitialised values come from
==20539== ERROR SUMMARY: 3027 errors from 213 contexts (suppressed: 147 from 16)
Aborted
我在我的 ubuntu x64 位机器上使用 cerbero 编译了它,它编译得很好,我能够 运行 应用程序没有问题。我不确定应该如何进行?
我将 ~/.cerbero/cerbero.cbc
设置为:
# For Linux
prefix='/opt/gstreamer'
recipes_commits = {
# 'ffmpeg' : '3.4.5',
# 'ffmpeg-static' : '3.4.5',
'gstreamer-1.0' : '1.14.4',
'gstreamer-1.0-static' : '1.14.4',
'gst-plugins-base-1.0' : '1.14.4',
'gst-plugins-base-1.0-static' : '1.14.4',
'gst-plugins-good-1.0' : '1.14.4',
'gst-plugins-good-1.0-static' : '1.14.4',
'gst-plugins-bad-1.0' : '1.14.4',
'gst-plugins-bad-1.0-static' : '1.14.4',
'gst-plugins-ugly-1.0' : '1.14.4',
'gst-plugins-ugly-1.0-static' : '1.14.4',
'gst-libav-1.0' : '1.14.4',
'gst-libav-1.0-static' : '1.14.4',
'gst-rtsp-server-1.0' : '1.14.4',
'gst-rtsp-server-1.0-static' : '1.14.4',
}
我使用以下方法拉取了 cerbero 1.14 分支:
git clone https://github.com/GStreamer/cerbero
cd cerbero
git checkout 1.14
cerbero bootstrap
cerbero package gstreamer-1.0
我已经在 .bashrc 中设置了我的路径变量:
alias cerbero='~/cerbero/cerbero-uninstalled'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gstreamer/lib
export PATH=/opt/gstreamer/bin:$PATH
export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-1.0/
export GI_TYPELIB_PATH=/opt/gstreamer/lib/girepository-1.0/
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages/
export PYTHONPATH=$PYTHONPATH:/opt/gstreamer/lib/
我还通过添加以下内容在 plugins-bad 中启用了自省:
--enable-introspection
到 cerbero 中的配方文件
这是我正在尝试的 运行:
https://github.com/centricular/gstwebrtc-demos
有没有人能够在 raspberry pi 上编译和使用 webrtc 模块?我该如何进一步调试?
我在 raspberry pi 3 b+ 运行ning raspbian 和 python 3.6
编辑:这已发布到 raspberry pi 堆栈交换。我没有足够的声誉来关闭它并将其移动到堆栈溢出。
我还通过禁用插件库中的 gl,使用最新主版本 (1.15) 的 cerbero 对其进行了编译。我仍然收到相同的错误。如果有人能指出我正确的方向,我就被困在这里了。
答案在这里:
你基本上必须删除 python3-gi
和 python3-gobject
包,然后通过 pip 安装它们。之后,您必须将系统 libffi
替换为您使用 cerbero 构建的系统。
我正在尝试编译 gstreamer 1.14.4 以利用 webrtc 模块。我能够在我的 raspberry pi 上使用 cerbero 成功编译它,但是我有一个问题,在测试我的 webrtc 应用程序时,我在发送报价并且管道开始播放后收到段错误:
Thread 2 "gst-pc-ops" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x75595470 (LWP 19541)]
__GI___libc_free (mem=0xe59ff000) at malloc.c:2966
2966 malloc.c: No such file or directory.
(gdb) bt
#0 __GI___libc_free (mem=0xe59ff000) at malloc.c:2966
#1 0x7608867c in g_callable_info_free_closure (callable_info=<optimized out>,
closure=0x76ff0008) at girepository/girffi.c:426
#2 0x760db72c in ?? ()
from /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-arm-linux-gnueabihf.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
我似乎无法在我的 pi 上获得完整的回溯。
在 valgrind 中出现段错误时我得到以下信息:
==20539== Thread 2 gst-pc-ops:
==20539== Invalid read of size 8
==20539== at 0x4865DD0: ??? (in /usr/lib/arm-linux-gnueabihf/libarmmem.so)
==20539== Address 0x55ffab4 is 4 bytes inside a block of size 11 alloc'd
==20539== at 0x4847568: malloc (vg_replace_malloc.c:299)
==20539== by 0x63B4AEB: g_malloc (gmem.c:94)
==20539== by 0x63CF46B: g_strdup (gstrfuncs.c:363)
==20539== by 0x63341DF: g_signal_newv (gsignal.c:1644)
==20539== by 0x633534B: g_signal_new_valist (gsignal.c:1902)
==20539== by 0x63353C3: g_signal_new (gsignal.c:1437)
==20539== by 0xCE1B427: gst_srtp_enc_class_init (gstsrtpenc.c:330)
==20539== by 0xCE1B427: gst_srtp_enc_class_intern_init (gstsrtpenc.c:198)
==20539== by 0x633FF03: type_class_init_Wm (gtype.c:2232)
==20539== by 0x633FF03: g_type_class_ref (gtype.c:2947)
==20539== by 0x6324EBF: g_object_new_with_properties (gobject.c:1935)
==20539== by 0x63256DF: g_object_new (gobject.c:1637)
==20539== by 0x6CA134B: gst_element_factory_create (gstelementfactory.c:372)
==20539== by 0x6CA154F: gst_element_factory_make (gstelementfactory.c:445)
剪断....
==20539== Invalid free() / delete / delete[] / realloc()
==20539== at 0x4848B8C: free (vg_replace_malloc.c:530)
==20539== by 0x62E467B: g_callable_info_free_closure (girffi.c:426)
==20539== by 0x629A72B: ??? (in /usr/lib/python3/dist-packages/gi/_gi.cpython-36m-arm-linux-gnueabihf.so)
==20539== Address 0xe59ff000 is not stack'd, malloc'd or (recently) free'd
==20539==
==20539==
==20539== Process terminating with default action of signal 6 (SIGABRT)
==20539== at 0x498E45C: raise (raise.c:51)
==20539== by 0x498F823: abort (abort.c:89)
==20539== by 0x64B31DF: ffi_closure_free (in /usr/lib/arm-linux-gnueabihf/libffi.so.6.0.4)
==20539==
==20539== HEAP SUMMARY:
==20539== in use at exit: 12,292,940 bytes in 41,975 blocks
==20539== total heap usage: 102,319 allocs, 60,345 frees, 45,174,025 bytes allocated
==20539==
==20539== LEAK SUMMARY:
==20539== definitely lost: 1,368 bytes in 26 blocks
==20539== indirectly lost: 607 bytes in 15 blocks
==20539== possibly lost: 3,243,651 bytes in 137 blocks
==20539== still reachable: 8,839,230 bytes in 40,653 blocks
==20539== of which reachable via heuristic:
==20539== newarray : 1,332 bytes in 41 blocks
==20539== suppressed: 0 bytes in 0 blocks
==20539== Rerun with --leak-check=full to see details of leaked memory
==20539==
==20539== For counts of detected and suppressed errors, rerun with: -v
==20539== Use --track-origins=yes to see where uninitialised values come from
==20539== ERROR SUMMARY: 3027 errors from 213 contexts (suppressed: 147 from 16)
Aborted
我在我的 ubuntu x64 位机器上使用 cerbero 编译了它,它编译得很好,我能够 运行 应用程序没有问题。我不确定应该如何进行?
我将 ~/.cerbero/cerbero.cbc
设置为:
# For Linux
prefix='/opt/gstreamer'
recipes_commits = {
# 'ffmpeg' : '3.4.5',
# 'ffmpeg-static' : '3.4.5',
'gstreamer-1.0' : '1.14.4',
'gstreamer-1.0-static' : '1.14.4',
'gst-plugins-base-1.0' : '1.14.4',
'gst-plugins-base-1.0-static' : '1.14.4',
'gst-plugins-good-1.0' : '1.14.4',
'gst-plugins-good-1.0-static' : '1.14.4',
'gst-plugins-bad-1.0' : '1.14.4',
'gst-plugins-bad-1.0-static' : '1.14.4',
'gst-plugins-ugly-1.0' : '1.14.4',
'gst-plugins-ugly-1.0-static' : '1.14.4',
'gst-libav-1.0' : '1.14.4',
'gst-libav-1.0-static' : '1.14.4',
'gst-rtsp-server-1.0' : '1.14.4',
'gst-rtsp-server-1.0-static' : '1.14.4',
}
我使用以下方法拉取了 cerbero 1.14 分支:
git clone https://github.com/GStreamer/cerbero
cd cerbero
git checkout 1.14
cerbero bootstrap
cerbero package gstreamer-1.0
我已经在 .bashrc 中设置了我的路径变量:
alias cerbero='~/cerbero/cerbero-uninstalled'
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gstreamer/lib
export PATH=/opt/gstreamer/bin:$PATH
export GST_PLUGIN_PATH=/opt/gstreamer/lib/gstreamer-1.0/
export GI_TYPELIB_PATH=/opt/gstreamer/lib/girepository-1.0/
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages/
export PYTHONPATH=$PYTHONPATH:/opt/gstreamer/lib/
我还通过添加以下内容在 plugins-bad 中启用了自省:
--enable-introspection
到 cerbero 中的配方文件 这是我正在尝试的 运行: https://github.com/centricular/gstwebrtc-demos
有没有人能够在 raspberry pi 上编译和使用 webrtc 模块?我该如何进一步调试?
我在 raspberry pi 3 b+ 运行ning raspbian 和 python 3.6
编辑:这已发布到 raspberry pi 堆栈交换。我没有足够的声誉来关闭它并将其移动到堆栈溢出。
我还通过禁用插件库中的 gl,使用最新主版本 (1.15) 的 cerbero 对其进行了编译。我仍然收到相同的错误。如果有人能指出我正确的方向,我就被困在这里了。
答案在这里:
你基本上必须删除 python3-gi
和 python3-gobject
包,然后通过 pip 安装它们。之后,您必须将系统 libffi
替换为您使用 cerbero 构建的系统。