Thanks Nigel,

I just modified and cleaned a lot of code related to initialization and ui, so I think you should have a new try with the last SVN version. There are good chances that your problems will be fixed.

Fabien

On 5/31/07, Nigel Kerr <nigel.kerr@gmail.com> wrote:
Good folk,

Attached please find four patches versus r2159, the four that are the
one combination of initialization that i've found will permit the mac
to run, and run in both windowed and unwindowed.

without these patches in these four files, a straight up r2159
(excepting the file-manager and location related patches, which i
believe to be irrelevant here), Stellarium will always crash thus:

#0      0x00070180 in StelUI::gui_update_widgets
#1      0x00091f04 in StelApp::update
#2      0x0009454c in GLWidget::paintGL
#3      0x006f9764 in QGLWidget::glDraw
#4      0x006f46a0 in QGLWidget::paintEvent
#5      0x01224410 in QWidget::event at qsystemtrayicon_mac.mm:373
#6      0x011f0b6c in QApplicationPrivate::notify_helper at
qsystemtrayicon_mac.mm:373
#7      0x011f71b0 in QApplication::notify at qsystemtrayicon_mac.mm:373
#8      0x01244774 in QWidgetPrivate::qt_widget_event at qsystemtrayicon_mac.mm:373
#9      0x9f258934 in DispatchEventToHandlers
#10     0x9f25808c in SendEventToEventTargetInternal
#11     0x9f257f08 in SendEventToEventTargetWithOptions
#12     0x9f283560 in HIView::SendDraw
#13     0x9f3e421c in HIView::RecursiveDrawComposited
#14     0x9f3e433c in HIView::RecursiveDrawComposited
#15     0x9f3e433c in HIView::RecursiveDrawComposited
#16     0x9f3e433c in HIView::RecursiveDrawComposited
#17     0x9f3e3f9c in HIView::DrawComposited
#18     0x9f27311c in UpdateWindowVisibility
#19     0x9f272f30 in _ShowHideWindows
#20     0x9f272e80 in ShowHide
#21     0x01242d9c in QWidgetPrivate::show_sys at qsystemtrayicon_mac.mm:373
#22     0x01227338 in QWidgetPrivate::show_helper at qsystemtrayicon_mac.mm:373
#23     0x01228704 in QWidget::setVisible at qsystemtrayicon_mac.mm:373
#24     0x00095d64 in StelAppQt4::startMainLoop
#25     0x00019398 in main
#26     0x00003754 in _start
#27     0x00003458 in start

line 1325 in stel_ui.cpp of r2159.  If i then make the patches of
stel_ui.cpp in the stel_ui.cpp.txt patch, i then start to always crash
here:

#0      0x00025088 in Observer::update
#1      0x000968d4 in StelCore::update
#2      0x00091f0c in StelApp::update
#3      0x00094540 in GLWidget::paintGL
#4      0x006f9764 in QGLWidget::glDraw
#5      0x006f46a0 in QGLWidget::paintEvent
#6      0x01224410 in QWidget::event at qsystemtrayicon_mac.mm:373
#7      0x011f0b6c in QApplicationPrivate::notify_helper at
qsystemtrayicon_mac.mm:373
#8      0x011f71b0 in QApplication::notify at qsystemtrayicon_mac.mm:373
#9      0x01244774 in QWidgetPrivate::qt_widget_event at qsystemtrayicon_mac.mm:373
#10     0x9f258934 in DispatchEventToHandlers
#11     0x9f25808c in SendEventToEventTargetInternal
#12     0x9f257f08 in SendEventToEventTargetWithOptions
#13     0x9f283560 in HIView::SendDraw
#14     0x9f3e421c in HIView::RecursiveDrawComposited
#15     0x9f3e433c in HIView::RecursiveDrawComposited
#16     0x9f3e433c in HIView::RecursiveDrawComposited
#17     0x9f3e433c in HIView::RecursiveDrawComposited
#18     0x9f3e3f9c in HIView::DrawComposited
#19     0x9f27311c in UpdateWindowVisibility
#20     0x9f272f30 in _ShowHideWindows
#21     0x9f272e80 in ShowHide
#22     0x01242d9c in QWidgetPrivate::show_sys at qsystemtrayicon_mac.mm:373
#23     0x01227338 in QWidgetPrivate::show_helper at qsystemtrayicon_mac.mm:373
#24     0x01228704 in QWidget::setVisible at qsystemtrayicon_mac.mm:373
#25     0x00095d58 in StelAppQt4::startMainLoop
#26     0x00019378 in main
#27     0x00003734 in _start
#28     0x00003438 in start

Patching  StelApp.cpp, StelApp.hpp, and StelAppQt4.cpp as the other
three patches do, I'm able to run, see the splash screen, and enter
Stellarium, full-screen or no.  Notably the position of
StelApp::init(); in StelAppQt4.cpp has been moved up a couple lines
(that on the reasoning that if more were initialized sooner, things'd
work...), and an isUiInitialized() boolean on StelApp added, to make
the rest of the patch of StelAppQt4.cpp possible (in
GLWidget::paintGL() we must avoid the two stelapp calls there, but
still swapbuffers...).

I got to these by trial and error, and I wish i could reconstruct the
order i came to them in.  i guess i'm interested if the linux version
runs with the attached patches at all (i don't have a linux machine to
hand).


On a different note, sometimes (maybe now 1 in 3 launches), on
quitting the app, it will crash here:

#0      0x05334098 in glDeleteTextures_Exec
#1      0x000be1f4 in STexture::~STexture
#2      0x000fbe24 in ManagedSTexture::~ManagedSTexture
#3      0x000d8160 in boost::detail::sp_counted_base::release
#4      0x0003d634 in s_gui::Picture::~Picture
#5      0x0003ebc0 in s_gui::Container::~Container
#6      0x0003ed28 in s_gui::Container::~Container
#7      0x000e6724 in s_gui::StdBtWin::~StdBtWin
#8      0x0003ebc0 in s_gui::Container::~Container
#9      0x00063ff8 in StelUI::~StelUI
#10     0x000907cc in StelApp::~StelApp
#11     0x00094654 in StelAppQt4::~StelAppQt4
#12     0x000192b4 in main
#13     0x00003654 in _start
#14     0x00003358 in start

There's a second, much rarer place to crash, somewhere having to do
with fonts that I can't reproduce this evening, coming down through
the font destructor, also to glDeleteTextures.  This glDeleteTextures
crash doesn't always happen. The user on the mac, if they don't have
the debugger set to attach, gets a "Stellarium crashed, you want to
report it to apple?" dialog.

i owe the patch site patches for file and directory management, but
i've run out of time here tonight breaking and rebuilding.

cheers,
Nigel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stellarium-pubdevel mailing list
Stellarium-pubdevel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel