Metrics-related crashes in branch

Pavel Sanda sanda at lyx.org
Fri Jan 10 10:23:09 UTC 2025


On Thu, Jan 09, 2025 at 03:22:34PM +0100, Jean-Marc Lasgouttes wrote:
> Le 21/12/2024 ?? 19:15, Pavel Sanda a écrit :
> > Actually you are right, once the figures are loaded, the caret tends to
> > stay on similar position of the screen. But not initially, it probably
> > gets shifted by the onloading of images above.
> 
> I pushed a solution to master at 0fa3aba5c6e, if it works well it should go
> to branch too. Most of the patch is an improvement, I only have a doubt
> about Cursor::saveBeforeDispatchPosXY, but the return value was probably
> bogus in cases that assert now.
> 
> The big issue here is to know whether there can be cases where the cursor is
> out of screen, either from the preview trick or maybe scrolling without
> "cursor follows scrollbar". I am still unsure about what we have to fear,
> there are places in code (look at calls to getPos()) that have a crash
> potential.

As it happens I have troubles to get my own recipy reliably working in (unupdated)
master (mainly due to the fact that I can't get the pg-down to jump to first line
of 1.4 anymore. Why oh why?
But I was able to trigger in branch the recipy above in 66% of trials.
After applying 0fa3aba5c6e to branch the crash ratio went down 10% (i.e. 1 in 10 cases tried).

Why we see such randomness at all is not clear to me, perhaps the way how previews
are tiggered and precise timing of page-down scrolling matters.

In any case the assert is not completely gone, but seems way harder to trigger.
But it maybe harder only in this specific recipy, some specific scroll with
the mouse could happen in that one particular cases, who knows.

Pavel


More information about the lyx-devel mailing list