Re: [Tracker] PATCH: Fix segfault in tracker-ontologies (shows in tracker-miner-fs) when ontologies are missing



On 08/08/13 16:27, Philip Van Hoof wrote:
Ho Jonatan,

Hi Philip, Jonatan,

I don't really agree with this approach. We should not 'just' check for
NULL and let the software continue as if nothing happens. Invalid
ontologies means that we can't go on. So abort() is probably the only
sensible way out.

Yes, I agree. This is on the same level as corrupt database type errors, i.e we can not operate at all without a minimal requirement. One of those requirements is a fully functioning and properly existing ontology.

Trying to accept that stuff returns NULL and then happily continuing the
rest of the software isn't really an option. Either the software can do
its stuff and then it does it, or it can't and then it aborts (with an
appropriate error message and/or error mechanism). Trying to continue
and by that further destroying data and/or corrupt databases is not good.

Exactly.

In this case what could also be done, if you do want to improve
error-handling, is that tracker-store returns an error for each and
every of its D-Bus calls. I don't consider trying to handle NULL an
improvement (rather, it's worse that way as you know about the problem
later in the code rather than sooner this way).

Agree with Philip here. Much better to have if (!foo) { g_error ("Holy cow, where's my brain? Please find my ontology"); }

:)

The alternative is, you investigate some other problem later on and find this is the point of inception all along.

--
Regards,
Martyn

Founder & Director @ Lanedo GmbH.
http://www.linkedin.com/in/martynrussell


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]