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 666711 - rtspsrc: hostname lookup is not thread safe
rtspsrc: hostname lookup is not thread safe
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal major
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-22 11:02 UTC by Levente Farkas
Modified: 2012-01-07 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the pipeline (468.31 KB, image/png)
2011-12-22 11:02 UTC, Levente Farkas
Details

Description Levente Farkas 2011-12-22 11:02:56 UTC
Created attachment 204080 [details]
the pipeline

we use rtspsrc to get video streams from ip cameras. in case we've a fast machine and enough memory we found this bug with about 30 rtspsrc started parallel at the same time to different ip cameras. it's turn out that some stream are changed. this means that eg: pipeline 12 show camera 10's video. after a long debugging we found the problem what you can see the attached picture of the pipeline. the ip address is not the same in the rtspsrc's location argument what is inside the rtspsrc's inner udpsink's ip address (actually another ip address in the same network among the 30 cameras which we start to record at the same time). so it seems rtspsrc is not tread safe. and during the inner udpsrc generation the system can mix the internal structures and use wrong ip address (if from another rtspsrc's locataion).

of course each ip camera working properly and always send back his own ip address during the rtsp communication. so the problem is not that the camera send different ip address during the SETUP phase then the location in the rtsp.
Comment 1 Levente Farkas 2012-01-02 09:24:23 UTC
it seems that in the gstrtspconnection.c line
473:getaddrinfo
485:getnameinfo
these two functions are not thread safe. so that can be the core reason of the problem.
Comment 2 Tim-Philipp Müller 2012-01-07 20:19:42 UTC
I hope this fixes it. If not, please re-open.

 commit 9f042ae224b3d84643bf4ad977080987fe80d36f
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Sat Jan 7 20:12:17 2012 +0000

    rtspconnection: make hostname lookup more thread-safe
    
    Don't write IP number string to return into a static
    array which is shared amongst all threads (note: of
    course a copy is returned).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=666711
Comment 3 Levente Farkas 2012-01-07 20:55:53 UTC
it seems to a good catch:-) better the our tipp.
anyway in the light of this fix, it'd be very thread safe to check and remove all local static variable in all functions...