File descriptor leak on Raspberry Pi

Jérôme Laheurte jerome at jeromelaheurte.net
Tue May 2 09:14:32 UTC 2023



> Le 1 mai 2023 à 20:06, Nicolas Dufresne <nicolas at ndufresne.ca> a écrit :
> 
> Hi,
> 
> Le jeudi 27 avril 2023 à 14:47 +0200, Jérôme Laheurte via gstreamer-devel a écrit :
>> Hello everybody. There seems to be a file descriptor leak in the device monitor API on ARM; using this sample program:
>> 
>> #include <unistd.h>
>> #include <gst/gst.h>
>> 
>> int main(int argc, char *argv[]) {
>>   gst_init(&argc, &argv);
>> 
>>   while (1) {
>>     GstDeviceMonitor* monitor = gst_device_monitor_new();
>>     if (!gst_device_monitor_start(monitor))
>>       return 1;
>>     gst_device_monitor_stop(monitor);
>>     gst_object_unref(monitor);
>> 
>>     sleep(1);
>>   }
>> 
>>   return 0;
>> }
>> 
>> and monitoring /proc/[pid]/fd, there’s one new file descriptor every second created by eventfd2. Funny thing this only happens on a Raspberry Pi 4B (Raspbian). Versions tested:
> 
> Thank you very much for the report, this little test was very handy. I have made a merge request to fix this leak, the eventfd is from a leaked GMainLoop.
> 
> https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4521

That was quick :) Thanks!

Best regards
Jérôme Laheurte

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230502/2ec23977/attachment-0001.htm>


More information about the gstreamer-devel mailing list