Opened 3 years ago

Closed 18 months ago

#13725 closed defect (fixed)

wxDataViewCtrl crashes after item dragging on OS X

Reported by: martin Owned by:
Priority: high Milestone: 3.0.0
Component: wxOSX-Cocoa Version: stable-latest
Keywords: wxDataViewCtrl Cc:
Blocked By: Blocking:
Patch: no

Description

When I'm trying to drag any selected item in wxDataViewCtrl or even trying to select multiple items by dragging the mouse, whole app crashes about 1 second after the mouse button is released. It is reproducible on any DVC_ demo in wxPython Demo app. I haven't seen this under wxMSW, just on wxMac using wxPython_2.9.2.4, Python 2.7, OS X 10.7.2

Change History (5)

comment:1 Changed 2 years ago by vadz

  • Milestone set to 3.0
  • Priority changed from normal to high
  • Status changed from new to confirmed
  • Version changed from 2.9.2 to 2.9-svn

This is perfectly reproducible by trying to drag any item with children (including the root one) in the dataview sample. Unfortunately the stack trace is useless:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xdaba0000
0x908dda8b in objc_msgSend ()
(gdb) bt
#0  0x908dda8b in objc_msgSend ()
#1  0x03169000 in ?? ()
#2  0x960ae083 in _CFAutoreleasePoolPop ()
#3  0x92dac23d in -[NSAutoreleasePool drain] ()
#4  0x97e3178a in -[NSApplication run] ()
#5  0x004e83b1 in wxGUIEventLoop::DoRun (this=0x4854130) at evtloop.mm:246
#6  0x00f9b03f in wxCFEventLoop::Run (this=0x4854130) at evtloop_cf.cpp:403
#7  0x00e0f431 in wxAppConsoleBase::MainLoop (this=0x495b2f0) at appbase.cpp:319
#8  0x00e0dd73 in wxAppConsoleBase::OnRun (this=0x495b2f0) at appbase.cpp:260
#9  0x0052986c in wxAppBase::OnRun (this=0x495b2f0) at appcmn.cpp:284
#10 0x004302cb in wxApp::OnRun (this=0x495b2f0) at app.cpp:888
#11 0x00ec7002 in wxEntry () at init.cpp:493
#12 0x00ec71ed in wxEntry (argc=@0xbffff5d4, argv=0xbffff5f8) at init.cpp:505
#13 0x00002c34 in main (argc=1, argv=0xbffff5f8) at dataview.cpp:233

Could somebody with a beefier machine please try running the sample under valgrind?

This is pretty serious as it's quite easy to trigger this accidentally, so we should try to at least disable dragging of the container items in the control if we can't fix this.

comment:2 Changed 2 years ago by SC

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [72996]) fixing overrelease and out-of-bounds write, fixes #13725

comment:3 Changed 2 years ago by csomor

please test whether this solves all the dataview - drag releated crashes, thanks

comment:4 follow-up: Changed 18 months ago by BGirard

  • Resolution fixed deleted
  • Status changed from closed to reopened

Drag still crashes with wxTreeListCtrl on MacOS.
Version used : wxWidgets 2.9.4.

I also tried to used trunk dataview.mm, patch "wxMemoryBuffer dataBuffer(dataBufferSize+4);" was missing on 2.9.4.
This gives the same crash.

Sample code (drag item1 on item2) :

{

wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);

mainSizer->Add(new wxStaticText(this, wxID_ANY, "CrashTest"));

wxTreeListCtrl * list = new wxTreeListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTL_SINGLE);
list->AppendColumn("Column",

100,
wxALIGN_LEFT,
wxCOL_RESIZABLE | wxCOL_SORTABLE);

wxTreeListItem rootItem = list->GetRootItem();
wxTreeListItem it1 = list->AppendItem(rootItem, "item 1");
wxTreeListItem it2 = list->AppendItem(rootItem, "item 2");
mainSizer->Add(list, 1, wxEXPAND);

SetSizer(mainSizer);

}

comment:5 in reply to: ↑ 4 Changed 18 months ago by BGirard

  • Resolution set to fixed
  • Status changed from reopened to closed

It seems that my update from trunk was messy.

The bug is well fixed (and then tested with wxTreeListCtrl !), sorry for the inconvenient.

Note: See TracTickets for help on using tickets.