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

Version 23.1 hangs at start and eats all CPU #3145

Closed
danfe opened this issue Mar 31, 2023 · 14 comments
Closed

Version 23.1 hangs at start and eats all CPU #3145

danfe opened this issue Mar 31, 2023 · 14 comments
Labels
bug Something likely wrong in the code invalid asdfasdf bla garble, or some issue out of our hands mesa Issues, related to MESA

Comments

@danfe
Copy link

danfe commented Mar 31, 2023

Just built version 23.1 the usual way on FreeBSD, and it didn't work: hangs after the line Using the ssystem_minor.ini file that already exists in the user directory... (starting with clean profile, the phrase is slightly different but still about the ssystem_minor.ini file), eating 100% CPU of all four cores. Rebuilding version 1.2 in the same environment and running it works fine.

Rebuilt with debug symbols and attached gdb(1) to the process, here's the backtrace:

#0  0x0000000802d6eb6c in ?? () from /lib/libthr.so.3
#1  0x0000000802d7ef00 in ?? () from /lib/libthr.so.3
#2  0x0000000802d706cf in ?? () from /lib/libthr.so.3
#3  0x0000000808fc1f29 in ?? () from /usr/local/lib/dri/swrast_dri.so
#4  0x00000008096570db in ?? () from /usr/local/lib/dri/swrast_dri.so
#5  0x0000000809654a4e in ?? () from /usr/local/lib/dri/swrast_dri.so
#6  0x000000080966b271 in ?? () from /usr/local/lib/dri/swrast_dri.so
#7  0x000000080966b35f in ?? () from /usr/local/lib/dri/swrast_dri.so
#8  0x00000008096a38dd in ?? () from /usr/local/lib/dri/swrast_dri.so
#9  0x00000008096a44fa in ?? () from /usr/local/lib/dri/swrast_dri.so
#10 0x00000008096a4ff1 in ?? () from /usr/local/lib/dri/swrast_dri.so
#11 0x0000000809238a74 in ?? () from /usr/local/lib/dri/swrast_dri.so
#12 0x00000008091c17df in ?? () from /usr/local/lib/dri/swrast_dri.so
#13 0x00000008091c0ea6 in ?? () from /usr/local/lib/dri/swrast_dri.so
#14 0x00000008091c0fc4 in ?? () from /usr/local/lib/dri/swrast_dri.so
#15 0x0000000802c1129b in ?? () from /usr/local/lib/qt5/libQt5Gui.so.5
#16 0x0000000802c10f74 in QOpenGLTextureGlyphCache::fillTexture(QTextureGlyphCache::Coord const&, unsigned int, QFixed) ()
   from /usr/local/lib/qt5/libQt5Gui.so.5
#17 0x0000000802b8a383 in QTextureGlyphCache::fillInPendingGlyphs() () from /usr/local/lib/qt5/libQt5Gui.so.5
#18 0x0000000802c0ab48 in ?? () from /usr/local/lib/qt5/libQt5Gui.so.5
#19 0x0000000802c0c478 in QOpenGL2PaintEngineEx::drawTextItem(QPointF const&, QTextItem const&) ()
   from /usr/local/lib/qt5/libQt5Gui.so.5
#20 0x0000000802b38caa in ?? () from /usr/local/lib/qt5/libQt5Gui.so.5
#21 0x0000000802b35d57 in QPainter::drawText(QPointF const&, QString const&, int, int) ()
   from /usr/local/lib/qt5/libQt5Gui.so.5
#22 0x0000000001033020 in QPainter::drawText (this=0x7fffffffbb48, x=-6, y=-1, s=...)
    at /usr/local/include/qt5/QtGui/qpainter.h:927
#23 0x00000000010257d2 in StelPainter::drawText (this=0x7fffffffc260, x=-919.227417, y=383.502808, str=..., 
    angleDeg=-11.7987413, xshift=-6.5, yshift=-1, noGravity=true)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/core/StelPainter.cpp:788
#24 0x00000000015a14c0 in Cardinals::draw (this=0x8367d6880, core=0x80825a800,
    latitude=23.11669921875)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/core/modules/LandscapeMgr.cpp:179
#25 0x00000000015a91fb in LandscapeMgr::draw (this=0x804b2b400,
    core=0x80825a800)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/core/modules/LandscapeMgr.cpp:677
#26 0x0000000000ed94ad in StelApp::draw (this=0x804a4c200)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/core/StelApp.cpp:832
#27 0x000000000174ac44 in StelRootItem::paint (this=0x80828d600, painter=0x7fffffffcc88, option=0x804a87a10,
    widget=0x80822c100) at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/StelMainView.cpp:419
#28 0x00000008025d61d4 in ?? () from /usr/local/lib/qt5/libQt5Widgets.so.5
#29 0x00000008025d5a46 in ?? () from /usr/local/lib/qt5/libQt5Widgets.so.5
#30 0x00000008025d5293 in ?? () from /usr/local/lib/qt5/libQt5Widgets.so.5
#31 0x00000008025f77a6 in QGraphicsView::paintEvent(QPaintEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#32 0x00000008022d53b7 in QWidget::event(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#33 0x000000080237460b in QFrame::event(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#34 0x00000008025f52cc in QGraphicsView::viewportEvent(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#35 0x000000080322fd79 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) ()
   from /usr/local/lib/qt5/libQt5Core.so.5
#36 0x000000080229bcb4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#37 0x000000080229d0a0 in QApplication::notify(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#38 0x000000080322fa20 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Core.so.5
#39 0x00000008022cee0c in QWidgetPrivate::sendPaintEvent(QRegion const&) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#40 0x00000008022f956f in QOpenGLWidget::event(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#41 0x000000080229bcc9 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#42 0x000000080229d0a0 in QApplication::notify(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#43 0x000000080322fa20 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Core.so.5
#44 0x00000008022d4042 in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
#45 0x00000008022d4da5 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#46 0x00000008022d4211 in QWidgetPrivate::showChildren(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#47 0x00000008022d3f39 in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
#48 0x00000008022d4da5 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
#49 0x00000008022c90b1 in QWidget::showFullScreen() () from /usr/local/lib/qt5/libQt5Widgets.so.5
#50 0x0000000001743c02 in StelMainView::setFullScreen (this=0x7fffffffe410, b=true)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/StelMainView.cpp:1437
#51 0x0000000000ea9a94 in main (argc=1, argv=0x7fffffffe6c8)
    at /tmp/usr/ports/astro/stellarium/work/stellarium-23.1/src/main.cpp:420
@alex-w alex-w added bug Something likely wrong in the code importance: critical Real showstopper, program fails here labels Mar 31, 2023
@alex-w
Copy link
Member

alex-w commented Mar 31, 2023

This is weird. Could you try disable fullscreen mode in the config.ini file and run it again?

P.S. Please check it with Qt6 also

@danfe
Copy link
Author

danfe commented Mar 31, 2023

Could you try disable fullscreen mode in the config.ini file and run it again?

Makes no difference.

Please check it with Qt6 also

Never installed anything Qt6-related, but I will try.

@alex-w alex-w added this to the 23.2 milestone Mar 31, 2023
@alex-w
Copy link
Member

alex-w commented Mar 31, 2023

Please attach log.txt from Stellarium

@10110111
Copy link
Contributor

Looks like a bug in Mesa. Your backtrace would be more useful if you installed debug symbols for swrast_dri.so and libthr.so.

From Stellarium side, if it used to work in a previous version, you can try using git bisect to find the point when things broke.

@danfe
Copy link
Author

danfe commented Mar 31, 2023

Your backtrace would be more useful if you installed debug symbols for swrast_dri.so and libthr.so.

We don't have separate debug packages in FreeBSD, I'd have to rebuild and reinstall those in debug mode. Not sure if I want to mess with that just yet on my working system. :-)

From Stellarium side, if it used to work in a previous version, you can try using git bisect to find the point when things broke.

Yeah, sounds like a plan, but that would take some time.

P.S. Building against Qt6 did not make a difference.

@alex-w
Copy link
Member

alex-w commented Apr 29, 2023

@danfe any news?

@danfe
Copy link
Author

danfe commented Apr 29, 2023

Not yet, sorry, I haven't forgotten about this, just $work and life got in the way. Hopefully I'd have some free time slots during the coming holidays.

@danfe
Copy link
Author

danfe commented May 1, 2023

So I've done the bisecting, reverting commit 7fa8015 fixes the problem for me.

@10110111
Copy link
Contributor

10110111 commented May 1, 2023

Well, this commit doesn't do anything to text rendering. The problem is most likely in Mesa.

Switching to another rasterizer, e.g. softpipe instead of llvmpipe or vice versa, might help. In any case, looks like you need to try upgrading to the latest version of Mesa and, if it still doesn't work, then report it to their bug tracker.

@danfe
Copy link
Author

danfe commented May 24, 2023

Switching to another rasterizer, e.g. softpipe instead of llvmpipe or vice versa, might help.

I'd much rather not worry about these details and assume that the system picks the best one for me, but that gave me a clue. This is the excerpt of the glxinfo -B output in the context where Stellarium crashes:

    Vendor: Mesa/X.org (0xffffffff)
    Device: llvmpipe (LLVM 11.0.1, 256 bits) (0xffffffff)
    Accelerated: no
    Max core profile version: 4.5
    Max compat profile version: 4.5

So the crash was occurring in a non-accelerated, LLVM-backed graphics mode. My X11 session just crashed this morning so I had to restart it, and now glxinfo -B reports:

    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) HD Graphics 620 (KBL GT2) (0x5916)
    Accelerated: yes
    Max core profile version: 4.6
    Max compat profile version: 4.6

The same Stellarium binary built earlier does not crash now! However, if I suspend the laptop or switch the virtual console, the video context reverts to the broken state again.

@10110111
Copy link
Contributor

and assume that the system picks the best one for me

It never does: llvmpipe is the default, and you can switch by GALLIUM_DRIVER environment variable to softpipe.

So the crash was occurring in a non-accelerated, LLVM-backed graphics mode.

Well, this still sounds like a bug in Mesa...

However, if I suspend the laptop or switch the virtual console, the video context reverts to the broken state again.

... or even in the X or kernel driver. Or both (one breaking VT switches, another leading to crash in llvmpipe).

@gzotti
Copy link
Member

gzotti commented Jun 16, 2023

It seems to be not our bug then. Can somebody convert the gist of this to an FAQ troubleshoot entry? (Common problems in the current version). We can then close this.

@danfe
Copy link
Author

danfe commented Jun 19, 2023

It seems to be not our bug then.

Apparently so, as people report other 2D/3D graphical programs also stop working correctly after VT switch on FreeBSD. However, I want to test non-accelerated, but otherwise "unbroken" scfb and vesa contexts to see if Stellarium reads the video capabilities correctly in constrained environments.

@alex-w alex-w added mesa Issues, related to MESA and removed importance: critical Real showstopper, program fails here labels Jun 19, 2023
@alex-w alex-w removed this from the 23.2 milestone Jun 19, 2023
@alex-w alex-w added the invalid asdfasdf bla garble, or some issue out of our hands label Jun 19, 2023
@github-actions
Copy link

Sorry, but this issue seems out of our hands.

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 invalid asdfasdf bla garble, or some issue out of our hands mesa Issues, related to MESA
Development

No branches or pull requests

4 participants