June 28, 2011

_Mann _Mann
Lab Rat
3 posts

Closing QMainWindow crashes on lion 10.7 preview 4.

 

Application is created on mac using Qt 4.7 cocoa , which runs on Leopard and Snow leopard. But crashes on Lion previews.

Steps to reproduce the crash on lion previews:

After clicking on button of main window(QMainWindow) of application, another (second non modal) QMainWindow is launched.
1) When this second QMainWindow is closed by close (x) button [present on upper left side of window] , application crashes.
2) When this second QMainWindow is closed by “Exit” button(“Exit” button is present in toolbar of second QMainWindow), application doesn’t crash.

Also, the call which gets executed by performing either of these two ways (by using close button or exit button of toolbar) is same.

Below is the crash report:

Performing @selector(_close:) from sender _NSThemeCloseWidget 0xbc8bc70
objc13858: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 QtGui 0×0263d7d2 -[QCocoaWindow canBecomeKeyWindow] + 34
1 com.apple.AppKit 0×990f3d1c -[NSApplication(NSWindowCache) _invalidateWindowListForCycleIfNeededForWindow:] + 104
2 com.apple.AppKit 0×990f3f3d -[NSApplication(NSWindowCache) _setVisibleInCache:forWindow:] + 215
3 com.apple.AppKit 0×990f19b5 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 3547
4 com.apple.AppKit 0×990f0bd5 -[NSWindow _doOrderWindowWithoutAnimation:relativeTo:findKey:forCounter:force:isModal:] + 79
5 com.apple.AppKit 0×990f0ac8 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 997
6 com.apple.AppKit 0×990f0671 -[NSWindow orderWindow:relativeTo:] + 126
7 com.apple.AppKit 0×9917b4ac -[NSWindow orderOut:] + 49
8 com.apple.AppKit 0×9927ced9 __-[NSWindow _close]_block_invoke_1 + 527
9 com.apple.AppKit 0×9927ccb2 -[NSWindow _close] + 354
10 com.apple.AppKit 0×9927cb48 -[NSWindow close] + 33
11 com.apple.AppKit 0×9970f594 __-[NSWindow __close]_block_invoke_1 + 167
12 com.apple.AppKit 0×99718069 -[NSWindow __close] + 332
13 com.apple.AppKit 0×99717f11 -[NSWindow _close:] + 159
14 com.apple.CoreFoundation 0×9bf94c31 -[NSObject performSelector:withObject:] + 65
15 com.apple.AppKit 0×990fb051 -[NSApplication sendAction:to:from:] + 232
16 com.apple.AppKit 0×990faf2c -[NSControl sendAction:to:] + 102
17 com.apple.AppKit 0×990fae2f -[NSCell _sendActionFrom:] + 160
18 com.apple.AppKit 0×990fa1ea -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2295
19 com.apple.AppKit 0×9917d14d -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 501
20 com.apple.AppKit 0×990f8c2b -[NSControl mouseDown:] + 943
21 com.apple.AppKit 0×996a9962 -[_NSThemeWidget mouseDown:] + 303
22 com.apple.AppKit 0×990c1e96 -[NSWindow sendEvent:] + 7514
23 QtGui 0×0263dd98 -[QCocoaWindow sendEvent:] + 376
24 com.apple.AppKit 0×9905a191 -[NSApplication sendEvent:] + 4260
25 QtGui 0×0264130a -[QNSApplication sendEvent:] + 90
26 com.apple.AppKit 0×98fec2e4 -[NSApplication run] + 993
27 QtGui 0×0264b951 QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1425
28 QtCore 0×0245ee61 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 65
29 QtCore 0×0245f09d QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 189
30 QtCore 0×024630ee QCoreApplication::exec() + 174
31 com.GApplication 0×00009d48 main + 2536
32 com.GApplication 0×000090b6 start + 54

Please provide suggestion.
Thanks in advance

Regards,
Mann

5 replies

June 28, 2011

Chuck Gao Chuck Gao
Lab Rat
342 posts

Can you paste some code ?

 Signature 

Chuck

June 28, 2011

Tobias Hunger Tobias Hunger
Area 51 Engineer
3383 posts

How about writing a bug report [bugreports.qt.nokia.com] ?

Issues reported to a forum tend to get lost!

June 28, 2011

_Mann _Mann
Lab Rat
3 posts

After closing the second QMainWindow , the following function gets called on first MainWindow.

bool MainWindow::eventFilter(QObject * object, QEvent *event)
{ if (event->type() QEvent::ActivationChange) { // some activation change related stuff for the application like .updating menu , toolbar, icons etc. } else if (event->type() QEvent::WindowActivate)
{ // some window activate related stuffs for the application like loading menu and toolbar, icons etc..
}
else if (event->type() == QEvent::WindowDeactivate)
{ // some window deactivate related stuffs for the application
}

return QMainWindow::eventFilter(object, event); }

At this time of execution, two events come: first QEvent::WindowActivate and after that QEvent::ActivationChange. And stuff related to these events works well.

And after executing this function, application crashes and debugger halt at following code of main.cpp

int ret = app->exec();

June 28, 2011

_Mann _Mann
Lab Rat
3 posts

Plz help me to understand the above crash report and in which situation this occurs ? and what’s the reason behind it.

June 28, 2011

mkae mkae
Lab Rat
50 posts

_Mann, did you actually manage to get Lion to build a debug version of your code which you can actually debug using Xcode’s gdb?

(Sorry, that I am not able to help you with your actual problem though!)

 
  ‹‹ [SOLVED] Reading available ODBC data source names?      [solved] Trouble getting JSON response with QNetworkRequest ››

You must log in to post a reply. Not a member yet? Register here!