[gst-devel] On the plugin cache
Simon Holm Thøgersen
odie at cs.aau.dk
Tue Nov 11 21:10:50 CET 2008
tir, 11 11 2008 kl. 19:03 +0100, skrev Sebastian Dröge:
> Am Dienstag, den 11.11.2008, 16:13 +0100 schrieb Simon Holm Thøgersen:
> > > >> The value of doing the crc check seems pretty dubious to me btw; if
> > > >> you've got disk corruptions there are plenty of other ways your system
> > > >> could malfunction. It should be pretty easy to make it optional at load
> > > >> time though.
> > > >
> > > > I'm not sure what the rationale was for adding a CRC to the binary
> > > > registry format originally. It might have been done as a sanity check to
> > > > detect partially-written registry files, so they can be rebuilt without
> > > > crashing every GStreamer app.
> > >
> > > Yeah, the CRC check is totally bogus. The cache must be built in a temp file
> > > first, then moved to it's final place. Assuming a journaling filesystem,
> > > there's no way you end up with a partially-written file. The only way the CRC
> > > can fail is disk failure or manual modification of the file. Neither one is
> > > particularly interesting. Imagine what would happen if we did the same to
> > > shared objects, fonts, icons, and any other kind of binary data :).
> > >
> > Sebastian, can you tell us the rationale for the crc check or should we just
> > file a bug report for the removal? I'm volunteering for this as well.
> The original rationale for the CRC check was, to ensure that the
> registry was a) completely written and b) wasn't corrupted by something
> (memory failure, ....). I agree that a) could be done much simpler,
> either just a single value that is written when the registry is finished
> or the temp file & move thing which was written in this thread.
The code already use a temp file and then rename, and also did before
the crc code was introduced.
> b) is
> still valid but you're right that, if this has happened, there are much
> larger problems anyway.
> Best would be to file a bug for removal of the CRC but I'm probably
> going to do that tomorrow already...
I filed it as #503675. I'll submit patch during the weekend if noone
beats me to it.
More information about the gstreamer-devel