Re: Crash in equation paint (master)
On Wed, Feb 03, 2021 at 03:54:12PM +0100, Jean-Marc Lasgouttes wrote: > Le 01/02/2021 ?? 19:02, Pavel Sanda a écrit : > >After applying this patch I can't reproduce the crash anymore. > >On top of that, any zoom change is immediately visible in the other window > >and I do not experience any strange painting misalignments there. > > Thanks, it is in now. Thank you. Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Le 01/02/2021 à 19:02, Pavel Sanda a écrit : After applying this patch I can't reproduce the crash anymore. On top of that, any zoom change is immediately visible in the other window and I do not experience any strange painting misalignments there. Thanks, it is in now. JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 08:01:22PM +0100, Jean-Marc Lasgouttes wrote: > Le 01/02/2021 à 19:53, Scott Kostyshak a écrit : > > On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote: > > > Le 01/02/2021 à 14:03, Pavel Sanda a écrit : > > > > Small updates, I get perfect reproducibility now: > > > > - You dont need to type anything in new window 2, just zoom-in couple > > > > times is enough > > > > - The cursor in table in window 1 is necessary, just loading up the > > > > manual is not enough. > > > > I generally put the cursor in the middle of "phantom" string in of > > > > the first row. > > > > - The crash happens in branch too. > > > > > > I cannot reproduce, but I see that the window redraw is done without > > > recomputing metrics. > > > > Is this related at all to #11919? > > I would be surprised, but you are welcome to try :) This is really a > multi-view issue. Good to know, I tried and it doesn't seem to change that behavior. Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Le 01/02/2021 à 19:02, Pavel Sanda a écrit : Can you confirm that the following patch helps? After applying this patch I can't reproduce the crash anymore. On top of that, any zoom change is immediately visible in the other window and I do not experience any strange painting misalignments there. Thanks, I will commit it then. If you find other situations where this is required, please chime in. JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Le 01/02/2021 à 19:53, Scott Kostyshak a écrit : On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote: Le 01/02/2021 à 14:03, Pavel Sanda a écrit : Small updates, I get perfect reproducibility now: - You dont need to type anything in new window 2, just zoom-in couple times is enough - The cursor in table in window 1 is necessary, just loading up the manual is not enough. I generally put the cursor in the middle of "phantom" string in of the first row. - The crash happens in branch too. I cannot reproduce, but I see that the window redraw is done without recomputing metrics. Is this related at all to #11919? I would be surprised, but you are welcome to try :) This is really a multi-view issue. JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote: > Le 01/02/2021 à 14:03, Pavel Sanda a écrit : > > Small updates, I get perfect reproducibility now: > > - You dont need to type anything in new window 2, just zoom-in couple times > > is enough > > - The cursor in table in window 1 is necessary, just loading up the manual > > is not enough. > >I generally put the cursor in the middle of "phantom" string in of the > > first row. > > - The crash happens in branch too. > > I cannot reproduce, but I see that the window redraw is done without > recomputing metrics. Is this related at all to #11919? Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 06:49:09PM +0100, Jean-Marc Lasgouttes wrote: > Le 01/02/2021 ?? 14:03, Pavel Sanda a écrit : > >Small updates, I get perfect reproducibility now: > >- You dont need to type anything in new window 2, just zoom-in couple times > >is enough > >- The cursor in table in window 1 is necessary, just loading up the manual > >is not enough. > > I generally put the cursor in the middle of "phantom" string in of the > > first row. > >- The crash happens in branch too. > > I cannot reproduce, but I see that the window redraw is done without > recomputing metrics. > > Can you confirm that the following patch helps? After applying this patch I can't reproduce the crash anymore. On top of that, any zoom change is immediately visible in the other window and I do not experience any strange painting misalignments there. Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Le 01/02/2021 à 14:03, Pavel Sanda a écrit : Small updates, I get perfect reproducibility now: - You dont need to type anything in new window 2, just zoom-in couple times is enough - The cursor in table in window 1 is necessary, just loading up the manual is not enough. I generally put the cursor in the middle of "phantom" string in of the first row. - The crash happens in branch too. I cannot reproduce, but I see that the window redraw is done without recomputing metrics. Can you confirm that the following patch helps? JMarc >From 53bed3fc5177176b30c031b3f452ace688646353 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 1 Feb 2021 18:19:46 +0100 Subject: [PATCH] Force redraw of all bufferviews after zoom in/out Add a new ForceAll update flag that forces to update metrics and redraw all buffer views. The situation in multi windows setting is very fragile and will need to be adressed properly in the 2.5 cycle. --- src/frontends/qt/GuiApplication.cpp | 13 - src/frontends/qt/GuiView.cpp| 2 +- src/update_flags.h | 4 +++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index 90d25b2525..455dbedfe0 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -1479,13 +1479,16 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd) dr.screenUpdate(Update::FitCursor); { - // This handles undo groups automagically + // All the code is kept inside the undo group because + // updateBuffer can create undo actions (see #11292) UndoGroupHelper ugh(buffer); dispatch(cmd, dr); - // redraw the screen at the end (first of the two drawing steps). - // This is done unless explicitly requested otherwise. - // This code is kept inside the undo group because updateBuffer - // can create undo actions (see #11292) + if (dr.screenUpdate() & Update::ForceAll) { + for (Buffer const * b : theBufferList()) +b->changed(true); + dr.screenUpdate(dr.screenUpdate() & ~Update::ForceAll); + } + updateCurrentView(cmd, dr); } diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index bdd7f1d2b9..3ff1858657 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -4550,7 +4550,7 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) lyxrc.currentZoom, lyxrc.defaultZoom)); guiApp->fontLoader().update(); - dr.screenUpdate(Update::Force | Update::FitCursor); + dr.screenUpdate(Update::ForceAll | Update::FitCursor); break; } diff --git a/src/update_flags.h b/src/update_flags.h index af71c0e78d..0efa541122 100644 --- a/src/update_flags.h +++ b/src/update_flags.h @@ -29,7 +29,9 @@ namespace Update { SinglePar = 8, /// Only the inset decorations need to be redrawn, no text metrics /// update is needed. - Decoration = 16 + Decoration = 16, + /// Force metrics and redraw for all buffers. + ForceAll = 32 }; inline flags operator|(flags const f, flags const g) -- 2.27.0 -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 01:36:15PM +0100, Pavel Sanda wrote: > On Mon, Feb 01, 2021 at 11:42:38AM +0100, Jean-Marc Lasgouttes wrote: > > Le 01/02/2021 ?? 11:36, Pavel Sanda a écrit : > > >Struggling to find recipy, but already happened 3x in the morning while > > >trying to merge changes from Phil's review: > > > > > >1. Open math manual, go to the second table in 3.7 > > >2. Open new window 2, open new file and starting to reproduce the formula > > >3. ctrl+m ^19 > > >4. unclear sequence of these: > > >a) backspace to delete 19, or type something again > > >b) zoom in/zoom out > > >c) switch to different window/workspace (the immediate crash trigger seems > > >to be always when activating LyX window after wandering elsewhere) > > > > I'll take a look. It may be that the cache is cleared when zooming but the > > metrics are not rebuilt. > > As I got more skillful in triggering this bug most consistent way how to > trigger is > after step 3: > 4. Zoom in many times > 5. switch to former window with math manual (the cursor there inside the > table) > 6. kaboom Small updates, I get perfect reproducibility now: - You dont need to type anything in new window 2, just zoom-in couple times is enough - The cursor in table in window 1 is necessary, just loading up the manual is not enough. I generally put the cursor in the middle of "phantom" string in of the first row. - The crash happens in branch too. > Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 01:19:08PM +0100, Kornel Benko wrote: > Am Mon, 1 Feb 2021 13:15:47 +0100 > schrieb Pavel Sanda : > > > On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote: > > > Will try to come up with better backtrace, but this is what I have now: > > > > You could try 'bt full'. I can recompile to get optimized-out values printed so such backtrace is useful, let me know if that's helpful. Anyway, with the updated recipy I have almost 100% crash-rate, so painting gurus might be able to reproduce themselves. Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 11:42:38AM +0100, Jean-Marc Lasgouttes wrote: > Le 01/02/2021 ?? 11:36, Pavel Sanda a écrit : > >Struggling to find recipy, but already happened 3x in the morning while > >trying to merge changes from Phil's review: > > > >1. Open math manual, go to the second table in 3.7 > >2. Open new window 2, open new file and starting to reproduce the formula > >3. ctrl+m ^19 > >4. unclear sequence of these: > >a) backspace to delete 19, or type something again > >b) zoom in/zoom out > >c) switch to different window/workspace (the immediate crash trigger seems > >to be always when activating LyX window after wandering elsewhere) > > I'll take a look. It may be that the cache is cleared when zooming but the > metrics are not rebuilt. As I got more skillful in triggering this bug most consistent way how to trigger is after step 3: 4. Zoom in many times 5. switch to former window with math manual (the cursor there inside the table) 6. kaboom Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Am Mon, 1 Feb 2021 13:15:47 +0100 schrieb Pavel Sanda : > On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote: > > Will try to come up with better backtrace, but this is what I have now: > You could try 'bt full'. Kornel pgpw2I5hDgNTv.pgp Description: Digitale Signatur von OpenPGP -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
On Mon, Feb 01, 2021 at 11:36:21AM +0100, Pavel Sanda wrote: > Will try to come up with better backtrace, but this is what I have now: Better one: (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x76558535 in __GI_abort () at abort.c:79 #2 0x55b831a4 in lyx::lyx_exit (exit_code=exit_code@entry=1) at LyX.cpp:272 #3 0x55cf88a4 in boost::assertion_failed (expr=0x5642b87c "false", function=0x5650d0a0 "void lyx::doAssertWithCallstack(bool)", file=0x5650d033 "lassert.cpp", line=45) at boost.cpp:47 #4 0x563861e0 in lyx::doAssertWithCallstack (value=value@entry=false) at lassert.cpp:45 #5 0x56386320 in lyx::doBufErr (expr=expr@entry=0x5642b87c "false", file=file@entry=0x5642adfd "CoordCache.cpp", line=line@entry=27) at lassert.cpp:83 #6 0x55d2eb08 in lyx::lyxbreaker (data=data@entry=0x57414d80, hint=hint@entry=0x563da4be "dim", size=0) at CoordCache.cpp:27 #7 0x55dfecf8 in lyx::CoordCacheBase::checkDim (hint=0x563da4be "dim", thing=0x57414d80, this=0x57ded878) at /usr/include/c++/8/bits/stl_tree.h:1012 #8 lyx::CoordCacheBase::dim (thing=, this=0x57ded878) at ./CoordCache.h:93 #9 lyx::MathData::dimension (this=0x57414d80, bv=...) at mathed/MathData.cpp:926 #10 0x55d93dab in lyx::InsetMathGrid::cellXOffset (this=this@entry=0x5740df00, bv=..., idx=idx@entry=0) at mathed/InsetMathGrid.cpp:910 #11 0x55d981b2 in lyx::InsetMathGrid::draw (this=this@entry=0x5740df00, pi=..., x=x@entry=682, y=y@entry=12) at mathed/InsetMathGrid.cpp:601 #12 0x55db32ea in lyx::InsetMathHull::draw (this=0x5740df00, pi=..., x=681, y=12) at mathed/InsetMathHull.cpp:661 #13 0x55d82dec in lyx::RowPainter::paintInset (this=this@entry=0x7fffc740, e=...) at RowPainter.cpp:112 #14 0x55d83fde in lyx::RowPainter::paintText (this=this@entry=0x7fffc740) at RowPainter.cpp:555 #15 0x55caf1f1 in lyx::TextMetrics::drawParagraph (this=this@entry=0x589e8f08, pi=..., pit=, pit@entry=0, x=x@entry=681, y=y@entry=12) at TextMetrics.cpp:1958 #16 0x55caf5b8 in lyx::TextMetrics::draw (this=this@entry=0x589e8f08, pi=..., x=681, y=y@entry=12) at TextMetrics.cpp:1809 #17 0x5601c565 in lyx::InsetText::draw (this=0x574163e0, pi=..., x=677, y=12) at insets/InsetText.cpp:235 #18 0x5600792a in lyx::InsetTabular::draw (this=0x57413660, pi=..., x=237, y=) at /usr/include/c++/8/bits/shared_ptr_base.h:1307 #19 0x55d82dec in lyx::RowPainter::paintInset (this=this@entry=0x7fffcd30, e=...) at RowPainter.cpp:112 #20 0x55d83fde in lyx::RowPainter::paintText (this=this@entry=0x7fffcd30) at RowPainter.cpp:555 #21 0x55caf1f1 in lyx::TextMetrics::drawParagraph (this=this@entry=0x589eb928, pi=..., pit=, pit@entry=78, x=x@entry=0, y=y@entry=-21) at TextMetrics.cpp:1958 #22 0x55caf5b8 in lyx::TextMetrics::draw (this=this@entry=0x589eb928, pi=..., x=x@entry=0, y=y@entry=-21) at TextMetrics.cpp:1809 #23 0x55d09284 in lyx::BufferView::draw (this=0x57ded400, pain=..., paint_caret=) at BufferView.cpp:3342 #24 0x560b73ab in lyx::frontend::GuiWorkArea::paintEvent (this=0x57de59c0, ev=0x7fffd810) at GuiWorkArea.cpp:1257 -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Crash in equation paint (master)
Le 01/02/2021 à 11:36, Pavel Sanda a écrit : Struggling to find recipy, but already happened 3x in the morning while trying to merge changes from Phil's review: 1. Open math manual, go to the second table in 3.7 2. Open new window 2, open new file and starting to reproduce the formula 3. ctrl+m ^19 4. unclear sequence of these: a) backspace to delete 19, or type something again b) zoom in/zoom out c) switch to different window/workspace (the immediate crash trigger seems to be always when activating LyX window after wandering elsewhere) I'll take a look. It may be that the cache is cleared when zooming but the metrics are not rebuilt. JMarc It seems that cursor size and geometry gets sometimes wrong unless I start typing and things go immediately right. But sometimes it crashes. (is MathData::dimension dependent on zoom level?). I am not even sure that the first window is necessary, but it might be related because the zoom in/out changes the geometry in the first window as well... Instant preview is on. Will try to come up with better backtrace, but this is what I have now: CoordCache.cpp (25): break on pointer: 0x560af36eb560 hint: dim size: 0 ( 1) src/lyx: lyx::doAssertWithCallstack(bool) ( 2) src/lyx: lyx::doBufErr(char const*, char const*, long) ( 3) src/lyx: lyx::lyxbreaker(void const*, char const*, int) ( 4) src/lyx: lyx::MathData::dimension(lyx::BufferView const&) const ( 5) src/lyx: lyx::InsetMathGrid::cellXOffset(lyx::BufferView const&, unsigned long) const ( 6) src/lyx: lyx::InsetMathGrid::draw(lyx::PainterInfo&, int, int) const ( 7) src/lyx: lyx::InsetMathHull::draw(lyx::PainterInfo&, int, int) const ( 8) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const ( 9) src/lyx: lyx::RowPainter::paintText() ( 10) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int ) const ( 11) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const ( 12) src/lyx: lyx::InsetText::draw(lyx::PainterInfo&, int, int) const ( 13) src/lyx: lyx::InsetTabular::draw(lyx::PainterInfo&, int, int) const ( 14) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const ( 15) src/lyx: lyx::RowPainter::paintText() ( 16) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int ) const ( 17) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const ( 18) src/lyx: lyx::BufferView::draw(lyx::frontend::Painter&, bool) ( 19) src/lyx: lyx::frontend::GuiWorkArea::paintEvent(QPaintEvent*) ( 20) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QWidget::event(QEvent*) ( 21) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QFrame::event(QEvent*) ( 22) /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendTh roughObjectEventFilters(QObject*, QEvent*) ( 23) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QApplicationPrivate::notify_ Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Crash in equation paint (master)
Struggling to find recipy, but already happened 3x in the morning while trying to merge changes from Phil's review: 1. Open math manual, go to the second table in 3.7 2. Open new window 2, open new file and starting to reproduce the formula 3. ctrl+m ^19 4. unclear sequence of these: a) backspace to delete 19, or type something again b) zoom in/zoom out c) switch to different window/workspace (the immediate crash trigger seems to be always when activating LyX window after wandering elsewhere) It seems that cursor size and geometry gets sometimes wrong unless I start typing and things go immediately right. But sometimes it crashes. (is MathData::dimension dependent on zoom level?). I am not even sure that the first window is necessary, but it might be related because the zoom in/out changes the geometry in the first window as well... Instant preview is on. Will try to come up with better backtrace, but this is what I have now: CoordCache.cpp (25): break on pointer: 0x560af36eb560 hint: dim size: 0 ( 1) src/lyx: lyx::doAssertWithCallstack(bool) ( 2) src/lyx: lyx::doBufErr(char const*, char const*, long) ( 3) src/lyx: lyx::lyxbreaker(void const*, char const*, int) ( 4) src/lyx: lyx::MathData::dimension(lyx::BufferView const&) const ( 5) src/lyx: lyx::InsetMathGrid::cellXOffset(lyx::BufferView const&, unsigned long) const ( 6) src/lyx: lyx::InsetMathGrid::draw(lyx::PainterInfo&, int, int) const ( 7) src/lyx: lyx::InsetMathHull::draw(lyx::PainterInfo&, int, int) const ( 8) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const ( 9) src/lyx: lyx::RowPainter::paintText() ( 10) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int ) const ( 11) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const ( 12) src/lyx: lyx::InsetText::draw(lyx::PainterInfo&, int, int) const ( 13) src/lyx: lyx::InsetTabular::draw(lyx::PainterInfo&, int, int) const ( 14) src/lyx: lyx::RowPainter::paintInset(lyx::Row::Element const&) const ( 15) src/lyx: lyx::RowPainter::paintText() ( 16) src/lyx: lyx::TextMetrics::drawParagraph(lyx::PainterInfo&, long, int, int ) const ( 17) src/lyx: lyx::TextMetrics::draw(lyx::PainterInfo&, int, int) const ( 18) src/lyx: lyx::BufferView::draw(lyx::frontend::Painter&, bool) ( 19) src/lyx: lyx::frontend::GuiWorkArea::paintEvent(QPaintEvent*) ( 20) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QWidget::event(QEvent*) ( 21) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QFrame::event(QEvent*) ( 22) /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: QCoreApplicationPrivate::sendTh roughObjectEventFilters(QObject*, QEvent*) ( 23) /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: QApplicationPrivate::notify_ Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel