[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Review Request 117930: Catch more exceptions in Baloo::FileFetchJob::doStart()
From: "Frank Reininghaus" <frank78ac () googlemail ! com>
Date: 2014-05-01 13:23:57
Message-ID: 20140501132357.13676.24565 () probe ! kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117930/#review57056
-----------------------------------------------------------
Note 1: an even better fix would probably be to repair or delete and re-create the \
broken database if a Xapian::DatabaseOpeningError exception is thrown, but my \
knowledge of the Baloo/Xapian internals is not sufficient for that.
Note 2: https://bugs.kde.org/show_bug.cgi?id=333465 is about a crash due to an \
unhandled Xapian::DatabaseCorruptError, but without backtrace. Maybe it's thrown at \
the same location, I don't know.
- Frank Reininghaus
On May 1, 2014, 1:14 p.m., Frank Reininghaus wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117930/
> -----------------------------------------------------------
>
> (Updated May 1, 2014, 1:14 p.m.)
>
>
> Review request for Baloo.
>
>
> Bugs: 333763
> http://bugs.kde.org/show_bug.cgi?id=333763
>
>
> Repository: baloo
>
>
> Description
> -------
>
> https://bugs.kde.org/show_bug.cgi?id=333763 shows that the Xapian database \
> constructor can throw an exception, which is not handled at the moment. This patch \
> wraps all Xapian-related stuff in Baloo::FileFetchJob::doStart() in a try {...} \
> block and catches all exceptions.
> The alternative would be to only add a catch statement for the \
> Xapian::DatabaseOpeningError which seems to be thrown according to the bug report, \
> provided that we can be 100% sure that no other exceptions can be thrown there. \
> IMHO, a library that uses external libraries that can throw exceptions should try \
> as hard as possible to catch all exceptions.
>
> Diffs
> -----
>
> src/file/lib/filefetchjob.cpp 21f5520
>
> Diff: https://git.reviewboard.kde.org/r/117930/diff/
>
>
> Testing
> -------
>
> Unit tests still pass.
>
>
> Thanks,
>
> Frank Reininghaus
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/117930/">https://git.reviewboard.kde.org/r/117930/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Note 1: an even better \
fix would probably be to repair or delete and re-create the broken database if a \
Xapian::DatabaseOpeningError exception is thrown, but my knowledge of the \
Baloo/Xapian internals is not sufficient for that.
Note 2: https://bugs.kde.org/show_bug.cgi?id=333465 is about a crash due to an \
unhandled Xapian::DatabaseCorruptError, but without backtrace. Maybe it's thrown \
at the same location, I don't know.</pre> <br />
<p>- Frank Reininghaus</p>
<br />
<p>On May 1st, 2014, 1:14 p.m. UTC, Frank Reininghaus wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Baloo.</div>
<div>By Frank Reininghaus.</div>
<p style="color: grey;"><i>Updated May 1, 2014, 1:14 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=333763">333763</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
baloo
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">https://bugs.kde.org/show_bug.cgi?id=333763 shows that the Xapian \
database constructor can throw an exception, which is not handled at the moment. This \
patch wraps all Xapian-related stuff in Baloo::FileFetchJob::doStart() in a try {...} \
block and catches all exceptions.
The alternative would be to only add a catch statement for the \
Xapian::DatabaseOpeningError which seems to be thrown according to the bug report, \
provided that we can be 100% sure that no other exceptions can be thrown there. IMHO, \
a library that uses external libraries that can throw exceptions should try as hard \
as possible to catch all exceptions.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Unit tests still pass.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/file/lib/filefetchjob.cpp <span style="color: grey">(21f5520)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/117930/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic