rtmp2sink crash on Android arm 32 - cerbero 1.20.2.0
This issue is an update of #1470 (closed)
Backtraces are generated using android-ndk-r21/prebuilt/android-arm/gdbserver/gdbserver
.
Backtraces are stable (the same contents from run to run).
With G_SLICE=always-malloc
On target:
# G_SLICE=always-malloc \
> gdbserver 192.168.1.65:22345 \
> gst-launch-1.0 \
> videotestsrc ! x264enc ! flvmux ! rtmp2sink location=rtmp://192.168.1.51:1935/live/test
Process gst-launch-1.0 created; pid = 3561
Listening on port 22345
Remote debugging from host 192.168.1.65, port 52754
Detaching from process 3568
(gst-launch-1.0:3561): GStreamer-WARNING **: 14:05:29.225: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.
(gst-launch-1.0:3561): GStreamer-WARNING **: 14:07:59.035: Failed to load plugin '/data/local/kast-android-armv7-1.0-runtime/lib/gstreamer-1.0/libgstopensles.so': dlopen failed: cannot locate symbol "vorbis_info_init" referenced by "/system/lib/libstagefright.so"...
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
(gst-launch-1.0:3561): GStreamer-CRITICAL **: 14:08:58.164: gst_caps_is_equal: assertion 'GST_IS_CAPS (caps1)' failed
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
On host:
$ gdb
GNU gdb (Gentoo 11.2 vanilla) 11.2
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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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".
(gdb) target remote 192.168.1.67:22345
Remote debugging using 192.168.1.67:22345
Reading /data/local/kast-android-armv7-1.0-runtime/bin/gst-launch-1.0 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /data/local/kast-android-armv7-1.0-runtime/bin/gst-launch-1.0 from remote target...
Reading symbols from target:/data/local/kast-android-armv7-1.0-runtime/bin/gst-launch-1.0...
Reading /system/bin/linker from remote target...
Reading /system/bin/linker from remote target...
Reading symbols from target:/system/bin/linker...
Reading /system/bin/.debug/linker from remote target...
Reading /usr/lib/debug//system/bin/linker from remote target...
Reading /usr/lib/debug/system/bin//linker from remote target...
Reading target:/usr/lib/debug/system/bin//linker from remote target...
(No debugging symbols found in target:/system/bin/linker)
0xb6f9977c in __dl__start () from target:/system/bin/linker
(gdb) continue
Continuing.
Reading /data/local/kast-android-armv7-1.0-runtime/lib/libc++_shared.so from remote target...
Reading /data/local/kast-android-armv7-1.0-runtime/lib/libgstreamer-1.0.so from remote target...
... cut .....
Thread 2 "task0" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3561.3569]
0xb6a408aa in _gst_buffer_free (buffer=0xb1fc6c00) at ../gst/gstbuffer.c:785
785 ../gst/gstbuffer.c: No such file or directory.
(gdb) bt
#0 0xb6a408aa in _gst_buffer_free (buffer=0xb1fc6c00) at ../gst/gstbuffer.c:785
#1 0xb6a7b4b6 in gst_mini_object_unref (mini_object=0xb1fc6c00) at ../gst/gstminiobject.c:684
#2 0xb6a7b9f8 in gst_mini_object_replace (olddata=0xafb6b4f0, newdata=0x0) at ../gst/gstminiobject.c:754
#3 0xb48eba96 in gst_buffer_replace (obuf=0xafb6b4f0, nbuf=0x0) at /cerbero/build/dist/android_armv7/include/gstreamer-1.0/gst/gstbuffer.h:577
#4 0xb48e9572 in chunk_stream_clear (cstream=0xafb6b4f0) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:101
#5 0xb48eac38 in gst_rtmp_chunk_stream_serialize_start (cstream=0xafb6b4f0, buffer=0xb1fc6fc0, chunk_size=128) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:645
#6 0xb48eb78a in gst_rtmp_chunk_stream_serialize_all (cstream=0xafb6b4f0, buffer=0xb1fc6fc0, chunk_size=128) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:675
#7 0xb48f1f32 in gst_rtmp_connection_start_write (self=0xb166e180) at ../gst/rtmp2/rtmp/rtmpconnection.c:554
#8 0xb48f24a8 in gst_rtmp_connection_write_buffer_done (obj=0xb1a1d588, result=0xafb71300, user_data=0xb166e180) at ../gst/rtmp2/rtmp/rtmpconnection.c:630
#9 0xb59240c2 in g_task_return_now (task=0xafb71300) at ../gio/gtask.c:1212
#10 0xb5922cec in g_task_return (task=0xafb71300, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#11 0xb592339c in g_task_return_boolean (task=0xafb71300, result=1) at ../gio/gtask.c:1801
#12 0xb48f4d54 in write_all_buffer_done (source=0xb1a1d588, result=0xafb71080, user_data=0xafb71300) at ../gst/rtmp2/rtmp/rtmputils.c:237
#13 0xb59240c2 in g_task_return_now (task=0xafb71080) at ../gio/gtask.c:1212
#14 0xb5922cec in g_task_return (task=0xafb71080, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#15 0xb592339c in g_task_return_boolean (task=0xafb71080, result=1) at ../gio/gtask.c:1801
#16 0xb58ff588 in write_all_callback (stream=0xb1a1d588, result=0xafb71100, user_data=0xafb71080) at ../gio/goutputstream.c:1138
#17 0xb59240c2 in g_task_return_now (task=0xafb71100) at ../gio/gtask.c:1212
#18 0xb5922cec in g_task_return (task=0xafb71100, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#19 0xb59231dc in g_task_return_int (task=0xafb71100, result=62) at ../gio/gtask.c:1746
#20 0xb58fefe8 in async_ready_write_callback_wrapper (source_object=0xb1a1d588, res=0xafb71200, user_data=0xafb71100) at ../gio/goutputstream.c:967
#21 0xb59240c2 in g_task_return_now (task=0xafb71200) at ../gio/gtask.c:1212
#22 0xb5924102 in complete_in_idle_cb (task=0xafb71200) at ../gio/gtask.c:1226
#23 0xb6caff70 in g_idle_dispatch (source=0xb23a3160, callback=0xb59240f5 <complete_in_idle_cb>, user_data=0xafb71200) at ../glib/gmain.c:5784
#24 0xb6cb31b0 in g_main_dispatch (context=0xb1a04000) at ../glib/gmain.c:3299
#25 0xb6cb3068 in g_main_context_dispatch (context=0xb1a04000) at ../glib/gmain.c:4011
#26 0xb6cb3444 in g_main_context_iterate (context=0xb1a04000, block=1, dispatch=1, self=0xb1fab100) at ../glib/gmain.c:4084
#27 0xb6cb3838 in g_main_loop_run (loop=0xb1a15010) at ../glib/gmain.c:4278
#28 0xb48e3676 in gst_rtmp2_sink_task_func (user_data=0xb468af58) at ../gst/rtmp2/gstrtmp2sink.c:986
#29 0xb6abe8a0 in gst_task_func (task=0xb1fc6868) at ../gst/gsttask.c:384
#30 0xb6abf4a6 in default_func (tdata=0xb1ffe300, pool=0xb1ff2740) at ../gst/gsttaskpool.c:70
#31 0xb6c91058 in g_thread_pool_thread_proxy (data=0xb68bea48) at ../glib/gthreadpool.c:308
#32 0xb6c8ffea in g_thread_proxy (data=0xb1fab100) at ../glib/gthread.c:805
#33 0xb6bceef4 in __pthread_start(void*) () from target:/system/lib/libc.so
#34 0xb6ba1cbe in __start_thread () from target:/system/lib/libc.so
#35 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit
Without G_SLICE=always-malloc
On target:
# gdbserver 192.168.1.65:22345 \
> gst-launch-1.0 \
> videotestsrc ! x264enc ! flvmux ! rtmp2sink location=rtmp://192.168.1.51:1935/live/test
Process gst-launch-1.0 created; pid = 3520
Listening on port 22345
Remote debugging from host 192.168.1.65, port 52752
Detaching from process 3527
(gst-launch-1.0:3520): GStreamer-WARNING **: 13:44:58.343: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.
(gst-launch-1.0:3520): GStreamer-WARNING **: 13:47:22.052: Failed to load plugin '/data/local/kast-android-armv7-1.0-runtime/lib/gstreamer-1.0/libgstopensles.so': dlopen failed: cannot locate symbol "vorbis_info_init" referenced by "/system/lib/libstagefright.so"...
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
On host:
... cut ....
Thread 2 "task0" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 3520.3529]
0xb6d48ca0 in magazine_chain_pop_head (magazine_chunks=0xb1aff1e8) at ../glib/gslice.c:578
578 ../glib/gslice.c: No such file or directory.
(gdb) bt
#0 0xb6d48ca0 in magazine_chain_pop_head (magazine_chunks=0xb1aff1e8) at ../glib/gslice.c:578
#1 0xb6d48cfc in magazine_chain_prepare_fields (magazine_chunks=0x0) at ../glib/gslice.c:661
#2 0xb6d48c06 in magazine_cache_push_magazine (ix=4, magazine_chunks=0xb19a0ef0, count=40) at ../glib/gslice.c:734
#3 0xb6d482a4 in thread_memory_magazine2_unload (tmem=0xb1984000, ix=4) at ../glib/gslice.c:852
#4 0xb6d480ae in g_slice_free1 (mem_size=40, mem_block=0xb19ca028) at ../glib/gslice.c:1161
#5 0xb6ac98de in _gst_buffer_free (buffer=0xb1986950) at ../gst/gstbuffer.c:793
#6 0xb6b044b6 in gst_mini_object_unref (mini_object=0xb1986950) at ../gst/gstminiobject.c:684
#7 0xb6b049f8 in gst_mini_object_replace (olddata=0xb1994600, newdata=0x0) at ../gst/gstminiobject.c:754
#8 0xb48e9a96 in gst_buffer_replace (obuf=0xb1994600, nbuf=0x0) at /cerbero/build/dist/android_armv7/include/gstreamer-1.0/gst/gstbuffer.h:577
#9 0xb48e7572 in chunk_stream_clear (cstream=0xb1994600) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:101
#10 0xb48e8c38 in gst_rtmp_chunk_stream_serialize_start (cstream=0xb1994600, buffer=0xb19868a8, chunk_size=128) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:645
#11 0xb48e978a in gst_rtmp_chunk_stream_serialize_all (cstream=0xb1994600, buffer=0xb19868a8, chunk_size=128) at ../gst/rtmp2/rtmp/rtmpchunkstream.c:675
#12 0xb48eff32 in gst_rtmp_connection_start_write (self=0xb1986020) at ../gst/rtmp2/rtmp/rtmpconnection.c:554
#13 0xb48f04a8 in gst_rtmp_connection_write_buffer_done (obj=0xb22f2d68, result=0xb1990d00, user_data=0xb1986020) at ../gst/rtmp2/rtmp/rtmpconnection.c:630
#14 0xb59180c2 in g_task_return_now (task=0xb1990d00) at ../gio/gtask.c:1212
#15 0xb5916cec in g_task_return (task=0xb1990d00, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#16 0xb591739c in g_task_return_boolean (task=0xb1990d00, result=1) at ../gio/gtask.c:1801
#17 0xb48f2d54 in write_all_buffer_done (source=0xb22f2d68, result=0xb1990e68, user_data=0xb1990d00) at ../gst/rtmp2/rtmp/rtmputils.c:237
#18 0xb59180c2 in g_task_return_now (task=0xb1990e68) at ../gio/gtask.c:1212
#19 0xb5916cec in g_task_return (task=0xb1990e68, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#20 0xb591739c in g_task_return_boolean (task=0xb1990e68, result=1) at ../gio/gtask.c:1801
#21 0xb58f3588 in write_all_callback (stream=0xb22f2d68, result=0xb68adf50, user_data=0xb1990e68) at ../gio/goutputstream.c:1138
#22 0xb59180c2 in g_task_return_now (task=0xb68adf50) at ../gio/gtask.c:1212
#23 0xb5916cec in g_task_return (task=0xb68adf50, type=G_TASK_RETURN_SUCCESS) at ../gio/gtask.c:1281
#24 0xb59171dc in g_task_return_int (task=0xb68adf50, result=37) at ../gio/gtask.c:1746
#25 0xb58f2fe8 in async_ready_write_callback_wrapper (source_object=0xb22f2d68, res=0xb1991090, user_data=0xb68adf50) at ../gio/goutputstream.c:967
#26 0xb59180c2 in g_task_return_now (task=0xb1991090) at ../gio/gtask.c:1212
#27 0xb5918102 in complete_in_idle_cb (task=0xb1991090) at ../gio/gtask.c:1226
#28 0xb6d74f70 in g_idle_dispatch (source=0xb19952d8, callback=0xb59180f5 <complete_in_idle_cb>, user_data=0xb1991090) at ../glib/gmain.c:5784
#29 0xb6d781b0 in g_main_dispatch (context=0xb1989000) at ../glib/gmain.c:3299
#30 0xb6d78068 in g_main_context_dispatch (context=0xb1989000) at ../glib/gmain.c:4011
#31 0xb6d78444 in g_main_context_iterate (context=0xb1989000, block=1, dispatch=1, self=0xb22f2c90) at ../glib/gmain.c:4084
#32 0xb6d78838 in g_main_loop_run (loop=0xb1d8caf0) at ../glib/gmain.c:4278
#33 0xb48e1676 in gst_rtmp2_sink_task_func (user_data=0xb47cdf58) at ../gst/rtmp2/gstrtmp2sink.c:986
#34 0xb6b478a0 in gst_task_func (task=0xb1b04028) at ../gst/gsttask.c:384
#35 0xb6b484a6 in default_func (tdata=0xb422a4c0, pool=0xb1d95070) at ../gst/gsttaskpool.c:70
#36 0xb6d56058 in g_thread_pool_thread_proxy (data=0xb68c3a48) at ../glib/gthreadpool.c:308
#37 0xb6d54fea in g_thread_proxy (data=0xb22f2c90) at ../glib/gthread.c:805
#38 0xb6a39ef4 in __pthread_start(void*) () from target:/system/lib/libc.so
#39 0xb6a0ccbe in __start_thread () from target:/system/lib/libc.so
#40 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
In addition, if I run
gst-launch-1.0 --help
under Valgrind-3.20.0.GIT on the target, I have always the same crash before any help output:
(process:5878): GLib-ERROR **: 11:17:42.649: ../glib/gmem.c:170: failed to allocate 64 bytes
Trap
Which is very suspicious. Sorry, cannot give you the stack trace for this case.