Re: Crash when changing shortcut bind file

2022-03-10 Thread Jean-Marc Lasgouttes

Le 08/03/2022 à 16:53, Scott Kostyshak a écrit :

On Tue, Mar 08, 2022 at 04:43:38PM +0100, Kornel Benko wrote:

Open UserGuide.lyx
goto 2.1 Basic File Operations, so that some shortcuts are visible
change the bind-file from cua to emacs
Tools-Preferences...->Editing->Shortcuts->Bind file: emacs ==> crash


I can reproduce. In addition to a SIGSEGV, I get the following output that 
perhaps is useful:

   /home/scott/lyxbuilds/master-master/repo/src/Paragraph.cpp:4283:12: runtime 
error: member access within misaligned address 0x0065006f for type 'struct 
Private', which requires 8 byte alignment
   0x0065006f: note: pointer points here
   


This is the result of the InsetInfo mess. This inset is hackish in 
various ways. In 12dfdbf0a3e6, I have tried a new strategy, we'll see 
whether  it works. I am reasonably confident, but not totally. Something 
had to be done anyway (see commit message below).


Testing welcome.

JMarc

commit 12dfdbf0a3e667544fd3f0af7fe86b26909fd6a0
Author: Jean-Marc Lasgouttes 
Date:   Thu Mar 10 12:19:44 2022 +0100

Fix crash in InsetInfo when bindings change

This is actually a generic InsetInfo issue:

1/ the contents of the inset is computed in updateBuffer, so that it
   is available for drawing but also for latex output (think batch
   export). When it is called, it deletes the existing inner paragraph
   and replaces it by a new one

2/ metrics build a new Row object that represents to paragraph

3/ draw() relies on this information

Now, imagine that updateBuffer() is called after metrics(). This can
happen for many reasons, and does happen here (display a shortcut info
and change the shortcut file from cua to emacs).

This problem has been here forever, but is only visible now that the
(experimental) bookmark display code needs to read the underlying
paragraph id.

The solution is to compute the inset contents at metrics time. This
is done by moving the relevant code to a new standalone build() method
that is called in metrics() but also in latex().
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Crash when changing shortcut bind file

2022-03-08 Thread Scott Kostyshak
On Tue, Mar 08, 2022 at 04:43:38PM +0100, Kornel Benko wrote:
> Open UserGuide.lyx
> goto 2.1 Basic File Operations, so that some shortcuts are visible
> change the bind-file from cua to emacs
>   Tools-Preferences...->Editing->Shortcuts->Bind file: emacs ==> crash

I can reproduce. In addition to a SIGSEGV, I get the following output that 
perhaps is useful:

  /home/scott/lyxbuilds/master-master/repo/src/Paragraph.cpp:4283:12: runtime 
error: member access within misaligned address 0x0065006f for type 'struct 
Private', which requires 8 byte alignment
  0x0065006f: note: pointer points here
  

And also:

  QBackingStore::endPaint() called with active painter; did you forget to 
destroy it or call QPainter::end() on it?

Scott

> The other way e.g. emacs->cua does not crash.
> 
>   Kornel
> 
> -- 
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel



> -- 
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel



signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Crash when changing shortcut bind file

2022-03-08 Thread Kornel Benko
Open UserGuide.lyx
goto 2.1 Basic File Operations, so that some shortcuts are visible
change the bind-file from cua to emacs
Tools-Preferences...->Editing->Shortcuts->Bind file: emacs ==> crash

The other way e.g. emacs->cua does not crash.

Kornel

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


pgp0iTsZtCvBO.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel