Post by Enrico ForestieriPost by Richard HeckPost by Enrico ForestieriHowever, things may be more complicated than that. For example, when
applying the layout3.diff patch attached to bug 9236, I always get
a warning when copying or cutting something, meaning that a dangling
pointer is in existance.
This is only without my patch or also with it?
It makes no difference. The involved pointers are different from the
ones involved in the hidden cells of a tabular, seemingly.
However, the patch attached to 9049 does not really work, as you
already noted ealier in this thread. I used a modified version
taking into account Jürgen suggestion and your directions.
I suggest that you update the patch on track.
I fixed a stupid thinko that was revealed by your debugging patch:
copying a layout instead of using a const ref. Probably not related, though.
I can get a crash on my 9049.lyx file just when copying the table, with
or without my patch. It's unpredictable, though. If I hold down ctrl-C
for long enough, though, it will crash.
I'm not sure how helpful the backtrace (below) is, but it is happening
in an InsetTableCell: In the destructor of its contained Paragraph. I
wonder if there is something wrong with the copying of pargraphs that
happens when we copy the table, e.g., we miss the paragraphs in the
hidden cells for some reason, and so we double delete or something?
Richard
=====
0 std::_Rb_tree... 0x639c75
1 clear stl_tree.h 860 0x63050d
2 clear stl_map.h 789 0x63050d
3 clear map.h 372 0x63050d
4 lyx::Paragraph::deregisterWords Paragraph.cpp 3784 0x63050d
5 lyx::Paragraph::~Paragraph Paragraph.cpp 1599 0x630a47
6 destroy new_allocator.h 133 0x46931b
7 std::__cxx1998::_List_base<lyx::Paragraph,
std::allocator<lyx::Paragraph> >::_M_clear list.tcc 77 0x46931b
8 ~_List_base stl_list.h 378 0x91adfb
9 ~list stl_list.h 438 0x91adfb
10 ~list list 120 0x91adfb
11 ~RandomAccessList RandomAccessList.h 41 0x91adfb
12 ~ParagraphList ParagraphList.h 23 0x91adfb
13 ~Text Text.h 41 0x91adfb
14 ~InsetText InsetText.h 33 0x91adfb
15 ~InsetTableCell InsetTabular.h 52 0x91adfb
16 lyx::InsetTableCell::~InsetTableCell InsetTabular.h 52 0x91adfb
17 operator() shared_ptr.h 285 0x918b17
18 std::tr1::_Sp_counted_base_impl<lyx::InsetTableCell*,
std::tr1::_Sp_deleter<lyx::InsetTableCell>,
(__gnu_cxx::_Lock_policy)2>::_M_dispose shared_ptr.h 257 0x918b17
19 _M_release shared_ptr.h 141 0x9199b7
20 ~__shared_count shared_ptr.h 341 0x9199b7
21 ~__shared_ptr shared_ptr.h 541 0x9199b7
22 ~shared_ptr shared_ptr.h 985 0x9199b7
23 ~CellData InsetTabular.h 618 0x9199b7
24 _Destroy<lyx::Tabular::CellData> stl_construct.h 93 0x9199b7
25 __destroy<lyx::Tabular::CellData*> stl_construct.h 103 0x9199b7
26 _Destroy<lyx::Tabular::CellData*> stl_construct.h 126 0x9199b7
27 _Destroy<lyx::Tabular::CellData*, lyx::Tabular::CellData>
stl_construct.h 151 0x9199b7
28 ~vector stl_vector.h 415 0x9199b7
29 ~vector vector 144 0x9199b7
30 _Destroy<std::__debug::vector<lyx::Tabular::CellData> >
stl_construct.h 93 0x9199b7
31 __destroy<std::__debug::vector<lyx::Tabular::CellData>*>
stl_construct.h 103 0x9199b7
32 _Destroy<std::__debug::vector<lyx::Tabular::CellData>*>
stl_construct.h 126 0x9199b7
33 _Destroy<std::__debug::vector<lyx::Tabular::CellData>*,
std::__debug::vector<lyx::Tabular::CellData> > stl_construct.h 151
0x9199b7
34 ~vector stl_vector.h 415 0x9199b7
35 ~vector vector 144 0x9199b7
36 lyx::Tabular::~Tabular InsetTabular.h 126 0x9199b7
37 lyx::InsetTabular::~InsetTabular InsetTabular.cpp 3471 0x8ffc62
38 lyx::InsetTabular::~InsetTabular InsetTabular.cpp 3474 0x8ffcb3
39 lyx::InsetList::~InsetList InsetList.cpp 75 0x71c0d8
40 lyx::Paragraph::Private::~Private Paragraph.cpp 593 0x630944
41 lyx::Paragraph::~Paragraph Paragraph.cpp 1600 0x630a58
42 destroy new_allocator.h 133 0x46931b
43 std::__cxx1998::_List_base<lyx::Paragraph,
std::allocator<lyx::Paragraph> >::_M_clear list.tcc 77 0x46931b
44 ~_List_base stl_list.h 378 0x843e1a
45 ~list stl_list.h 438 0x843e1a
46 ~list list 120 0x843e1a
47 ~RandomAccessList RandomAccessList.h 41 0x843e1a
48 ~ParagraphList ParagraphList.h 23 0x843e1a
49 ~Text Text.h 41 0x843e1a
50 ~InsetText InsetText.h 33 0x843e1a
51 lyx::InsetCollapsable::~InsetCollapsable InsetCollapsable.cpp
65 0x843e1a
52 ~InsetFloat InsetFloat.h 50 0x86146b
53 lyx::InsetFloat::~InsetFloat InsetFloat.h 50 0x86146b
54 lyx::InsetList::~InsetList InsetList.cpp 75 0x71c0d8
55 lyx::Paragraph::Private::~Private Paragraph.cpp 593 0x630944
56 lyx::Paragraph::~Paragraph Paragraph.cpp 1600 0x630a58
57 destroy new_allocator.h 133 0x46931b
58 std::__cxx1998::_List_base<lyx::Paragraph,
std::allocator<lyx::Paragraph> >::_M_clear list.tcc 77 0x46931b
59 ~_List_base stl_list.h 378 0x4693de
60 ~list stl_list.h 438 0x4693de
61 ~list list 120 0x4693de
62 lyx::RandomAccessList<lyx::Paragraph>::~RandomAccessList
RandomAccessList.h 41 0x4693de
63 ~ParagraphList ParagraphList.h 23 0x535bd1
64 lyx::(anonymous namespace)::pasteSelectionHelper
CutAndPaste.cpp 432 0x535bd1
65 lyx::(anonymous namespace)::putClipboard CutAndPaste.cpp 509
0x538825
66 lyx::cap::copySelection CutAndPaste.cpp 997 0x539b3e
67 lyx::cap::copySelection CutAndPaste.cpp 898 0x539c01
68 lyx::Text::dispatch Text3.cpp 1310 0x67ab97
69 lyx::InsetText::doDispatch InsetText.cpp 313 0x922548
70 lyx::Inset::dispatch Inset.cpp 319 0x81ad3c
71 lyx::Cursor::dispatch Cursor.cpp 399 0x52b158
72 lyx::frontend::GuiView::dispatchToBufferView GuiView.cpp
3279 0x97ddd6
73 lyx::frontend::GuiView::dispatch GuiView.cpp 3828 0x9959e1
74 lyx::frontend::GuiApplication::dispatch GuiApplication.cpp
1987 0x96285c
75 lyx::frontend::GuiApplication::dispatch GuiApplication.cpp
1337 0x9536a6
76 lyx::dispatch LyX.cpp 1303 0x5c9b3e
77 processFuncRequest GuiApplication.cpp 2125 0x955951
78 lyx::frontend::GuiApplication::processKeySym GuiApplication.cpp
2119 0x955951
79 lyx::frontend::GuiWorkArea::processKeySym GuiWorkArea.cpp
505 0x9a7e4f
80 lyx::frontend::GuiWorkArea::keyPressEvent GuiWorkArea.cpp
1080 0x9aa5df
81 QWidget::event(QEvent*) /lib64/libQtGui.so.4 0x3ad481dbc5
82 QFrame::event(QEvent*) /lib64/libQtGui.so.4 0x3ad4bd444e
83 QAbstractScrollArea::event(QEvent*) /lib64/libQtGui.so.4
0x3ad4c57873
84 lyx::frontend::GuiWorkArea::event GuiWorkArea.cpp 721 0x9aac8a
85 QApplicationPrivate::notify_helper(QObject*, QEvent*)
/lib64/libQtGui.so.4 0x3ad47cae5c
86 QApplication::notify(QObject*, QEvent*) /lib64/libQtGui.so.4
0x3ad47d2a66
87 lyx::frontend::GuiApplication::notify GuiApplication.cpp
2491 0x963d5b
88 QCoreApplication::notifyInternal(QObject*, QEvent*)
/lib64/libQtCore.so.4 0x3ad41868fd
89 QKeyMapper::sendKeyEvent(QWidget*, bool, QEvent::Type, int,
QFlags<Qt::KeyboardModifier>, QString const&, bool, int, unsigned int,
unsigned int, unsigned int, bool*) /lib64/libQtGui.so.4 0x3ad4869f5a
90 QKeyMapperPrivate::translateKeyEvent(QWidget*, _XEvent const*,
bool) /lib64/libQtGui.so.4 0x3ad486a319
91 QApplication::x11ProcessEvent(_XEvent*) /lib64/libQtGui.so.4
0x3ad48453ff
92 x11EventSourceDispatch(_GSource*, int (*)(void*), void*)
/lib64/libQtGui.so.4 0x3ad486cac4
93 g_main_context_dispatch /lib64/libglib-2.0.so.0 0x334fe492a6
94 g_main_context_iterate.isra /lib64/libglib-2.0.so.0 0x334fe49628
95 g_main_context_iteration /lib64/libglib-2.0.so.0 0x334fe496dc
96
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
/lib64/libQtCore.so.4 0x3ad41b541e
97
QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
/lib64/libQtGui.so.4 0x3ad486cc46
98 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
/lib64/libQtCore.so.4 0x3ad418538f
99 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
/lib64/libQtCore.so.4 0x3ad41856dd
100 QCoreApplication::exec() /lib64/libQtCore.so.4 0x3ad418ada9
101 lyx::frontend::GuiApplication::exec GuiApplication.cpp 2289
0x951077
102 lyx::LyX::exec LyX.cpp 375 0x5d3d21
103 main main.cpp 42 0x43a118