Crash on master because of cursor position in session

Scott Kostyshak skostysh at lyx.org
Sun Jan 16 04:11:49 UTC 2022


On Sat, Jan 15, 2022 at 05:48:55PM +0100, Kornel Benko wrote:
> Am Sat, 15 Jan 2022 10:02:05 -0500
> schrieb Scott Kostyshak <skostysh at lyx.org>:
> 
> > On Sat, Jan 15, 2022 at 10:13:10AM +0100, Kornel Benko wrote:
> > > Am Fri, 14 Jan 2022 07:50:27 -0500
> > > schrieb Scott Kostyshak <skostysh at lyx.org>:
> > >   
> > > > On Wed, Jan 12, 2022 at 09:24:08AM +0100, Kornel Benko wrote:  
> > > > > Am Tue, 11 Jan 2022 14:43:01 -0500
> > > > > schrieb Scott Kostyshak <skostysh at lyx.org>:
> > > > >     
> > > > > > To reproduce on current master:
> > > > > > 
> > > > > > 1. Open the attached file.
> > > > > > 2. Move cursor to just in front of the second comment inset.
> > > > > > 3. Exit LyX.
> > > > > > 4. Open the file again.
> > > > > > 
> > > > > > LyX has caught an exception, it will now attempt to save all unsaved documents
> > > > > > and exit.
> > > > > > 
> > > > > > Exception: basic_string::substr: __pos (which is 44) > this->size() (which is
> > > > > > 43)
> > > > > > 
> > > > > > Can anyone reproduce?
> > > > > > 
> > > > > > Scott    
> > > > > 
> > > > > Neither with lyx2.4 compiled with -fsanitize flag, nor without.
> > > > > 
> > > > > I tried also lyx2.3, but still no crash here.
> > > > > 
> > > > > 	Kornel    
> > > > 
> > > > Thanks for trying.
> > > > 
> > > > I can only reproduce it with a specific ~/.config/LyX/lyx.conf.
> > > > 
> > > > If I exit LyX and remove that file, then I can no longer reproduce.
> > > > 
> > > > Not sure it's worth looking into since probably that lyx.conf was made with previous
> > > > dev versions.
> > > > 
> > > > Scott  
> > > 
> > > I think, it is worth to know the specific entry causing the behaviour.
> > > Maybe the difference between the two conf files could also help.  
> > 
> > Makes sense. I will dig some more. I'll try to reproduce on a separate session and
> > narrow it down to which lines in the conf trigger the issue, and perhaps bisect if
> > relevant.
> > 
> > Scott
> 
> FWIW, I never use 'lyx' name only. Therefore I do not have any 'lyx.conf' file,
> my configs are named
>  $  ls -l .config/*/ly*
> -rw-rw-r-- 1 kornel kornel 6015 Jun 10  2021 .config/LyX/lyx2.2.conf
> -rw-rw-r-- 1 kornel kornel 8997 Jan 12 09:23 .config/LyX/lyx2.3.conf
> -rw-rw-r-- 1 kornel kornel 9386 Jan 12 21:08 .config/LyX/lyx2.4.conf
> 
> This may be the reason that I did not have these problems.

This is indeed a good idea.

The key difference in the conf files is the zoom_ratio line. I can now
reproduce the issue with a fresh conf file:

1. Open the attached file.
2. Move cursor to just in front of the second comment inset.
2.5 Zoom in a ways.
3. Exit LyX.
4. Open the file again.

Can you try to reproduce with this modified recipe? How much to zoom in
depends on screen resolution, etc. Maybe try 200% and if that doesn't
work try 400%.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220115/0b758046/attachment.asc>


More information about the lyx-devel mailing list