On Fri, 2005-05-06 at 09:28, Martin Vermeer wrote: > On Thu, 2005-05-05 at 17:25, Juergen Spitzmueller wrote: > > > > > 2. LyX asserts when you move the cursor to another cell with the mouse and > > then type something _while_ the tabular dialog is opened. > > I get two different asserts: > > > > a.) > > Assertion triggered in CoordCacheBase<InsetBase>& CoordCache::insets() by > > failing check "updating" in file ../../src/coordcache.h:129 > > > > b.) > > Assertion triggered in pit_type LyXText::getPitNearY(int) const by failing > > check "theCoords.getParPos().find(this) != theCoords.getParPos().end()" in > > file text2.C:854 > > Yes, I can trigger this too, even without changing cells. Just typing fast > enough... > I am not sure what the role of the tabular dialog in this is. Perhaps it > just slows down things enough for the effect the manifest itself.
Even worse: I can produce it without the dialog. Just hold down the 'a' key a few seconds, and let go... > My suspect is "updating". In BufferView_pimpl.C:624 we have a call to > theCoords.startUpdating(). Then, when screen redraw is called, we have > in screen.C:231 a call to theCoords.doneUpdating(). > > Is it possible for an asynchronous inconsistency to occur here? LyX was instrumented as attached. The result: --- recordUndo: pos: 8 void BufferView::Pimpl::update(bool, bool)[fitcursor = 1, forceupdate = 1] buffer: 0x9b2dfa0 startUpdating ViewMetricsInfo BufferView::Pimpl::metrics() npit: 1 pit1: 0 pit2: 0 ViewMetricsInfo BufferView::Pimpl::metrics() y1: 0 y2: 222 calling screen redraw setposcache tabular setposcache insettext setposcache insettext setposcache insettext setposcache insettext (more of the same) Then, in case the dialog is up: setposcache insettext setposcache insettext setposcache insettext setposcache insettext doneUpdating setposcache insettext Assertion triggered in CoordCacheBase<InsetBase>& CoordCache::insets() by failing check "updating" in file ../../src/coordcache.h:129 --- or, without the dialog: setposcache insettext setposcache insettext setposcache insettext doneUpdating doneUpdating Assertion triggered in void CoordCache::doneUpdating() by failing check "updating" in file coordcache.C:49 --- Both seem to point so some asynchronous inconsistency. 1) how come another call to insettext draw happens after screen redraw is already over? 2) Why two calls to doneUpdating, of which the second of course fails? - Martin
Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.581 diff -u -p -r1.581 BufferView_pimpl.C --- BufferView_pimpl.C 20 Apr 2005 17:35:46 -0000 1.581 +++ BufferView_pimpl.C 6 May 2005 08:28:33 -0000 @@ -621,6 +621,7 @@ void BufferView::Pimpl::update(bool fitc CoordCache backup; std::swap(theCoords, backup); + lyxerr << "startUpdating" << endl; theCoords.startUpdating(); ViewMetricsInfo vi = metrics(); @@ -631,6 +632,7 @@ void BufferView::Pimpl::update(bool fitc } if (forceupdate) { // Second drawing step + lyxerr << "calling screen redraw" << endl; screen().redraw(*bv_, vi); } else { // Abort updating of the coord cache - just restore the old one Index: insets/insettabular.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v retrieving revision 1.464 diff -u -p -r1.464 insettabular.C --- insets/insettabular.C 26 Apr 2005 11:12:19 -0000 1.464 +++ insets/insettabular.C 6 May 2005 08:28:33 -0000 @@ -268,6 +269,7 @@ void InsetTabular::metrics(MetricsInfo & void InsetTabular::draw(PainterInfo & pi, int x, int y) const { + lyxerr << "setposcache tabular" << endl; setPosCache(pi, x, y); //lyxerr << "InsetTabular::draw: " << x << " " << y << endl; Index: frontends/screen.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v retrieving revision 1.101 diff -u -p -r1.101 screen.C --- frontends/screen.C 11 Feb 2005 18:07:06 -0000 1.101 +++ frontends/screen.C 6 May 2005 08:28:33 -0000 @@ -228,6 +228,7 @@ void LyXScreen::redraw(BufferView & bv, lyxerr[Debug::DEBUG] << "Redraw screen" << endl; expose(0, 0, workarea().workWidth(), workarea().workHeight()); workarea().getPainter().end(); + lyxerr << "doneUpdating" << endl; theCoords.doneUpdating(); showCursor(bv); }
signature.asc
Description: This is a digitally signed message part