Le 03/11/2015 18:13, LyX Ticket Tracker a écrit :
#9840: Instant preview when leaving math inset becomes freezingly
slow after a while ---------------------+------------------------
Reporter: gadmm | Owner: lasgouttes Type: defect | Status: new
Priority: normal | Milestone: 2.2.0 Component: general | Version:
2.1.Xdev Severity: normal | Keywords:
---------------------+------------------------ I noticed that, after
some time of the same LyX session running, leaving a math inset when
instant preview is on becomes painfully slow, to the point where LyX
freezes and is "greyed-out" by the OS (indicating non-
responsiveness). But, preview generation is supposed to be
asynchronous.

Here are two (identical) backtraces that I had the time to take while
waiting for LyX to become responsive again.

{{{ #0 0x00007f91135ead3e in __libc_fork () at
../sysdeps/nptl/fork.c:124 #1 0x0000000000d15225 in
lyx::support::ForkedCall::generateChild ( this=0x7ffcfc5b21f0) at
ForkedCalls.cpp:459 #2 0x0000000000d119df in
lyx::support::ForkedProcess::run ( this=this@entry=0x7ffcfc5b21f0,
type=type@entry=lyx::support::ForkedProcess::DontWait) at
ForkedCalls.cpp:132 #3 0x0000000000d11ae9 in
lyx::support::ForkedCall::startScript(std::string const&,
std::shared_ptr<boost::signal<void (int, int),
boost::last_value<void>, int, std::less<int>, boost::function<void
(int, int)> > >) ...


From http://www.lyx.org/trac/ticket/9840

Scott asked if somebody was going to solve this for 2.2.0. I replied
that this was serious enough to have this triaged on the basis of an
informed decision.

This bug happens because LyX uses fork() as a means to exec() a child
process, and fork() can be slow under certain circumstances on Linux
(here it gets slower and slower if we leave LyX open for too long).
Using fork() seems overkill to me and there seems (to me) to be
alternatives (notably QProcess which is cross-platform and would let us
get rid of lots of platform-specific code). There also seem to be quick
workarounds described in links I gave in the ticket.

Given that LyX does not remember the split views on opening (hello
#7054), I tend to leave LyX open and hibernate instead of shutting down,
so this happens to me systematically.

I did my part of the research and I do not know LyX enough to
confidently alter cross-platform-critical code. Anybody has an idea?


Guillaume

Reply via email to