After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779334 - SoupHttpClientSink crash on stop
SoupHttpClientSink crash on stop
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.8.0
Other Mac OS
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-27 20:00 UTC by joel.gstreamer
Modified: 2018-01-18 22:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stack Trace 1 (235.81 KB, image/png)
2017-02-28 18:08 UTC, joel.gstreamer
Details
Stack Trace 2 (156.45 KB, image/png)
2017-02-28 18:14 UTC, joel.gstreamer
Details
Stack Trace 3 (231.31 KB, image/png)
2017-02-28 18:14 UTC, joel.gstreamer
Details

Description joel.gstreamer 2017-02-27 20:00:23 UTC
I am working on an iOS app and stopping a souphttpclientsink can sometimes lead to a crash in libsoup. This seems to happen more frequently on poor networks. Here's the crash log I'm seeing:

#12 
Crashed: souphttpclientsink-thread 
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 
 Raw Text 
0	
soup-socket-properties.c line 66 
soup_socket_properties_push_async_context 
1	
soup-connection.c line 424 
soup_connection_connect_async 
2	
soup-session.c line 1969 
soup_session_process_queue_item 
3	
soup-session.c line 2095 
async_run_queue 
4	
soup-session.c line 2131 
idle_run_queue 
5	
gmain.c line 3237 
g_main_context_dispatch 
6	
gmain.c line 3971 
g_main_context_iterate 
7	
gmain.c line 4162 
g_main_loop_run 
8	
souphttpclientsink.c line 550 
thread_func 
9	
gthread.c line 778 
g_thread_proxy 


I also see the following crash when the stop has been called: 

2	
gthread-posix.c line 1214 
g_system_thread_wait 
3	
gthread.c line 948 
g_thread_join 
4	
souphttpclientsink.c line 647 
gst_soup_http_client_sink_stop 
5	
gstbasesink.c line 5223 
gst_base_sink_change_state 
6	
gstelement.c line 2648 
gst_element_change_state 
7	
gstelement.c line 2602 
gst_element_set_state_func 
8	
gstbin.c line 2414 
gst_bin_change_state_func 
9	
gstpipeline.c line 499 
gst_pipeline_change_state 
10	
gstelement.c line 2648 
gst_element_change_state 
11	
gstelement.c line 2694 
gst_element_change_state 
12	
gstelement.c line 2694 
gst_element_change_state 
13	
gstelement.c line 2602 
gst_element_set_state_func 
14	
[Redacted].cpp line 260 
stopPlayingAndDeallocPipelines() 
15	
[Redacted].cpp line 74 
setupPipelines() 
16	
[Redacted].cpp line 23 
startInternal(void*)
Comment 1 joel.gstreamer 2017-02-28 17:57:05 UTC
I have created a sample Xcode project that you can download here: https://www.dropbox.com/s/cw4lwmd7g3mk3dc/SoupHttpClientCrash.zip?dl=0. This pretty much mimics my app where I have an RTSP stream and souphttpclientsink stream going at the same time. The URLs are set to blank, but you can set them in ViewController.didClickStart. In this method, there is a call to createRtspStream with comments about where you insert the different stream URLs.

On the UI, there are just two buttons for stop/start. If you alternate pressing start and stop to simulate restarting the stream you should be able to reproduce. Unfortunately, you won't be able to reproduce it every time but it seems to be a little easier to reproduce in poorer network conditions. 

Please let me know if you have any questions about how this works.
Comment 2 joel.gstreamer 2017-02-28 18:08:09 UTC
One other interesting comment is the crash sometimes happens in different places. I am attaching a few screenshots with the different stack traces I'm seeing in Xcode.
Comment 3 joel.gstreamer 2017-02-28 18:08:39 UTC
Created attachment 346925 [details]
Stack Trace 1
Comment 4 joel.gstreamer 2017-02-28 18:14:12 UTC
Created attachment 346926 [details]
Stack Trace 2
Comment 5 joel.gstreamer 2017-02-28 18:14:58 UTC
Created attachment 346927 [details]
Stack Trace 3
Comment 6 joel.gstreamer 2017-03-10 15:39:15 UTC
I have created a new sample project where it will automatically start/stop the pipeline. After around 15-20 tries, you should see the crash. You can find this project at: https://www.dropbox.com/s/2hqac8vf7ikawyo/SoupHttpClientCrash%202.zip?dl=0.
Comment 7 joel.gstreamer 2017-03-10 20:01:49 UTC
Sorry for the additional comment, but I had to slightly modify the project so the new project is actually at: https://www.dropbox.com/s/j9wmhzrtbmqi3w9/SoupHttpClientCrash%202.zip?dl=0. Please disregard my previous comment.
Comment 8 Vincent Penquerc'h 2017-05-25 15:18:02 UTC
A crash in alloc functions look like prior memory arena corruption.
Run with valgrind and see if anything pops up beforehand.
Comment 9 Edward Hervey 2017-11-10 09:27:21 UTC
joel, can you try again with master to see if the issue still happens ? And if so try runnign with valgrind as Vincent mentioned.
Comment 10 Tim-Philipp Müller 2018-01-18 22:21:00 UTC
Thanks for making the effort to produce a test application. Links are 404 now though, and no follow-up to the questions. Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!