Why won't zonefile load?

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Fri Mar 18 07:17:43 UTC 2011


Hello,

Sorry for the long delay, but I've finally looked into this problem,
and I believe I found the cause of it (the offending zone file helped
a lot, thanks).

At Mon, 7 Mar 2011 18:13:46 +0100,
"Eivind Olsen" <eivind at aminor.no> wrote:

> As long as I've tried to have the bigger zonefile, it seems like dig gets
> the SERVFAIL and after that I get the "database is locked" error, until I
> shut down BIND 10.

This is a mixture of multiple bugs, but the primary reason is that
this zone contains an RR that is currently not supported in our C++
DNS library:

> bohrnag.org.				      86400 IN RP	postmaster.aminor.no. postmaster.aminor.no.

(the use of DNSSEC should be irrelevant to the problem, by the way).

That's the reason for SERVFAIL.   Of course, for longer term we should
support all standardized RR types (and we will), but b10-loadzone
should at least have complained about it when building the sqlite3
database file.

The subsequent "database is locked" problem is due to another bug.
When the sqlite3 datasource encounters a failure at the level of the
DNS library (such as "unknown" RR type) it stops the processing
without gracefully cleaning up the access to the database file.  In
theory this can happen for other reasons than "unknown" RR types, so
this is itself a bug to be fixed even if we eliminate the primary
problem.

In the mean time, if you are willing to continue playing with BIND 10
(I hope you are:-), I'd first suggest removing RRs that contain
"unknown" RR types.  From a quick look and experiment, the only such
RR is type RP (you'll also have to ensure it doesn't appear in DNSSEC
related RDATA, too).

Regarding the "database is locked" problem, the patch copied below
should work as a workaround.  But it's not a clean (or even complete)
fix.  We'll probably refactor the code more fundamentally.

Again, thanks for your experiment and feedback.

---
JINMEI, Tatuya
Internet Systems Consortium, Inc.

diff --git a/src/lib/datasrc/sqlite3_datasrc.cc b/src/lib/datasrc/sqlite3_datasrc.cc
index ab910ba..a211996 100644
--- a/src/lib/datasrc/sqlite3_datasrc.cc
+++ b/src/lib/datasrc/sqlite3_datasrc.cc
@@ -278,11 +278,16 @@ Sqlite3DataSrc::findRecords(const Name& name, const RRType& rdtype,
         }
     }
 
-    const int rows = importSqlite3Rows(query, name, getClass(), rdtype, false,
-                                       target, flags);
-    sqlite3_reset(query);
-    if (rows > 0) {
-        return (rows);
+    try {
+        const int rows = importSqlite3Rows(query, name, getClass(), rdtype,
+                                           false, target, flags);
+        sqlite3_reset(query);
+        if (rows > 0) {
+            return (rows);
+        }
+    } catch (...) {
+        sqlite3_reset(query);
+        throw;
     }
 
     //



More information about the bind10-users mailing list