URL: <http://savannah.nongnu.org/bugs/?29677>
Summary: mtn log crashes if wrong database is specified Project: monotone Submitted by: tommyd Submitted on: Mo 26 Apr 2010 16:15:20 CEST Category: error handling Severity: 3 - Normal Item Group: crash Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any mtn version --full: monotone 0.48dev (base revision: 3526825f1f6765fdef04effecdefc7f63e4d61d0) Running on : Linux 2.6.31.12-23-default #1 SMP 2010-03-22 16:18:05 +0100 i686 C++ compiler : GNU C++ version 4.4.1 [gcc-4_4-branch revision 150839] C++ standard library: GNU libstdc++ version 20090817 Boost version : 1_39 SQLite version : 3.6.16 (compiled against 3.6.16) Lua version : Lua 5.1 PCRE version : 7.9 2009-04-11 (compiled against 7.9) Botan version : 1.6.4 (compiled against 1.6.4) Changes since base revision: format_version "1" new_manifest [690b8fc4e2fd2594d785b7d95f546917b31af28b] old_revision [3526825f1f6765fdef04effecdefc7f63e4d61d0] _______________________________________________________ Details: Setup: $ mtn clone host some.project some-project $ mtn clone host some.other-project some-other-project $ cd some-project $ mtn log -d ../some-other-project/_MTN/mtn.db mtn: fatal: error: wanted 1 rows got 0 in query: SELECT height FROM heights WHERE revision = ? (Of course clone is not needed here at all, it was just the easiest way to show the problem.) --debug shows off the exact place where the error occurs: mtn: database.cc:1482: detected database error, 'E(want_rows == any_rows || want_rows == nrow)' violated I think what we should do here is to check all edge_old_revision's we get from the workspace for existance in cmd_diff_log.cc:784 like this: # # old_revision [3526825f1f6765fdef04effecdefc7f63e4d61d0] # # patch "cmd_diff_log.cc" # from [37b1cfffa001ccc5b813fe6f0e84dc6a5dc3996e] # to [74f3dc3fa5ca6308fddbdbfa9cd895cf9dedf9e7] # ============================================================ --- cmd_diff_log.cc 37b1cfffa001ccc5b813fe6f0e84dc6a5dc3996e +++ cmd_diff_log.cc 74f3dc3fa5ca6308fddbdbfa9cd895cf9dedf9e7 @@ -781,9 +781,13 @@ CMD(log, "log", "", CMD_REF(informative) for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); i++) { - starting_revs.insert(edge_old_revision(i)); + revision_id rid = edge_old_revision(i); + E(db.revision_exists(rid), origin::user, + F("parent revision '%s' not found - did you " + "specify a wrong database?") % rid); + starting_revs.insert(rid); if (i == rev.edges.begin()) - first_rid = edge_old_revision(i); + first_rid = rid; } } else if (!app.opts.from.empty()) _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?29677> _______________________________________________ Nachricht geschickt von/durch Savannah http://savannah.nongnu.org/ _______________________________________________ Monotone-devel mailing list Monotone-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/monotone-devel