Opened 15 years ago

Closed 15 years ago

#5447 closed defect (fixed)

Dropping a file on its own buffer crashes LyX

Reported by: sts@… Owned by: nobody@…
Priority: high Milestone: 1.6.1
Component: frontend-qt4 Version: 1.6.0svn
Severity: critical Keywords: crash patch
Cc: bewihelm@…, younes@…, hofbauer@…

Description

  1. Open a file xyz.lyx
  2. Change the buffer
  3. Drop the file from Finder/Explorer... on the BufferView
  4. LyX ask whether to reload. Click on reload
  5. Crash

Attachments (2)

asyncdrop.patch (1.8 KB ) - added by sts@… 15 years ago.
Handle the FuncRequest asynchronously
dispatchdelayed.patch (4.4 KB ) - added by sts@… 15 years ago.
Proper delayed dispatch mechanism

Download all attachments as: .zip

Change History (33)

comment:1 by sts@…, 15 years ago

Keywords: crash added

The reason is that the drop event comes from the BufferView and the event handler deletes the BufferView
at the same time.

comment:2 by sts@…, 15 years ago

Cc: younes@… added

comment:3 by sts@…, 15 years ago

Keywords: patch added

comment:4 by Juergen Spitzmueller, 15 years ago

Severity: majorcritical

crash is critical.

comment:5 by Juergen Spitzmueller, 15 years ago

Milestone: 1.6.0

comment:6 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

Anybody tested the patch?

Stefan

Am 03.11.2008 um 10:18 schrieb bugzilla-daemon@…:

#5447

j.spitzmueller@… changed:

What |Removed |Added


Severity|major |critical

Target Milestone|1.6.0

10:17 -------
crash is critical.


You reported the bug, or are watching the reporter.

comment:7 by ps@…, 15 years ago

is it mean to be tested on another platform than mac? (how?)

comment:8 by Richard Heck, 15 years ago

Here's what I can do in Linux, WITHOUT the patch:

Open File.lyx
File>New
Drop File.lyx onto the LyX window, pretty much anywhere
I'm switched to the File.lyx tab

If that's what causes the crash elsewhere, it's not present here.

comment:9 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:10 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:11 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:12 by lasgouttes, 15 years ago

I am not able to reproduce the crash in linux, so I cannot test.

However, I am surprised that the bufferview needs to be deleted. Where
does that happen?

comment:13 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:14 by sts@…, 15 years ago

If the buffer is the only one in the workarea, on reload the BufferView is destroyed because the old
buffer is closed. This gives the following backtrace:

#0 lyx::BufferView::~BufferView (this=0x195a0b30) at /Users/sts/Quellen/mac/lyx-scope-
dynmacro/src/BufferView.cpp:296
#1 0x004de1fc in lyx::frontend::GuiWorkArea::~GuiWorkArea (this=0x1959f710) at
/Users/sts/Quellen/mac/lyx-scope-dynmacro/src/frontends/qt4/GuiWorkArea.cpp:312
#2 0x004e0a81 in lyx::frontend::TabWorkArea::removeWorkArea (this=0x19596100,
work_area=0x1959f710) at /Users/sts/Quellen/mac/lyx-scope-
dynmacro/src/frontends/qt4/GuiWorkArea.cpp:1351
#3 0x004c0efc in lyx::frontend::GuiView::removeWorkArea (this=0xf553050, wa=0x1959f710) at
/Users/sts/Quellen/mac/lyx-scope-dynmacro/src/frontends/qt4/GuiView.cpp:912
#4 0x004daadf in lyx::frontend::GuiWorkArea::close (this=0x1959f710) at
/Users/sts/Quellen/mac/lyx-scope-dynmacro/src/frontends/qt4/GuiWorkArea.cpp:328
#5 0x00333389 in lyx::frontend::WorkAreaManager::closeAll (this=0x1958a9b0) at
/Users/sts/Quellen/mac/lyx-scope-dynmacro/src/frontends/WorkAreaManager.cpp:45
#6 0x00037425 in lyx::Buffer::Impl::~Impl (this=0x28ab000) at /Users/sts/Quellen/mac/lyx-scope-
dynmacro/src/Buffer.cpp:135
#7 0x0001879c in lyx::Buffer::~Buffer (this=0x1958a2b0) at /Users/sts/Quellen/mac/lyx-scope-
dynmacro/src/Buffer.cpp:305
#8 0x0004386f in lyx::BufferList::release (this=0x2624024, buf=0x1958a2b0) at
/Users/sts/Quellen/mac/lyx-scope-dynmacro/src/BufferList.cpp:102
#9 0x0004041e in lyx::checkAndLoadLyXFile (filename=@0xbfffd5b0) at /Users/sts/Quellen/mac/lyx-
scope-dynmacro/src/buffer_funcs.cpp:76
#10 0x004c3046 in lyx::frontend::GuiView::loadDocument (this=0xf553050, filename=@0xbfffd5b0,
tolastfiles=true) at /Users/sts/Quellen/mac/lyx-scope-
dynmacro/src/frontends/qt4/GuiView.cpp:1269

comment:15 by sts@…, 15 years ago

And then after the upper ~BufferView call I get this, because the BufferView widget is deleted already:

#0 0x019be482 in QWidgetPrivate::qt_mac_dnd_event ()
#1 0x019c7f39 in QWidgetPrivate::qt_widget_event ()
#2 0x92aab303 in DispatchEventToHandlers ()
#3 0x92aaa73d in SendEventToEventTargetInternal ()
#4 0x92aaa5a2 in SendEventToEventTargetWithOptions ()
#5 0x92c31600 in SendControlDefDragReceive ()
#6 0x92c31502 in ControlDragReceiveHandler ()
#7 0x92c31477 in CarbonReceiveMapper ()
#8 0x96d0e55c in DoDropMessage ()

comment:16 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:17 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:18 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:19 by knauslists@…, 15 years ago

Subject: Re: Dropping a file on its own buffer crashes LyX

That's not enough I think. You have to open a file, modify the buffer
and then drop the file from the file manager on that buffer view.

comment:20 by hofbauer@…, 15 years ago

The proposed patch <http://bugzilla.lyx.org/attachment.cgi?id=2988&action=view>
does not work for me (also when applied in conjunction with the patch in bug
5387). patch against current svn (r27263) on 10.4.11

LyX still crashes when dragging onto itself a document that is already open and
modified.

Backtrace:
#0 0x92f61114 in HIView::DragLeave ()
#1 0x92f60642 in ControlDragTrackingHandler ()
#2 0x92f605a1 in InvokeDragTrackingHandlerUPP ()
#3 0x92f6049c in CarbonTrackingMapper ()
#4 0x917f640e in DoTrackingMessage ()
#5 0x917f924a in CoreDragMessageHandler ()
#6 0x90873b72 in CFMessagePortPerform ()
#7 0x9082c5a1 in CFRunLoopRunSpecific ()
#8 0x9082ba42 in CFRunLoopRunInMode ()
#9 0x003327d2 in ?? ()
#10 0x003672ed in ?? ()
#11 0x003674e6 in ?? ()
#12 0x0013e735 in ?? ()
#13 0x0000ff42 in ?? ()
#14 0x0000313e in ?? ()
#15 0x00002a7a in ?? ()
#16 0x000029a1 in ?? ()

comment:21 by hofbauer@…, 15 years ago

Cc: hofbauer@… added

comment:22 by hofbauer@…, 15 years ago

A new backtrace (compiled with debug symbols):

lassert.cpp(21): ASSERTION d->views_[gv->id()] == gv VIOLATED IN
GuiApplication.cpp:1333
Assertion triggered in void lyx::doAssert(const char*, const char*, long int) by
failing check "false" in file lassert.cpp:23

Program received signal SIGABRT, Aborted.
0x9003d66c in kill ()
(gdb) backtrace
#0 0x9003d66c in kill ()
#1 0x9010e8cf in raise ()
#2 0x9010d422 in abort ()
#3 0x0000bdb7 in ?? ()
#4 0x0004293d in ?? ()
#5 0x00053d13 in ?? ()
#6 0x0014e13c in ?? ()
#7 0x01852c5c in QWidget::event ()
#8 0x01b36896 in QMainWindow::event ()
#9 0x0014812e in ?? ()
#10 0x0181470e in QApplicationPrivate::notify_helper ()
#11 0x0181bdfc in QApplication::notify ()
#12 0x0005469a in ?? ()
#13 0x00ed334b in QCoreApplication::notifyInternal ()
#14 0x01851110 in QWidgetPrivate::close_helper ()
#15 0x018511b0 in QWidget::close ()
#16 0x0014834d in ?? ()
#17 0x001485ed in ?? ()
#18 0x00ee1fba in QMetaObject::activate ()
#19 0x0020a0a7 in ?? ()
#20 0x00141e8b in ?? ()
#21 0x00204e04 in ?? ()
#22 0x0010b479 in ?? ()
#23 0x0038a5b5 in lyx::Buffer::Impl::~Impl ()
#24 0x00036e92 in ?? ()
#25 0x00046090 in ?? ()
#26 0x000f0fa1 in ?? ()
#27 0x00142622 in ?? ()
#28 0x00146750 in ?? ()
#29 0x00055502 in ?? ()
#30 0x0006eb7c in ?? ()
#31 0x00009e65 in ?? ()
#32 0x00ee0439 in QObject::event ()
#33 0x018523a3 in QWidget::event ()
#34 0x01b36896 in QMainWindow::event ()
#35 0x0014812e in ?? ()
#36 0x0181470e in QApplicationPrivate::notify_helper ()
#37 0x0181bdfc in QApplication::notify ()
#38 0x0005469a in ?? ()
#39 0x00ed334b in QCoreApplication::notifyInternal ()
#40 0x00ed4207 in QCoreApplicationPrivate::sendPostedEvents ()
#41 0x00ed43d3 in QCoreApplication::sendPostedEvents ()
#42 0x0186e832 in QWidgetPrivate::qt_mac_dnd_event ()
#43 0x01877f73 in QWidgetPrivate::qt_widget_event ()
#44 0x92df64d7 in DispatchEventToHandlers ()
#45 0x92df5b7c in SendEventToEventTargetInternal ()
#46 0x92df5a41 in SendEventToEventTargetWithOptions ()
#47 0x92f614e2 in SendControlDefDragReceive ()
#48 0x92f613b2 in ControlDragReceiveHandler ()
#49 0x92f61381 in InvokeDragReceiveHandlerUPP ()
#50 0x92f6130c in CarbonReceiveMapper ()
#51 0x917f817d in DoDropMessage ()
#52 0x917f933d in CoreDragMessageHandler ()
#53 0x90873b72 in CFMessagePortPerform ()
#54 0x9082c5a1 in CFRunLoopRunSpecific ()
#55 0x9082ba42 in CFRunLoopRunInMode ()
#56 0x01869196 in QEventDispatcherMac::processEvents ()
#57 0x00ed2c11 in QEventLoop::processEvents ()
#58 0x00ed2e0a in QEventLoop::exec ()
#59 0x00ed4469 in QCoreApplication::exec ()
#60 0x00010d82 in ?? ()
#61 0x00003012 in ?? ()
#62 0x0000294e in ?? ()
#63 0x00002875 in ?? ()

comment:23 by ps@…, 15 years ago

this backtrace doesn't look like from binary compiled with debug symbols btw

comment:24 by hofbauer@…, 15 years ago

Yes Pavel, I learnt by now what the "-strip" part in "make install-strip" is
good for. ;-)

Here is a proper one (the line numbers in GuiView are off by one):

lassert.cpp(21): ASSERTION d->views_[gv->id()] == gv VIOLATED IN
GuiApplication.cpp:1333
Assertion triggered in void lyx::doAssert(const char*, const char*, long int) by
failing check "false" in file lassert.cpp:23

Program received signal SIGABRT, Aborted.
0x9003d66c in kill ()
(gdb) backtrace
#0 0x9003d66c in kill ()
#1 0x9010e8cf in raise ()
#2 0x9010d422 in abort ()
#3 0x00011582 in lyx::lyx_exit (exit_code=1) at LyX.cpp:200
#4 0x00040fee in boost::assertion_failed (expr=0x685838 "false",
function=0x68c8c8 "void lyx::doAssert(const char*, const char*, long int)",
file=0x68c900 "lassert.cpp", line=23) at boost.cpp:47
#5 0x0007de85 in lyx::doAssert (expr=0x6900dc "d->views_[gv->id()] == gv",
file=0x68ffa4 "GuiApplication.cpp", line=1333) at lassert.cpp:23
#6 0x000ad240 in lyx::frontend::GuiApplication::unregisterView (this=0xfc22d40,
gv=0x25ae9710) at GuiApplication.cpp:1333
#7 0x002dcedf in lyx::frontend::GuiView::closeEvent (this=0x25ae9710,
close_event=0xbfff727c) at GuiView.cpp:571
#8 0x10852c5c in QWidget::event ()
#9 0x10b36896 in QMainWindow::event ()
#10 0x002d9e2e in lyx::frontend::GuiView::event (this=0x25ae9710, e=0xbfff727c)
at GuiView.cpp:841
#11 0x1081470e in QApplicationPrivate::notify_helper ()
#12 0x1081bdfc in QApplication::notify ()
#13 0x000b652c in lyx::frontend::GuiApplication::notify (this=0xfc22d40,
receiver=0x25ae9710, event=0xbfff727c) at GuiApplication.cpp:1226
#14 0x0fad334b in QCoreApplication::notifyInternal ()
#15 0x10851110 in QWidgetPrivate::close_helper ()
#16 0x108511b0 in QWidget::close ()
#17 0x002da2d6 in lyx::frontend::GuiView::on_lastWorkAreaRemoved
(this=0x25ae9710) at GuiView.cpp:738
#18 0x002da540 in lyx::frontend::GuiView::qt_metacall (this=0x25ae9710,
_c=InvokeMetaMethod, _id=36, _a=0xbfff73cc) at GuiView_moc.cpp:91
#19 0x0fae1fba in QMetaObject::activate ()
#20 0x004b149f in lyx::frontend::TabWorkArea::lastWorkAreaRemoved
(this=0x25a6c820) at GuiWorkArea_moc.cpp:179
#21 0x004bb6f8 in lyx::frontend::TabWorkArea::removeWorkArea (this=0x25a6c820,
work_area=0x25ae8d70) at GuiWorkArea.cpp:1362
#22 0x002c7753 in lyx::frontend::GuiView::removeWorkArea (this=0x25ae9710,
wa=0x25ae8d70) at GuiView.cpp:934
#23 0x004b0c6a in lyx::frontend::GuiWorkArea::close (this=0x25ae8d70) at
GuiWorkArea.cpp:328
#24 0x0024ea21 in lyx::frontend::WorkAreaManager::closeAll (this=0x25a87370) at
WorkAreaManager.cpp:45
#25 0x007a5fc9 in lyx::Buffer::Impl::~Impl (this=0x110bb400) at Buffer.cpp:135
#26 0x00070c35 in lyx::Buffer::~Buffer (this=0x25a8d220) at Buffer.cpp:305
#27 0x00088bd2 in lyx::BufferList::release (this=0x110054a4, buf=0x25a8d220) at
BufferList.cpp:102
#28 0x00207caa in lyx::checkAndLoadLyXFile (filename=@0xbfff94cc) at
buffer_funcs.cpp:76
#29 0x002c2cc6 in lyx::frontend::GuiView::loadDocument (this=0x25a8ea00,
filename=@0xbfff94cc, tolastfiles=true) at GuiView.cpp:1291
#30 0x002c655d in lyx::frontend::GuiView::openDocument (this=0x25a8ea00,
fname=@0xbfff96f4) at GuiView.cpp:1381
#31 0x000b1283 in lyx::frontend::GuiApplication::dispatch (this=0xfc22d40,
cmd=@0x25a3337c) at GuiApplication.cpp:861
#32 0x000ebbda in lyx::LyXFunc::dispatch (this=0x11005400, cmd=@0x25a3337c) at
LyXFunc.cpp:1588
#33 0x00010f50 in lyx::dispatch (action=@0x25a3337c) at LyX.cpp:1127
#34 0x002c2150 in lyx::frontend::GuiView::customEvent (this=0x25ae9710,
event=0x25a33370) at GuiView.cpp:615
#35 0x0fae0439 in QObject::event ()
#36 0x108523a3 in QWidget::event ()
#37 0x10b36896 in QMainWindow::event ()
#38 0x002d9e2e in lyx::frontend::GuiView::event (this=0x25ae9710, e=0x25a33370)
at GuiView.cpp:841
#39 0x1081470e in QApplicationPrivate::notify_helper ()
#40 0x1081bdfc in QApplication::notify ()
#41 0x000b652c in lyx::frontend::GuiApplication::notify (this=0xfc22d40,
receiver=0x25ae9710, event=0x25a33370) at GuiApplication.cpp:1226
#42 0x0fad334b in QCoreApplication::notifyInternal ()
#43 0x0fad4207 in QCoreApplicationPrivate::sendPostedEvents ()
#44 0x0fad43d3 in QCoreApplication::sendPostedEvents ()
#45 0x1086e832 in QWidgetPrivate::qt_mac_dnd_event ()
#46 0x10877f73 in QWidgetPrivate::qt_widget_event ()
#47 0x92df64d7 in DispatchEventToHandlers ()
#48 0x92df5b7c in SendEventToEventTargetInternal ()
#49 0x92df5a41 in SendEventToEventTargetWithOptions ()
#50 0x92f614e2 in SendControlDefDragReceive ()
#51 0x92f613b2 in ControlDragReceiveHandler ()
#52 0x92f61381 in InvokeDragReceiveHandlerUPP ()
#53 0x92f6130c in CarbonReceiveMapper ()
#54 0x917f817d in DoDropMessage ()
#55 0x917f933d in CoreDragMessageHandler ()
#56 0x90873b72 in CFMessagePortPerform ()
#57 0x9082c5a1 in CFRunLoopRunSpecific ()
#58 0x9082ba42 in CFRunLoopRunInMode ()
#59 0x10869196 in QEventDispatcherMac::processEvents ()
#60 0x0fad2c11 in QEventLoop::processEvents ()
#61 0x0fad2e0a in QEventLoop::exec ()
#62 0x0fad4469 in QCoreApplication::exec ()
#63 0x000acc8a in lyx::frontend::GuiApplication::exec (this=0xfc22d40) at
GuiApplication.cpp:1042
#64 0x0001ea20 in lyx::LyX::exec (this=0xbffff998, argc=@0xbffff9c0,
argv=0xbffffa20) at LyX.cpp:343
#65 0x00003352 in main (argc=1, argv=0xbffffa20) at main.cpp:46

comment:25 by sts@…, 15 years ago

The last backtrace shows another problem in fact. For that you have to disable "open in tabs". Then the
GuiView is closed before reloading a document. This somehow gives these reentrace crashes.

comment:26 by hofbauer@…, 15 years ago

Cc: bewihelm@… added

Stefan, note that "Open documents in tabs" is by default DISABLED on the Mac (in
a vanilla LyX 1.6 installation). I think this is wrong and should be changed.

Bennett once argued that this would be the standard-behaviour on Mac. I disagree
because I cannot come up with a single application whose windows are
multi-document-capable and would NOT open new files in the same window (e.g.
Smultron, TextWrangler, BBedit, ...).

It is either that, or 1-document = 1-window (e.g. TextEdit, OmniGraffle,
OmniOutliner, ...), which is IMO not what we want for LyX.

comment:27 by sts@…, 15 years ago

I think Xcode also does that. Double clicking on a file in Finder gives another new source code window.

Anyway, I don't really have an opinion about what is more Mac like. I personally use both, tabs and
windows.

comment:28 by hofbauer@…, 15 years ago

Since it is a very obvious Preference setting, I do not have a strong opinion
about it. Whatever...

comment:29 by Juergen Spitzmueller, 15 years ago

Milestone: 1.6.01.6.1

by sts@…, 15 years ago

Attachment: dispatchdelayed.patch added

Proper delayed dispatch mechanism

comment:30 by sts@…, 15 years ago

attachments.isobsolete: 01

comment:32 by Juergen Spitzmueller, 15 years ago

Keywords: fixedinbranch fixedintrunk removed
Resolution: fixed
Status: newclosed

LyX 1.6.1 is out.

Note: See TracTickets for help on using tickets.