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 701948 - (auro) JPEGWriter is leaking file descriptors
(auro)
JPEGWriter is leaking file descriptors
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: librygel-server
0.19.x
Other Linux
: High major
: ---
Assigned To: rygel-maint
rygel-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-10 17:17 UTC by auro.tripathy
Modified: 2013-07-23 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
media-export: Don't leak fds in JPEG writer (989 bytes, patch)
2013-07-23 14:42 UTC, Jens Georg
committed Details | Review

Description auro.tripathy 2013-06-10 17:17:51 UTC
Hi Rygel developers:

I've built Rygel using the PPA https://launchpad.net/~yg-jensge/+archive/gupnp-unstable and the dependent PPAs and Valac-0.18 and gstreamer 1.0. 

Rygel is configured with --disable-tracker-plugin --enable-shared --disable-playbin-plugin --with-media-engine=simple

If I harvest/inpoort large number of files (in my case, 4200 mp3 files), I get the following error after harvesting about two-thirds of the files (approximately 3000 files). Smaller quantities of mp3 files (like 1200 files) don't manifest the problem, i.e., harvesting complete without a crash.

The issue is reproducible. 

Crash log below
---------------
(rygel:19747): MediaExport-WARNING **: Failed to add item with ID a0257d1acc2533761b5fb9f0e9194763: SQLite error 14: unable to open database file

(rygel:19747): MediaExport-WARNING **: rygel-media-export-trackable-db-container.vala:79: Failed to add object: SQLite error 14: unable to open database file

(rygel:19747): GStreamer-CRITICAL **: gst_poll_get_read_gpollfd: assertion `set != NULL' failed

(rygel:19747): GStreamer-CRITICAL **: gst_bus_create_watch: assertion `bus->priv->poll != NULL' failed

(rygel:19747): GLib-CRITICAL **: g_source_set_callback: assertion `source != NULL' failed
Segmentation fault (core dumped)
Comment 1 auro.tripathy 2013-06-10 17:20:40 UTC
Sorry about the typo (its harvest/import, not harvest/inpoort)
Comment 2 Jens Georg 2013-06-10 18:07:36 UTC
Two ideas:

a) the SQL file is corrupt
b) something is leaking file descriptors.
Comment 3 auro.tripathy 2013-06-11 19:07:56 UTC
The SQLite DB is OK. I ran simple queries on it. Please see below.
How can I help with (b)?

auro@auro-HP-G60-Notebook-PC:~$ sqlite3 .cache/rygel/media-export.db 
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
closure      meta_data    object       schema_info
sqlite> SELECT Count(*) FROM meta_data;
1226
sqlite> SELECT Count(*) FROM object;
1255
sqlite> SELECT Count(*) FROM closure;
8702
sqlite>
Comment 4 auro.tripathy 2013-06-11 19:28:01 UTC
Another seg fault instance while harvesting 4200 music files (towards the end of the harvesting)

(rygel:3172): GStreamer-CRITICAL **: gst_poll_get_read_gpollfd: assertion `set != NULL' failed

(rygel:3172): GStreamer-CRITICAL **: gst_bus_create_watch: assertion `bus->priv->poll != NULL' failed

(rygel:3172): GLib-CRITICAL **: g_source_set_callback: assertion `source != NULL' failed
Segmentation fault (core dumped)

DB fine in this case

auro@auro-HP-G60-Notebook-PC:~$ sqlite3 .cache/rygel/media-export.db 
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
closure      meta_data    object       schema_info
sqlite> SELECT Count(*) FROM meta_data;
4231
sqlite> SELECT Count(*) FROM object;
4294
sqlite> SELECT Count(*) FROM closure;
29936
sqlite>
Comment 5 Jens Georg 2013-06-12 07:17:18 UTC
(In reply to comment #3)
> The SQLite DB is OK. I ran simple queries on it. Please see below.
> How can I help with (b)?

Running rygel inside valgrind using --track-fds=yes should be one way.

https://live.gnome.org/Rygel/Debugging has some hints and links about valgrinding Rygel.
Comment 6 Jens Georg 2013-07-22 19:19:54 UTC
reproducable with 10k files
Comment 7 Jens Georg 2013-07-23 08:40:18 UTC
Looks like the code that extracts embedded album art is leaking file descriptors
Comment 8 Jens Georg 2013-07-23 09:57:41 UTC
Looks like the bin and src and sink in JPEGWriter are freed properly
Comment 9 Jens Georg 2013-07-23 14:42:35 UTC
Created attachment 249899 [details] [review]
media-export: Don't leak fds in JPEG writer
Comment 10 Jens Georg 2013-07-23 14:47:05 UTC
Attachment 249899 [details] pushed as de6b387 - media-export: Don't leak fds in JPEG writer