Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.48k stars 809 forks source link

Crashes of Stellarium 1.1 (1.22.4 based on Qt 6.4) #2874

Open smoinard18 opened 1 year ago

smoinard18 commented 1 year ago

Hello,

Multiple craches while connected to a ASCOM telescope (real EQ6R-pro ASCOM, or simulated ASCOM). Works well few minutes and crashed randomly while capturing video on another software, no special action in Stellarium.

Hope the following informations will help... Returning to 0.22.1.

Note that the provided log has been generated with a simulated ASCOM telescope (same crashes with a real connected telescope).

Platform and operating system:

Windows 11 Pro 21H2 build 22000.181.0, 64bits up to date

What kind of graphics card do you have? Driver version?

Intel Iris Plus Graphics. Driver Intel 27.20.100.9365

Which version of Stellarium causes problems:

stellarium-1.1.1-qt6-win64.exe - Stellarium 1.1 (1.22.4 based on Qt 6.4)

The LOGFILE: See joined file log.txt

Stef log.txt

github-actions[bot] commented 1 year ago

Thanks for adding your first issue to Stellarium. If you have questions, please do not hesitate to contact us.

gzotti commented 1 year ago

Duplicate of #2821. However, with note that an ASCOM simulator is enough to cause crashes.

smoinard18 commented 1 year ago

Please note that when the crash has been reproduced with an ASCOM simulator, I was not using Sharpcap. However Sharpcap is installed on the same PC, and the crashes with my real telescope occured while using Sharpcap and Firecapture, but both were not connected to the mount.

github-actions[bot] commented 1 year ago

This is a good task for the community to participate in the contribution into Stellarium. Who wants to help us?

smoinard18 commented 1 year ago

What kind of participation do you want me to help ?

gzotti commented 1 year ago

Somebody with an interest and motivation in removing INDI/ASCOM/SharpCap/DeviceHub-related problems must look into them. It probably requires some changes in the code, so building from source is a prerequisite, then checking the code of the ASCOM/INDI-related parts of the Telescope plugin. Knowledge about running a debugger may be advantageous.

ouiouiblog commented 1 year ago

@smoinard18, I don't know if that may help. I had the same problem with 1.1.1-QT6-W64. Crashing with an Ascom telescope. Crashes may occur randomly or immediately if I used Alt-Tab.

Problem is gone since I use 1.1.1-QT5-W64. You could try by our own.

Platform and operating system: Windows 10 Family 22H2 build 19045,2251 64bits up to date

What kind of graphics card do you have? Driver version? AMD ATI HD4500. Driver Intel 27.20.100.9365

Which version of Stellarium causes problems: stellarium-1.1.1-qt6-win64.exe - Stellarium 1.1 (1.22.4 based on Qt 6.4)

Blanshan91 commented 1 year ago

I am having the same issue. Since updating to v1.1, Stellarium will crash after 1-2 minutes when running, especially after a sync. Are the previous version avaiable for download so I can further test?

gzotti commented 1 year ago

Yes. All releases are available when following the "All releases" link on stellarium.org. Can you try with Qt5-based release 1.1?

Kev1909 commented 1 year ago

Hello, Same problem also with v1.0. I was going back to v0.22.2 and have no problems anymore with crashes. I use Stellarium Scope to connect and control my EQ6-R. The crashes comes only when I jump between different Windows (Sharpcap, NINA) and go back to the Stellarium Window.

ouiouiblog commented 1 year ago

@Kev1909 you should try 1.1.1-QT5-W64. it solved my problem

gzotti commented 1 year ago

@Kev1909 the same request to you: can you try Qt5-based version 1.1 (https://github.com/Stellarium/stellarium/releases/download/v1.1/stellarium-1.1.1-qt5-win64.exe) ? We have several reports regarding Qt6-based builds when changing between Stellarium and NINA/SharpCap etc, and we tend to believe them. OK, error registered. However, probably no developer currently seems to have enough spare time to ever go observing. My own demands were always fulfilled with my old little drive, LX200 protocol (no chance to experience ASCOM or INDI issues), external autoguider (no chance to see NINA/SharpCap issues), and my DSLR's auto timer.

Going back to a previous version is one option for users, but no step towards solving the problem. (Probably Stellarium 0.14 or 0.16 was good enough for driving telescopes in the 2020s.) Knowing that the problem lies in the actual Qt5/Qt6 transition would be a little but valuable piece of information for the community.

gzotti commented 1 year ago

@ouiouiblog thank you for this confirmation!

Kev1909 commented 1 year ago

Ok I will try it and give u feedback. Thank you both!

Kev1909 commented 1 year ago

@gzotti You are right! Qt5 runs without any crashes and works well! Thank You.

FYI: The crashes in Qt6 happens only when I connected to to Telescope and jump between diffenrent windows.

Kind regards Kevin

gzotti commented 1 year ago

OK. So, telescope users with problems should use Qt5-based builds. And one of them should feel invited to fix this.

fl0wm0ti0n commented 1 year ago

I have this issue too... recent version of ASCOM EQMOD and Stellarium with EQ5 Mount Goto

it seems crashing when switch open windows.

ouiouiblog commented 1 year ago

you should try 1.1.1-QT5-W64. it solved my problem

fl0wm0ti0n commented 1 year ago

you should try 1.1.1-QT5-W64. it solved my problem

thanks! this version works in this case, but i have a different problem... idk if it is the same related issue...

if i make slew and sync with the eqmod aligment tool, after the second "sync" button press SynScan geors back to non PC direct mode and Stellarium freezes, or nearly freezes cause it seems to be ultra slow with the time refreshing only every few minutes.

so first "Sync" works, second not

whiochon commented 1 year ago

I want to help with this issue. I have run the latest stable Stellarium with the debugger in Qt Creator, and found where it crashes. Confirmed that it occurs with all versions of QT6, including the latest 6.5, but not QT5.

First, it is easy to reproduce, without specific equipment. An ASCOM driver with simulated telescope is sufficient. I used the latest ASCOM and Green Swamp Server.

  1. Configure Stellarium with a simulated ASCOM telescope to connect at startup
  2. Move the telescope somewhere in Stellarium
  3. Change windows context (I put Chrome maximised over the top of Stellarium)
  4. Wait 60 seconds
  5. Switch back to Stellarium

Crash: C:\Users\qt\work\qt\qtbase\src\opengl\qopenglpaintengine.cpp:2619: error: Debugger encountered an exception: Exception at 0x7ff8f0dd8fd6, code: 0xc0000005: read access violation at: 0x1c0, flags=0x0 (first chance)

The error occurs when an OpenGL state is being refreshed, or re-created?

I added some debug with timestamps to ASCOMDevice.cpp, and found that right before the crash, ASCOMDevice::isDeviceConnected() looks like it is called twice, concurrently. ie, a second call is made before the 1st is finished. Does QT6 do something that requires plugins to be thread safe?

whiochon commented 1 year ago

Adding to hints of duplicated objects, when building in "Debug" mode, the following exception is triggered, instead of the error above:

There can be only 1 instance of StelPainter at a given time Debug Error!

Program: C:\Code\Qt\6.4.0\msvc2019_64\bin\Qt6Cored.dll Module: 6.4.0 File: C:\Code\stellarium\src\core\StelPainter.cpp Line: 143

This error only occurs if an ASCOM simulated telescope is active. If using the Stellarium simulated telescope, it does not occur.

Code from StelPainter.cpp::

#ifndef NDEBUG
    Q_ASSERT(globalMutex);

    GLenum er = glGetError();
    if (er!=GL_NO_ERROR)
    {
        if (er==GL_INVALID_OPERATION)
            qFatal("Invalid openGL operation. It is likely that you used openGL calls without having a valid instance of StelPainter");
    }

    // Lock the global mutex ensuring that no other instances of StelPainter are currently being used
    if (globalMutex->tryLock()==false)
    {
        qFatal("There can be only 1 instance of StelPainter at a given time");
    }
#endif
alex-w commented 1 year ago

Please check the fresh version (development snapshot) of Stellarium: https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

whiochon commented 1 year ago

Hi @alex-w , I did a clean install of snapshot stellarium-23.2-a69d242-qt6-win64.exe but unfortunately, was still able to reproduce the same problem with the steps as above.

10110111 commented 1 year ago

Please post the log for this new version.

gzotti commented 11 months ago

Several Qt6/TelescopeControl issues have been solved before 23.3. We would like to clean-out a large group of related issue reports which are hard to reproduce without actual telescopes or external software. If no follow-up to this happens by November 1, 2023, we will close this as tentatively solved.

github-actions[bot] commented 11 months ago

Hello @smoinard18!

Please check the fresh version (development snapshot) of Stellarium: https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

StarFlea commented 11 months ago

Hello!

I ckecked the new RC4-Version (stellarium-23.2-13f21ff-qt6-win64.exe)... The program crashed again on the first attempt with the telescope control! The problem doesn't seem to have been solved yet...

Here is the Windows-Error-Log:

Faulting application name: stellarium.exe, version: 23.2.264.0, time stamp: 0x650bf3c0 Faulting module name: Qt6OpenGL.dll, version: 6.5.2.0, time stamp: 0x64a70f0b Exception code: 0xc0000005 Fault offset: 0x0000000000018ef6 Faulting process Id: 0x1fc8 Faulting application start time: 0x01d9ecbcee22559a Faulting application path: C:\Program Files\Stellarium\stellarium.exe Faulting module path: C:\Program Files\Stellarium\Qt6OpenGL.dll Report Id: 6ffe7d83-3d25-4e8f-bd3f-3e63818a0fc8 Faulting package full name: Faulting package-relative application ID:

gzotti commented 11 months ago

So then... @StarFlea you are fresh in this thread. Is this a problem while using SharpCap (I only now read what this is), or is it a problem when ONLY using Stellarium with TelescopeControl plugin? Maybe this is a problem of "SharpCap killing Stellarium", to be reported to their developers?

StarFlea commented 11 months ago

Hi! No, the problem only occurs with Stellarium with QT6. SharpCap was not in use. The telescope control ran via the Green Swamp server. Here I had several similar Stellarium-crashes after a short time.

Once I started using Stellarium with QT5, I had no more problems.

Best regards! StarFlea

StarFlea commented 11 months ago

So, I have now tested the new version 23.3 (Qt 6.5.2) again under Windows 10...

As soon as I use the telescope plugin, Stellarium crashes after a short time (sometimes shortly after connecting to the telescope, sometimes only after I have performed several SYNCs): But every time it is only a matter of time!

Windows-Log:

_Problem No longer functional

Date ‎09/26/2023 1:29 p.m

status The report has been sent.

Description Faulting application path: C:\Program Files\Stellarium\stellarium.exe

Problem signature Problem Event Name: APPCRASH Application Name: stellarium.exe Application Version: 23.3.0.0 Application Timestamp: 6511941d Faulting Module Name: Qt6OpenGL.dll Faulting Module Version: 6.5.2.0 Faulting Module Timestamp: 64a70f0b Exception code: c0000005 Fault offset: 0000000000018ef6 OS Version: 10.0.19045.2.0.0.256.48 Locale ID: 1031 Additional Information 1: cc27 Additional Information 2: cc27a2c1a6f83b5aa8978bb56b3ac09b Additional Information 3: fea3 Additional Information 4: fea3fe93f3b8e9f45e981bb221c5b774

Extra information about the problem Bucket ID: 66e61f13bf2942da580426cd7727b6b7 (1730550820726355639)_

I've attached the Stellarium log, but it doesn't document the actual crash...

I hope it's of some help. No other programs were involved in the process (except GS Server). With the Qt5 version I couldn't provoke any crashes!

Greetings! Star Flea log.txt

github-actions[bot] commented 11 months ago

Hello @smoinard18!

Please check the latest stable version of Stellarium: https://github.com/Stellarium/stellarium/releases/latest

StarFlea commented 11 months ago

Hmm, I'm pondering right now and when I look at problem #2821, my experience tells me that there could be a connection between the two problems:

So maybe the problem is more general and occurs when you switch back and forth between different windows or (sub)frames!?

gzotti commented 9 months ago

I cannot reproduce a crash with 23.3/Qt6, ASCOM 6.6SP2 and just the ASCOM telescope simulator. @StarFlea , @whiochon you both are using Green Swamp server. I have only read the name, what does Green Swamp server do?

StarFlea commented 9 months ago

Hi Georg!

The GSS is an alternative driver to EQMOD, with which you can control the telescope via ASCOM, especially for Skywatcher mounts. But I don't think that's where the problem lies, because I recently switched from EQMOD to GSS (in the hope of better software stability) and I already had numerous Stellarium crashes before that.

All I can say is that since I started using the Qt5 version, I hardly have any problems anymore. Crashes always only occurred when I switched from Stellarium to another program window and back again. I usually set up a connection to GSS via the Stellarium telescope control and at the same time a connection from another program (e.g. SharpCap) to GSS.

But as I said: The problem already existed with EQMOD...

gzotti commented 9 months ago

OK. We can be sure "Qt6" and "ASCOM" are involved. But I cannot trigger a crash with the ASCOM telescope simulator.

StarFlea commented 8 months ago

Maybe it is necessary for another program to have a connection to the mount in addition to Stellarium? In the past it was always enough to briefly switch to this program window (without clicking on any controls) and then switch back to the Stellarium window, to crash it.

gzotti commented 8 months ago

I cannot test equipment which I don't have. Of course I switched between Stellarium and other software, had it in the background for hours, occasionally switched back, never had a crash. Someone else, someone with observing needs, programming skills, a fitting telescope, and enough spare time should feel invited to hunt this down.

StarFlea commented 8 months ago

Correction! In addition to the ASCOM driver (e.g. GSS or EQMOD), no other program is necessary!

I can now reliably reproduce the crash of the Qt6 version, but I don't really know the reason yet. No mount is connected! Its only a simulation!

I have just installed the latest Ot6 version...

  1. Then I start the GSS in simulator mode.
  2. After that I start Stellarium and go to the "Slew telescope to" button, then the "Configure telescopes" button.
  3. I connect with the running ASCOM driver (GSS).

After that, a few clicks in any other program window (GSS, browser, ...) are enough to cause Stellarium to crash (even in the background).

Maybe it's due to the settings in the Stellarium telescope control? Here are my settings:

Telescopes - Options: Check "Show telescope labels", "Show telescope reticles", "Show field of view indicators", "Log telescope driver messages to files"

Configure Telescope: Telescope controlled by: ASCOM Name: C8-AZEQ5 Connection delay: 0.10s Coordinate system: J2000 (default) Selected Device: ASCOM.GS.Sky.Telescope Source for coordinate system: Let ASCOM device decide

That's all! Maybe you can reproduce it using the settings?

StarFlea commented 8 months ago

Interesting! As long as I don't establish a connection to the ASCOM driver, Stellarium runs without any problems!

Here are the last entries in the log file before the crash:

connectionType: TelescopeControl::ConnectionASCOM initString: "C8-AZEQ5:ASCOM:J2000:ASCOM.GS.Sky.Telescope:true" Creating telescope "C8-AZEQ5:ASCOM:J2000:ASCOM.GS.Sky.Telescope:true" ; name/type/equinox/params: "C8-AZEQ5" "ASCOM" J2000 "ASCOM.GS.Sky.Telescope:true" TelescopeClientASCOM::TelescopeClientASCOM with telescope name "C8-AZEQ5" and ascomDeviceId "ASCOM.GS.Sky.Telescope"

StarFlea commented 8 months ago

Further insight: Stellarium also crashes when connected to the ASCOM telescope simulator "ScopeSim.Telescope" or the "ASCOM.Simulator.Telescope", even if the GSS is not running!

This narrows down the search a bit!

I also unchecked all the checkboxes in the telescope options as a test, with no result! I keep testing...

StarFlea commented 8 months ago

The following settings also have no influence on crash behavior:

Connection delay Coordinate system Source for coordinate system

So the problem must be somewhere in an incompatibility of Qt6 with some ASCOM configuration!

And as long as you don't briefly switch to another program window after connecting to ASCOM, there will be no crash!

gzotti commented 8 months ago

OK, I have meanwhile seen a silent exit once, but could not reproduce it later. The debugger pointed me to a system library source file I have never even heard of. (So it's nothing simple in our sources.) I have no time these weeks for further experiments, though.

You have two options:

QuantumRads commented 3 months ago

Just commenting that this issue is still present in 24.1 qt6. Doesn't matter what application you use, if you switch windows with the telescope connected, Stellarium will crash.

10110111 commented 2 months ago

I've been able to reproduce the problem with using Green Swamp Server on Microsoft's VirtualBox Windows image. Indeed, in debug mode I get into the "There can be only 1 instance of StelPainter at a given time" failure.

The scenario is as follows:

  1. Launch GSS, choose Simulator in the Mount Type dropdown
  2. Launch Stellarium, make sure Telescope Control plugin is running
  3. Press Connect in GSS window, Ok in the dialog about Home position
  4. Press Connect in Telescope Control config window
  5. Open Telescope Control's main (non-config) dialog
  6. Press Slew button
  7. See the error message about parking being the wrong initial state for slewing, and an immediate crash (or an error dialog if in debug mode).

Sometimes this doesn't result in a crash, particularly it stopped reproducing too reliably in the above scenario after I resized the window and saved settings. Still, it does sometimes reproduce. In one case it reproduced when I switched to GSS to disconnect it and then activated Stellarium window again, after the parking error appeared.

The stack trace looks like this:

1   qt_message_fatal                                       qlogging.cpp                   2053
2   QMessageLogger::fatal                                  qlogging.cpp                   940
3   StelPainter::StelPainter                               StelPainter.cpp                152
4   StelSkyLayerMgr::draw                                  StelSkyLayerMgr.cpp            169
5   StelApp::draw                                          StelApp.cpp                    1068
6   StelRootItem::paint                                    StelMainView.cpp               415
7   QGraphicsScenePrivate::draw                            qgraphicsscene.cpp             4875
8   QGraphicsScenePrivate::drawSubtreeRecursive            qgraphicsscene.cpp             4768
9   QGraphicsScenePrivate::drawItems                       qgraphicsscene.cpp             4627
10  <lambda_5ea25f2b64205adf6e1411746f532723>::operator()  qgraphicsview.cpp              3496
11  QGraphicsView::paintEvent                              qgraphicsview.cpp              3574
12  QWidget::event                                         qwidget.cpp                    9106
13  QFrame::event                                          qframe.cpp                     515
14  QAbstractScrollArea::viewportEvent                     qabstractscrollarea.cpp        1064
15  QGraphicsView::viewportEvent                           qgraphicsview.cpp              2938
16  QAbstractScrollAreaPrivate::viewportEvent              qabstractscrollarea_p.h        74
17  QAbstractScrollAreaFilter::eventFilter                 qabstractscrollarea_p.h        85
18  QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp           1250
19  QApplicationPrivate::notify_helper                     qapplication.cpp               3284
20  QApplication::notify                                   qapplication.cpp               3237
21  QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
22  QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
23  QWidgetPrivate::sendPaintEvent                         qwidget.cpp                    5645
24  QWidgetPrivate::drawWidget                             qwidget.cpp                    5596
25  QWidgetPrivate::paintSiblingsRecursive                 qwidget.cpp                    5773
26  QWidgetPrivate::drawWidget                             qwidget.cpp                    5637
27  QWidgetRepaintManager::paintAndFlush                   qwidgetrepaintmanager.cpp      906
28  QWidgetRepaintManager::sync                            qwidgetrepaintmanager.cpp      630
29  QWidgetPrivate::syncBackingStore                       qwidget.cpp                    1769
30  QWidgetWindow::handleExposeEvent                       qwidgetwindow.cpp              1009
31  QWidgetWindow::event                                   qwidgetwindow.cpp              289
32  QApplicationPrivate::notify_helper                     qapplication.cpp               3290
33  QApplication::notify                                   qapplication.cpp               3241
34  QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
35  QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
36  QGuiApplicationPrivate::processExposeEvent             qguiapplication.cpp            3274
37  QGuiApplicationPrivate::processWindowSystemEvent       qguiapplication.cpp            2134
38  QWindowSystemInterface::sendWindowSystemEvents         qwindowsysteminterface.cpp     1100
39  QWindowSystemInterface::flushWindowSystemEvents        qwindowsysteminterface.cpp     1065
40  QWindowsWindow::handleWmPaint                          qwindowswindow.cpp             2453
41  QWindowsContext::windowsProc                           qwindowscontext.cpp            1142
42  qWindowsWndProc                                        qwindowscontext.cpp            1488
43  DispatchMessageW                                       USER32
44  DispatchMessageW                                       USER32
45  GetClassLongW                                          USER32
46  KiUserCallbackDispatcher                               ntdll
47  NtUserDispatchMessage                                  win32u
48  DispatchMessageW                                       USER32
49  NdrCStdStubBuffer_Release                              combase
50  Ordinal87                                              combase
51  Ordinal87                                              combase
52  WindowsTrimStringEnd                                   combase
53  Ordinal87                                              combase
54  Ordinal87                                              combase
55  Ordinal87                                              combase
56  CoWaitForMultipleHandles                               combase
57  Ordinal87                                              combase
58  HSTRING_UserUnmarshal64                                combase
59  NdrpClientCall2                                        RPCRT4
60  NdrClientCall2                                         RPCRT4
61  VarCyFromR4                                            OLEAUT32
62  OleInternalDispatch                                    OLE.cpp                        70
63  OlePropertyGet                                         OLE.cpp                        101
64  ASCOMDevice::isDeviceConnected                         ASCOMDevice.cpp                122
65  TelescopeClientASCOM::isConnected                      TelescopeClientASCOM.cpp       170
66  TelescopeControl::draw                                 TelescopeControl.cpp           302
67  StelApp::draw                                          StelApp.cpp                    1068
68  StelRootItem::paint                                    StelMainView.cpp               415
69  QGraphicsScenePrivate::draw                            qgraphicsscene.cpp             4875
70  QGraphicsScenePrivate::drawSubtreeRecursive            qgraphicsscene.cpp             4768
71  QGraphicsScenePrivate::drawItems                       qgraphicsscene.cpp             4627
72  <lambda_5ea25f2b64205adf6e1411746f532723>::operator()  qgraphicsview.cpp              3496
73  QGraphicsView::paintEvent                              qgraphicsview.cpp              3574
74  QWidget::event                                         qwidget.cpp                    9106
75  QFrame::event                                          qframe.cpp                     515
76  QAbstractScrollArea::viewportEvent                     qabstractscrollarea.cpp        1064
77  QGraphicsView::viewportEvent                           qgraphicsview.cpp              2938
78  QAbstractScrollAreaPrivate::viewportEvent              qabstractscrollarea_p.h        74
79  QAbstractScrollAreaFilter::eventFilter                 qabstractscrollarea_p.h        85
80  QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp           1250
81  QApplicationPrivate::notify_helper                     qapplication.cpp               3284
82  QApplication::notify                                   qapplication.cpp               3237
83  QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
84  QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
85  QWidgetPrivate::sendPaintEvent                         qwidget.cpp                    5645
86  QWidgetRepaintManager::paintAndFlush                   qwidgetrepaintmanager.cpp      822
87  QWidgetRepaintManager::sync                            qwidgetrepaintmanager.cpp      657
88  QWidgetPrivate::syncBackingStore                       qwidget.cpp                    1760
89  QWidget::event                                         qwidget.cpp                    9270
90  QFrame::event                                          qframe.cpp                     515
91  QAbstractScrollArea::event                             qabstractscrollarea.cpp        1011
92  QGraphicsView::event                                   qgraphicsview.cpp              2809
93  QApplicationPrivate::notify_helper                     qapplication.cpp               3290
94  QApplication::notify                                   qapplication.cpp               3237
95  QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
96  QCoreApplication::sendEvent                            qcoreapplication.cpp           1537
97  QCoreApplicationPrivate::sendPostedEvents              qcoreapplication.cpp           1898
98  QCoreApplication::sendPostedEvents                     qcoreapplication.cpp           1758
99  QGraphicsViewPrivate::dispatchPendingUpdateRequests    qgraphicsview_p.h              159
100 QGraphicsScenePrivate::_q_processDirtyItems            qgraphicsscene.cpp             482
101 QGraphicsScene::qt_static_metacall                     moc_qgraphicsscene.cpp         393
102 QMetaCallEvent::placeMetaCall                          qobject.cpp                    653
103 QObject::event                                         qobject.cpp                    1438
104 QGraphicsScene::event                                  qgraphicsscene.cpp             3440
105 QApplicationPrivate::notify_helper                     qapplication.cpp               3290
106 QApplication::notify                                   qapplication.cpp               3241
107 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
108 QCoreApplication::sendEvent                            qcoreapplication.cpp           1537
109 QCoreApplicationPrivate::sendPostedEvents              qcoreapplication.cpp           1898
110 QEventDispatcherWin32::sendPostedEvents                qeventdispatcher_win.cpp       894
111 QWindowsGuiEventDispatcher::sendPostedEvents           qwindowsguieventdispatcher.cpp 44
112 QEventDispatcherWin32::processEvents                   qeventdispatcher_win.cpp       464
113 QWindowsGuiEventDispatcher::processEvents              qwindowsguieventdispatcher.cpp 36
114 QEventLoop::processEvents                              qeventloop.cpp                 101
115 QEventLoop::exec                                       qeventloop.cpp                 182
116 QDialog::exec                                          qdialog.cpp                    566
117 showNewMessageBox                                      qmessagebox.cpp                1673
118 QMessageBox::warning                                   qmessagebox.cpp                1774
119 TelescopeClientASCOM::telescopeGoto                    TelescopeClientASCOM.cpp       142
120 SlewDialog::slew                                       SlewDialog.cpp                 229
121 SlewDialog::qt_static_metacall                         moc_SlewDialog.cpp             302
122 doActivate<0>                                          qobject.cpp                    4051
123 QMetaObject::activate                                  qobject.cpp                    4097
124 QAbstractButton::clicked                               moc_qabstractbutton.cpp        409
125 QAbstractButtonPrivate::emitClicked                    qabstractbutton.cpp            381
126 QAbstractButtonPrivate::click                          qabstractbutton.cpp            373
127 QAbstractButton::mouseReleaseEvent                     qabstractbutton.cpp            975
128 QWidget::event                                         qwidget.cpp                    8945
129 QAbstractButton::event                                 qabstractbutton.cpp            932
130 QPushButton::event                                     qpushbutton.cpp                687
131 QApplicationPrivate::notify_helper                     qapplication.cpp               3290
132 QApplication::notify                                   qapplication.cpp               2777
133 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
134 QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
135 QApplicationPrivate::sendMouseEvent                    qapplication.cpp               2361
136 QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent      qgraphicsproxywidget.cpp       277
137 QGraphicsProxyWidget::mouseReleaseEvent                qgraphicsproxywidget.cpp       1319
138 QGraphicsItem::sceneEvent                              qgraphicsitem.cpp              6693
139 QGraphicsWidget::sceneEvent                            qgraphicswidget.cpp            1198
140 QGraphicsScenePrivate::sendEvent                       qgraphicsscene.cpp             1225
141 QGraphicsScenePrivate::sendMouseEvent                  qgraphicsscene.cpp             1302
142 QGraphicsScene::mouseReleaseEvent                      qgraphicsscene.cpp             4014
143 QGraphicsScene::event                                  qgraphicsscene.cpp             3323
144 QApplicationPrivate::notify_helper                     qapplication.cpp               3290
145 QApplication::notify                                   qapplication.cpp               3241
146 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
147 QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
148 qt_sendSpontaneousEvent                                qapplication.cpp               3683
149 QGraphicsView::mouseReleaseEvent                       qgraphicsview.cpp              3357
150 QWidget::event                                         qwidget.cpp                    8945
151 QFrame::event                                          qframe.cpp                     515
152 QAbstractScrollArea::viewportEvent                     qabstractscrollarea.cpp        1064
153 QGraphicsView::viewportEvent                           qgraphicsview.cpp              2938
154 QAbstractScrollAreaPrivate::viewportEvent              qabstractscrollarea_p.h        74
155 QAbstractScrollAreaFilter::eventFilter                 qabstractscrollarea_p.h        85
156 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp           1250
157 QApplicationPrivate::notify_helper                     qapplication.cpp               3284
158 QApplication::notify                                   qapplication.cpp               2777
159 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
160 QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
161 QApplicationPrivate::sendMouseEvent                    qapplication.cpp               2361
162 QWidgetWindow::handleMouseEvent                        qwidgetwindow.cpp              625
163 QWidgetWindow::event                                   qwidgetwindow.cpp              242
164 QApplicationPrivate::notify_helper                     qapplication.cpp               3290
165 QApplication::notify                                   qapplication.cpp               3241
166 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
167 QCoreApplication::sendSpontaneousEvent                 qcoreapplication.cpp           1551
168 QGuiApplicationPrivate::processMouseEvent              qguiapplication.cpp            2317
169 QGuiApplicationPrivate::processWindowSystemEvent       qguiapplication.cpp            2066
170 QWindowSystemInterface::sendWindowSystemEvents         qwindowsysteminterface.cpp     1100
171 QWindowsGuiEventDispatcher::sendPostedEvents           qwindowsguieventdispatcher.cpp 45
172 QEventDispatcherWin32::processEvents                   qeventdispatcher_win.cpp       464
173 QWindowsGuiEventDispatcher::processEvents              qwindowsguieventdispatcher.cpp 36
174 QEventLoop::processEvents                              qeventloop.cpp                 101
175 QEventLoop::exec                                       qeventloop.cpp                 182
176 QCoreApplication::exec                                 qcoreapplication.cpp           1439
177 QGuiApplication::exec                                  qguiapplication.cpp            1926
178 QApplication::exec                                     qapplication.cpp               2570
179 main                                                   main.cpp                       470
180 qtEntryPoint                                           qtentrypoint_win.cpp           50
181 WinMain                                                qtentrypoint_win.cpp           60
182 invoke_main                                            exe_common.inl                 107
183 __scrt_common_main_seh                                 exe_common.inl                 288
184 __scrt_common_main                                     exe_common.inl                 331
185 WinMainCRTStartup                                      exe_winmain.cpp                17
186 BaseThreadInitThunk                                    KERNEL32
187 RtlUserThreadStart                                     ntdll
10110111 commented 2 months ago

The culprit seems to be somewhere in these frames:

62  OleInternalDispatch                                    OLE.cpp                        70
63  OlePropertyGet                                         OLE.cpp                        101
64  ASCOMDevice::isDeviceConnected                         ASCOMDevice.cpp                122
65  TelescopeClientASCOM::isConnected                      TelescopeClientASCOM.cpp       170
66  TelescopeControl::draw                                 TelescopeControl.cpp           302
67  StelApp::draw                                          StelApp.cpp                    1068

Apparently, pIDispatch->Invoke call in OLE.cpp:70 results in DispatchMessageW being called (frame 43), which then passes control to Qt's message handler, qWindowsWndProc, which then triggers a recursive repaint.

10110111 commented 2 months ago

If I fix the problem of calling OLE methods from the draw function, there appears another crash in release mode:

1  QOpenGL2PaintEngineEx::setState                        qopenglpaintengine.cpp         2641
2  QPainter::restore                                      qpainter.cpp                   1605
3  QGraphicsScenePrivate::draw                            qgraphicsscene.cpp             4882
4  QGraphicsScenePrivate::drawSubtreeRecursive            qgraphicsscene.cpp             4765
5  QGraphicsScenePrivate::drawItems                       qgraphicsscene.cpp             4626
6  <lambda_5ea25f2b64205adf6e1411746f532723>::operator()  qgraphicsview.cpp              3496
7  QGraphicsView::paintEvent                              qgraphicsview.cpp              3574
8  QWidget::event                                         qwidget.cpp                    9383
9  QFrame::event                                          qframe.cpp                     517
10 QGraphicsView::viewportEvent                           qgraphicsview.cpp              2937
11 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp           1250
12 QApplicationPrivate::notify_helper                     qapplication.cpp               3284
13 QApplication::notify                                   qapplication.cpp               3244
14 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
15 QWidgetPrivate::sendPaintEvent                         qwidget.cpp                    5645
16 QWidgetRepaintManager::paintAndFlush                   qwidgetrepaintmanager.cpp      822
17 QWidget::event                                         qwidget.cpp                    9383
18 QFrame::event                                          qframe.cpp                     517
19 QAbstractScrollArea::event                             qabstractscrollarea.cpp        1014
20 QApplicationPrivate::notify_helper                     qapplication.cpp               3292
21 QApplication::notify                                   qapplication.cpp               3244
22 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
23 QCoreApplicationPrivate::sendPostedEvents              qcoreapplication.cpp           1898
24 QGraphicsScenePrivate::_q_processDirtyItems            qgraphicsscene.cpp             481
25 QMetaCallEvent::placeMetaCall                          qobject.cpp                    657
26 QObject::event                                         qobject.cpp                    1438
27 QGraphicsScene::event                                  qgraphicsscene.cpp             3443
28 QApplicationPrivate::notify_helper                     qapplication.cpp               3292
29 QApplication::notify                                   qapplication.cpp               3244
30 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
31 QCoreApplicationPrivate::sendPostedEvents              qcoreapplication.cpp           1898
32 QWindowsGuiEventDispatcher::sendPostedEvents           qwindowsguieventdispatcher.cpp 44
33 QEventDispatcherWin32::processEvents                   qeventdispatcher_win.cpp       464
34 QWindowsGuiEventDispatcher::processEvents              qwindowsguieventdispatcher.cpp 37
35 QEventLoop::exec                                       qeventloop.cpp                 182
36 QDialog::exec                                          qdialog.cpp                    566
37 showNewMessageBox                                      qmessagebox.cpp                1673
38 QMessageBox::warning                                   qmessagebox.cpp                1774
39 TelescopeClientASCOM::telescopeGoto                    TelescopeClientASCOM.cpp       150
40 SlewDialog::slew                                       SlewDialog.cpp                 229
41 doActivate<0>                                          qobject.cpp                    4053
42 QMetaObject::activate                                  qobject.cpp                    4097
43 QAbstractButtonPrivate::emitClicked                    qabstractbutton.cpp            381
44 QAbstractButtonPrivate::click                          qabstractbutton.cpp            373
45 QAbstractButton::mouseReleaseEvent                     qabstractbutton.cpp            975
46 QWidget::event                                         qwidget.cpp                    9383
47 QApplicationPrivate::notify_helper                     qapplication.cpp               3292
48 QApplication::notify                                   qapplication.cpp               2778
49 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
50 QApplicationPrivate::sendMouseEvent                    qapplication.cpp               2361
51 QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent      qgraphicsproxywidget.cpp       277
52 QGraphicsItem::sceneEvent                              qgraphicsitem.cpp              6751
53 QGraphicsScenePrivate::sendMouseEvent                  qgraphicsscene.cpp             1301
54 QGraphicsScene::mouseReleaseEvent                      qgraphicsscene.cpp             4017
55 QGraphicsScene::event                                  qgraphicsscene.cpp             3443
56 QApplicationPrivate::notify_helper                     qapplication.cpp               3292
57 QApplication::notify                                   qapplication.cpp               3244
58 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
59 QGraphicsView::mouseReleaseEvent                       qgraphicsview.cpp              3357
60 QWidget::event                                         qwidget.cpp                    9383
61 QFrame::event                                          qframe.cpp                     517
62 QGraphicsView::viewportEvent                           qgraphicsview.cpp              2937
63 QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp           1250
64 QApplicationPrivate::notify_helper                     qapplication.cpp               3284
65 QApplication::notify                                   qapplication.cpp               2778
66 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
67 QApplicationPrivate::sendMouseEvent                    qapplication.cpp               2361
68 QWidgetWindow::handleMouseEvent                        qwidgetwindow.cpp              625
69 QWidgetWindow::event                                   qwidgetwindow.cpp              242
70 QApplicationPrivate::notify_helper                     qapplication.cpp               3292
71 QApplication::notify                                   qapplication.cpp               3244
72 QCoreApplication::notifyInternal2                      qcoreapplication.cpp           1118
73 QGuiApplicationPrivate::processMouseEvent              qguiapplication.cpp            2320
74 QWindowSystemInterface::sendWindowSystemEvents         qwindowsysteminterface.cpp     1100
75 QEventDispatcherWin32::processEvents                   qeventdispatcher_win.cpp       464
76 QWindowsGuiEventDispatcher::processEvents              qwindowsguieventdispatcher.cpp 37
77 QEventLoop::exec                                       qeventloop.cpp                 182
78 QCoreApplication::exec                                 qcoreapplication.cpp           1439
79 main                                                   main.cpp                       470
80 qtEntryPoint                                           qtentrypoint_win.cpp           50
81 __scrt_common_main_seh                                 exe_common.inl                 288
82 BaseThreadInitThunk                                    KERNEL32
83 RtlUserThreadStart                                     ntdll

Here, in QOpenGL2PaintEngineEx::setState() the statement QOpenGL2PaintEngineState *old_state = state(); assigns a null pointer to old_state for some reason.

In debug mode I get an assertion failure about current context not being the same as StelOpenGL::mainContext (StelOpenGL.hpp:30).

All these problems again happen when the error message appears.

alex-w commented 2 months ago

@10110111 Hmm... who is a bad guy - reticle, label or circle?

10110111 commented 2 months ago

Well, the bad guy in the first case is the call to isDeviceConnected() during the draw. This should be fixable by a patch like this (not in master yet).

The second crash seems to originate from Qt itself. I suppose it's the OLE calls that mess Qt's data structures up, but this needs checking.

10110111 commented 2 months ago

One (quite radical) workaround may be to make a separate process that would talk to stellarium.exe and do all the necessary OLE calls, without showing any GUI. This may be necessary if the OLE calls appear to be very incompatible with how Qt6 works.

gzotti commented 2 months ago

I may be wrong, but is the next level of ASCOM, Alpaca, not something that is based on IP communication? This would then just mean Stellarium may become a "modern next level" application that communicates to the ASCOM server via IP, not OLE. But I have never studied the details of ASCOM/Alpaca, not sure what it means for compatibility.