Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure of dateTime.timeSpec()==Qt::UTC at startup in Satellites in debug mode #4060

Closed
10110111 opened this issue Jan 7, 2025 · 3 comments
Assignees
Labels
bug Something likely wrong in the code importance: critical Real showstopper, program fails here
Milestone

Comments

@10110111
Copy link
Contributor

10110111 commented Jan 7, 2025

I've just built Stellarium with CMAKE_BUILD_TYPE=Debug, and tried running it. Even with empty .stellarium (as well as with an existing one) it crashes with the following error:

ASSERT: "dateTime.timeSpec()==Qt::UTC" in file /home/ruslan/src/stellarium/src/core/StelUtils.hpp, line 531

Stack trace:

#4  0x00007ffff595ceb5 in qt_assert_x(char const*, char const*, char const*, int) () at /home/ruslan/opt/qt6/lib/libQt6Core.so.6
#5  0x0000555555efae60 in StelUtils::qDateTimeToJd(QDateTime const&) (dateTime=...) at /home/ruslan/src/stellarium/src/core/StelUtils.hpp:531
#6  0x0000555556a06e58 in Satellites::setLastUpdate(QDateTime) (this=0x5555653d6410, last=...) at /home/ruslan/src/stellarium/plugins/Satellites/src/Satellites.cpp:248
#7  0x0000555556a0dbb3 in Satellites::loadSettings() (this=0x5555653d6410) at /home/ruslan/src/stellarium/plugins/Satellites/src/Satellites.cpp:864
#8  0x0000555556a05899 in Satellites::init() (this=0x5555653d6410) at /home/ruslan/src/stellarium/plugins/Satellites/src/Satellites.cpp:161
#9  0x00005555562fcd2c in StelApp::initPlugIns() (this=0x5555581ae660) at /home/ruslan/src/stellarium/src/core/StelApp.cpp:751
#10 0x0000555555f05d8a in StelMainView::init() (this=0x7fffffffd9f0) at /home/ruslan/src/stellarium/src/StelMainView.cpp:985
#11 0x0000555555f125a7 in StelGLWidget::initializeGL() (this=0x555558119d30) at /home/ruslan/src/stellarium/src/StelMainView.cpp:139
#12 0x00007ffff79ac364 in QOpenGLWidgetPrivate::initialize() () at /home/ruslan/opt/qt6/lib/libQt6OpenGLWidgets.so.6
#13 0x00007ffff79ad218 in QOpenGLWidget::event(QEvent*) () at /home/ruslan/opt/qt6/lib/libQt6OpenGLWidgets.so.6
#14 0x00007ffff72cea56 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#15 0x00007ffff72da3c0 in QApplication::notify(QObject*, QEvent*) () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#16 0x00007ffff59f003a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /home/ruslan/opt/qt6/lib/libQt6Core.so.6
#17 0x00007ffff732b197 in QWidgetPrivate::show_helper() () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#18 0x00007ffff732e5ab in QWidgetPrivate::setVisible(bool) () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#19 0x00007ffff732b0c8 in QWidgetPrivate::showChildren(bool) () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#20 0x00007ffff732b173 in QWidgetPrivate::show_helper() () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#21 0x00007ffff732e5ab in QWidgetPrivate::setVisible(bool) () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#22 0x00007ffff732ae44 in QWidget::showFullScreen() () at /home/ruslan/opt/qt6/lib/libQt6Widgets.so.6
#23 0x0000555555f0b87e in StelMainView::setFullScreen(bool) (this=0x7fffffffd9f0, b=true) at /home/ruslan/src/stellarium/src/StelMainView.cpp:1469
#24 0x0000555555ed975a in main(int, char**) (argc=1, argv=0x7fffffffdd58) at /home/ruslan/src/stellarium/src/main.cpp:459

Inspection in GDB shows this:

(gdb) f 5
#5  0x0000555555efae60 in StelUtils::qDateTimeToJd (dateTime=...) at /home/ruslan/src/stellarium/src/core/StelUtils.hpp:531
531                     Q_ASSERT(dateTime.timeSpec()==Qt::UTC);
(gdb) p dateTime.timeSpec()
$1 = Qt::LocalTime

Git blame points to 3e174d6, where the call to qDateTimeToJd appeared, but I didn't check by bisection.

System

  • Stellarium version: v24.4-140-g31d9b78c2b
  • Operating system: Ubuntu 20.04
  • Graphics Card: Intel UHD Graphics 620

Logfile

log.txt

@gzotti
Copy link
Member

gzotti commented Jan 7, 2025

I must have added the assert to catch just such errors. It seems then in Satellites:.setLastUpdate() the QDateTime last must be manipulated to ensure its timespec is Qt::UTC.

What did you press to trigger it? Or did it run the automated update right after program start?

@10110111
Copy link
Contributor Author

10110111 commented Jan 7, 2025

What did you press to trigger it? Or did it run the automated update right after program start?

I just launched Stellarium, which hadn't even shown its main window when it crashed. Then I tried with empty config dir, with the same result.

@gzotti
Copy link
Member

gzotti commented Jan 7, 2025

I try to fix with a simple toUTC()... seems successful.

@alex-w alex-w added bug Something likely wrong in the code importance: critical Real showstopper, program fails here labels Jan 7, 2025
@alex-w alex-w added this to the 25.1 milestone Jan 7, 2025
@gzotti gzotti closed this as completed in 7242b74 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something likely wrong in the code importance: critical Real showstopper, program fails here
Development

No branches or pull requests

3 participants