On Tue, May 31, 2016 at 01:15:38AM +0200, Guillaume Munch wrote:
> commit 1cc14a31ca8320d881b674f93c34a09cf1666cca
> Author: Guillaume Munch <g...@lyx.org>
> Date:   Mon May 30 21:42:08 2016 +0100
> 
>     TocWidget: fix an erroneous collapse and optimise updates based on 
> profiling
>     
>     TocModels::reset() in GuiView::structureChanged() collapses the 
> TocWidget, and
>     therefore requires an update right after, which was missing.
>     
>     In fact, profiling TocWidget::updateView() shows that delaying the update 
> is
>     good only for fast keypresses (essentially movement). It costs 5% of a
>     char-forward operation in a document with approx. 100 table of contents
>     items. The update optimisation has been rewritten to take this data into
>     account.

A git bisect suggests this causes a SIGSEGV. To reproduce:

1. open the attached file
2. open the outline pane
3. put the cursor just to the left of "Hello" (but inside the caption inset)
4. "Save As" to a new filename.

Can you reproduce?

Backtrace is attached.

Scott
#0  0x0000000000c95c56 in lyx::DocIterator::inTexted (this=0x7fffffff8d00) at 
/home/scott/lyxbuilds/master/repo/src/DocIterator.h:143
#1  0x0000000000ed289f in lyx::DocIterator::getInnerText (this=0x2d84ac8) at 
/home/scott/lyxbuilds/master/repo/src/DocIterator.cpp:232
#2  0x0000000000eb3423 in lyx::TocBackend::findItem (toc=std::vector of length 
1, capacity 1 = {...}, dit=...)
    at /home/scott/lyxbuilds/master/repo/src/TocBackend.cpp:112
#3  0x0000000001307b56 in lyx::frontend::TocModel::modelIndex (this=0x2eca980, 
dit=...)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocModel.cpp:129
#4  0x0000000001308de9 in lyx::frontend::TocModels::currentIndex 
(this=0x2420c28, type=...)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocModel.cpp:304
#5  0x00000000012fb498 in lyx::frontend::TocWidget::finishUpdateView 
(this=0x24fcf50)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocWidget.cpp:461
#6  0x00000000012fb377 in lyx::frontend::TocWidget::updateView (this=0x24fcf50)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocWidget.cpp:437
#7  0x00000000012fb3e5 in lyx::frontend::TocWidget::updateViewNow 
(this=0x24fcf50)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocWidget.cpp:446
#8  0x00000000012fbe66 in lyx::frontend::TocWidget::init (this=0x24fcf50, 
str=...)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/TocWidget.cpp:535
#9  0x0000000001204f1e in lyx::frontend::GuiToc::initialiseParams 
(this=0x253b880, data="")
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiToc.cpp:58
#10 0x00000000011cc350 in lyx::frontend::GuiView::updateDialog (this=0x24bd7b0, 
name="toc", data="")
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiView.cpp:1675
#11 0x00000000011cc1a6 in lyx::frontend::GuiView::structureChanged 
(this=0x24bd7b0)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiView.cpp:1660
#12 0x0000000000e266bd in lyx::Buffer::structureChanged (this=0x2bd8f20) at 
/home/scott/lyxbuilds/master/repo/src/Buffer.cpp:3830
#13 0x0000000000e2c885 in lyx::Buffer::updateBuffer (this=0x2bd8f20, 
scope=lyx::Buffer::UpdateMaster, utype=lyx::InternalUpdate)
    at /home/scott/lyxbuilds/master/repo/src/Buffer.cpp:4625
#14 0x0000000000c6c3fa in lyx::Buffer::updateBuffer (this=0x2bd8f20) at 
/home/scott/lyxbuilds/master/repo/src/Buffer.h:724
#15 0x0000000000e2e5ff in lyx::Buffer::reload (this=0x2bd8f20) at 
/home/scott/lyxbuilds/master/repo/src/Buffer.cpp:5017
#16 0x00000000011d3d12 in lyx::frontend::GuiView::renameBuffer (this=0x24bd7b0, 
b=..., newname=L"", kind=lyx::frontend::GuiView::LV_WRITE_AS)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiView.cpp:2565
#17 0x00000000011dd5d4 in lyx::frontend::GuiView::dispatch (this=0x24bd7b0, 
cmd=..., dr=...)
    at /home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiView.cpp:3745
#18 0x00000000011afb30 in lyx::frontend::GuiApplication::dispatch 
(this=0x1fb84b0, cmd=..., dr=...)
    at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiApplication.cpp:2078
#19 0x00000000011ab953 in lyx::frontend::GuiApplication::dispatch 
(this=0x1fb84b0, cmd=...)
    at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiApplication.cpp:1397
#20 0x0000000000f0a99e in lyx::dispatch (action=...) at 
/home/scott/lyxbuilds/master/repo/src/LyX.cpp:1404
#21 0x000000000146246e in lyx::frontend::Action::action (this=0x2dc50c0) at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/Action.cpp:87
#22 0x000000000146251c in lyx::frontend::Action::qt_static_metacall 
(_o=0x2dc50c0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffffffbfa0)
    at 
/home/scott/lyxbuilds/master/CMakeBuild/src/frontends/qt4/moc_Action.cpp:80
#23 0x00007ffff621d012 in QMetaObject::activate (sender=0x2dc50c0, 
signalOffset=3, local_signal_index=1, argv=0x7fffffffbfa0)
    at /usr/src/qt/qt5/qtbase/src/corelib/kernel/qobject.cpp:3730
#24 0x00007ffff621c7f8 in QMetaObject::activate (sender=0x2dc50c0, 
m=0x7ffff7506ae0 <QAction::staticMetaObject>, local_signal_index=1, 
    argv=0x7fffffffbfa0) at 
/usr/src/qt/qt5/qtbase/src/corelib/kernel/qobject.cpp:3595
#25 0x00007ffff6e1d9fb in QAction::triggered (this=0x2dc50c0, _t1=false) at 
.moc/moc_qaction.cpp:372
#26 0x00007ffff6e1cab3 in QAction::activate (this=0x2dc50c0, 
event=QAction::Trigger) at 
/usr/src/qt/qt5/qtbase/src/widgets/kernel/qaction.cpp:1163
#27 0x00007ffff7026531 in QMenuPrivate::activateCausedStack (this=0x253be20, 
causedStack=..., action=0x2dc50c0, action_e=QAction::Trigger, self=true)
    at /usr/src/qt/qt5/qtbase/src/widgets/widgets/qmenu.cpp:1130
#28 0x00007ffff7026954 in QMenuPrivate::activateAction (this=0x253be20, 
action=0x2dc50c0, action_e=QAction::Trigger, self=true)
    at /usr/src/qt/qt5/qtbase/src/widgets/widgets/qmenu.cpp:1207
#29 0x00007ffff702b2cf in QMenu::mouseReleaseEvent (this=0x253a440, 
e=0x7fffffffcb90) at /usr/src/qt/qt5/qtbase/src/widgets/widgets/qmenu.cpp:2634
#30 0x00007ffff6e86bd7 in QWidget::event (this=0x253a440, event=0x7fffffffcb90) 
at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8748
#31 0x00007ffff702bc0d in QMenu::event (this=0x253a440, e=0x7fffffffcb90) at 
/usr/src/qt/qt5/qtbase/src/widgets/widgets/qmenu.cpp:2753
#32 0x00007ffff6e2f63a in QApplicationPrivate::notify_helper (this=0x1fb8ec0, 
receiver=0x253a440, e=0x7fffffffcb90)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3804
#33 0x00007ffff6e2d0cf in QApplication::notify (this=0x1fb84b0, 
receiver=0x253a440, e=0x7fffffffcb90)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3277
#34 0x00000000011b3c4e in lyx::frontend::GuiApplication::notify 
(this=0x1fb84b0, receiver=0x253a440, event=0x7fffffffcb90)
    at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiApplication.cpp:2699
#35 0x00007ffff61d8027 in QCoreApplication::notifyInternal2 
(receiver=0x253a440, event=0x7fffffffcb90)
    at /usr/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1015
#36 0x00007ffff6e32842 in QCoreApplication::sendSpontaneousEvent 
(receiver=0x253a440, event=0x7fffffffcb90)
    at 
../../include/QtCore/../../../../../src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.h:228
#37 0x00007ffff6e2b9cf in QApplicationPrivate::sendMouseEvent 
(receiver=0x253a440, event=0x7fffffffcb90, alienWidget=0x0, 
nativeWidget=0x253a440, 
    buttonDown=0x7ffff7535c80 <qt_button_down>, lastMouseReceiver=..., 
spontaneous=true)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2773
#38 0x00007ffff6eb6335 in QWidgetWindow::handleMouseEvent (this=0x24d8590, 
event=0x7fffffffd2f0)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:501
#39 0x00007ffff6eb56e0 in QWidgetWindow::event (this=0x24d8590, 
event=0x7fffffffd2f0)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:233
#40 0x00007ffff6e2f63a in QApplicationPrivate::notify_helper (this=0x1fb8ec0, 
receiver=0x24d8590, e=0x7fffffffd2f0)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3804
#41 0x00007ffff6e2c883 in QApplication::notify (this=0x1fb84b0, 
receiver=0x24d8590, e=0x7fffffffd2f0)
    at /usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3163
#42 0x00000000011b3c4e in lyx::frontend::GuiApplication::notify 
(this=0x1fb84b0, receiver=0x24d8590, event=0x7fffffffd2f0)
    at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiApplication.cpp:2699
#43 0x00007ffff61d8027 in QCoreApplication::notifyInternal2 
(receiver=0x24d8590, event=0x7fffffffd2f0)
    at /usr/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1015
#44 0x00007ffff66268fe in QCoreApplication::sendSpontaneousEvent 
(receiver=0x24d8590, event=0x7fffffffd2f0)
    at 
../../include/QtCore/../../../../../src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.h:228
#45 0x00007ffff661edeb in QGuiApplicationPrivate::processMouseEvent 
(e=0x2d88530) at /usr/src/qt/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1877
#46 0x00007ffff661e201 in QGuiApplicationPrivate::processWindowSystemEvent 
(e=0x2d88530)
    at /usr/src/qt/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1661
#47 0x00007ffff65ffe2f in QWindowSystemInterface::sendWindowSystemEvents 
(flags=...)
    at /usr/src/qt/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:648
#48 0x00007fffedbbacec in userEventSourceDispatch (source=0x1fe78c0)
    at 
/usr/src/qt/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:70
#49 0x00007ffff476d1a7 in g_main_context_dispatch () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#50 0x00007ffff476d400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#51 0x00007ffff476d4ac in g_main_context_iteration () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#52 0x00007ffff625c676 in QEventDispatcherGlib::processEvents (this=0x1feb580, 
flags=...)
    at /usr/src/qt/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:417
#53 0x00007fffedbbaf1c in QPAEventDispatcherGlib::processEvents 
(this=0x1feb580, flags=...)
    at 
/usr/src/qt/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:115
#54 0x00007ffff61d4672 in QEventLoop::processEvents (this=0x7fffffffd770, 
flags=...) at /usr/src/qt/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:128
#55 0x00007ffff61d49a9 in QEventLoop::exec (this=0x7fffffffd770, flags=...) at 
/usr/src/qt/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:204
#56 0x00007ffff61d881d in QCoreApplication::exec () at 
/usr/src/qt/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1285
#57 0x00007ffff661e022 in QGuiApplication::exec () at 
/usr/src/qt/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1607
#58 0x00007ffff6e2c233 in QApplication::exec () at 
/usr/src/qt/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2979
#59 0x00000000011b21b3 in lyx::frontend::GuiApplication::exec (this=0x1fb84b0)
    at 
/home/scott/lyxbuilds/master/repo/src/frontends/qt4/GuiApplication.cpp:2465
#60 0x0000000000f020a9 in lyx::LyX::exec (this=0x7fffffffd950, 
argc=@0x7fffffffd94c: 2, argv=0x7fffffffda68)
    at /home/scott/lyxbuilds/master/repo/src/LyX.cpp:364
#61 0x0000000000c82bb9 in main (argc=2, argv=0x7fffffffda68) at 
/home/scott/lyxbuilds/master/repo/src/main.cpp:42

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 1
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Subsection
Test
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
Hello
\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\end_body
\end_document

Attachment: signature.asc
Description: PGP signature

Reply via email to