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

Crash when screenshoting #3527

Closed
hflemmen opened this issue Dec 1, 2023 · 31 comments · Fixed by #3532
Closed

Crash when screenshoting #3527

hflemmen opened this issue Dec 1, 2023 · 31 comments · Fixed by #3532
Assignees
Labels
importance: critical Real showstopper, program fails here qt Issues, related to Qt framework
Milestone

Comments

@hflemmen
Copy link

hflemmen commented Dec 1, 2023

Expected Behaviour

Screenshot captured and saved.

Actual Behaviour

1 second freeze and then the program exits.

Steps to reproduce

  1. Open program
  2. Pres Ctrl+S to screenshot

System

  • Stellarium version: 23.3, from appimage called: "Stellarium-23.3-qt5-x86_64.AppImage"
  • Operating system: Linux Mint 21.2 (Similar to ubuntu 22.04 LTS)
  • Graphics Card: Nvidia A2000, CUDA-version: 12.2 and Mesa Intel® UHD Graphics (TGL GT1).

Logfile

log.txt

Copy link

github-actions bot commented Dec 1, 2023

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

@gzotti gzotti added the importance: critical Real showstopper, program fails here label Dec 1, 2023
@alex-w alex-w added the qt Issues, related to Qt framework label Dec 1, 2023
@hflemmen
Copy link
Author

hflemmen commented Dec 1, 2023

I missed that hint when making this issue, but the fix did not work. I tried with ubuntu 20.04 on the same hardware, and that worked, which indicates that Mint might be to blame.

@ilkant
Copy link

ilkant commented Dec 2, 2023

Ctrl+S works perfect on Linux Kubuntu 23.10 and Stellarium 23.3.335 compiled with Qt6 on own computer.

@gzotti
Copy link
Member

gzotti commented Dec 2, 2023

Probably has to do with (1) being an AppImage on (2) Mint.

@alex-w
Copy link
Member

alex-w commented Dec 2, 2023

I can prepare an AppImage/Qt6 for testing

@alex-w
Copy link
Member

alex-w commented Dec 3, 2023

@hflemmen
Copy link
Author

hflemmen commented Dec 4, 2023

@alex-w Both the qt5 and qt6 versions crash. I tested it on the same Mint system that failed originally.

@gzotti
Copy link
Member

gzotti commented Dec 4, 2023

I don't know the internals of AppImages. The log indicates a crash after beginning of shader compilation. Is the shader cache location (and, where's that to begin with?) accessible?

@10110111
Copy link
Contributor

10110111 commented Dec 4, 2023

The log indicates a crash after beginning of shader compilation.

No it doesn't. This message doesn't normally end with any kind of a "closing message". So the log simply doesn't tell anything.

@hflemmen Please get a stack trace from the crash.

@hflemmen
Copy link
Author

hflemmen commented Dec 4, 2023

Pardon my ignorance, but how do I get a stack trace from the crash?

@10110111
Copy link
Contributor

10110111 commented Dec 4, 2023

how do I get a stack trace from the crash?

See this page.

@alex-w Do we have a debug symbols package for the AppImage? Or maybe a debug version of the image?

@alex-w
Copy link
Member

alex-w commented Dec 4, 2023

@alex-w Do we have a debug symbols package for the AppImage?

No.

Or maybe a debug version of the image?

No.

P.S. We can prepare AppImage for Stellarium in Debug mode, but I fear it can be not an easy (due an AppImage architecture)

P.P.S. @hflemmen do you have installed standard Linux Mint 21.2 (what about DE)?

@10110111
Copy link
Contributor

10110111 commented Dec 4, 2023

it can be not an easy (due an AppImage architecture)

Why? Isn't it just a matter of setting CMAKE_BUILD_TYPE and avoiding any calls to strip?

@hflemmen
Copy link
Author

hflemmen commented Dec 4, 2023

P.P.S. @hflemmen do you have installed standard Linux Mint 21.2 (what about DE)?

No, I forgot. I have Linux Mint Mate, not Linux Mint Cinnamon, which is the default.

See this page.

I can have a look at it, but possibly not until tomorrow.

@gzotti
Copy link
Member

gzotti commented Dec 4, 2023

The log indicates a crash after beginning of shader compilation.

No it doesn't. This message doesn't normally end with any kind of a "closing message". So the log simply doesn't tell anything.

I wrote "after beginning", not "during". It tells us it came that far. Sure, it may be something else than shader cache accessibility. But it (and thus just configuration of that AppImage) can be one cause and (hopefully) simple item to check. I know however nothing about rules for SC locations within and outside of AppImage.

@alex-w
Copy link
Member

alex-w commented Dec 4, 2023

I've downloaded Linux Mint 21.2 and run it into VirtualBox (without installing). Next step - I've downloaded and run Stellarium 23.3. Taking a screenshot - no problems.

linux.txt
log.txt

@gzotti
Copy link
Member

gzotti commented Dec 4, 2023

The log ends even before zooming in to see any planet and trigger the message about planet shader compilation.

@alex-w
Copy link
Member

alex-w commented Dec 4, 2023

The log ends even before zooming in to see any planet and trigger the message about planet shader compilation.

log.txt

stellarium-002

@alex-w
Copy link
Member

alex-w commented Dec 4, 2023

So, I can't reproduce the issue.

@hflemmen
Copy link
Author

hflemmen commented Dec 4, 2023

Then maybe it is just something wrong with just my system. I made the backtrace from the qt5-version, but there is something wrong with my gdbinit. I think you can just ignore it.
gdb-Stellarium.txt

These two lines appeared in gdb when i tried to screenshot:

Thread 1 "stellarium" received signal SIGSEGV, Segmentation fault.
0x00007ffff674e144 in QScreen::geometry() const () from /tmp/.mount_Stella9xX6uO/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5

@alex-w
Copy link
Member

alex-w commented Dec 4, 2023

In the log I see resolution 2560x1440 - please try switch to windowed mode and take a screenshot again.

P.S. How many monitors had your computer?

@10110111
Copy link
Contributor

10110111 commented Dec 4, 2023

Why do we use QGuiApplication::screenAt(halfSceneSize) to get the screen to query geometry? Shouldn't we use the screen where our main window resides, i.e. mainWindow->screen()? It's completely possible that there's no screen (i.e. monitor) at particular coordinates.

@gzotti
Copy link
Member

gzotti commented Dec 4, 2023

With this we find the screen where the center of the window is. This may be helpful when moving the window from screen to screen. How does screen() determine partial visibility?

@10110111
Copy link
Contributor

10110111 commented Dec 4, 2023

With this we find the screen where the center of the window is.

The problem is that we determine the point from scene size, ignoring the position of the window. This then will bias the result towards the top-left screen.

How does screen() determine partial visibility?

The screen returned is the one that determines widget properties like the HiDPI scaling coefficient. Usually it switches when the center of the window crosses the border between the screens (assuming they are adjacent).

@gzotti
Copy link
Member

gzotti commented Dec 4, 2023

If you can simplify code without breaking things, go ahead.

@hflemmen
Copy link
Author

hflemmen commented Dec 5, 2023

@alex-w I tried to do make a screenshot in window mode, but it still failed. Final output was:

Creating scene FBO with size 2560x1440
Initializing planets GL shaders... 
Creating scene FBO with size 1024x768
Segmentation fault (core dumped)

log.txt

I have three monitors. Two main, and one smaller.

@alex-w
Copy link
Member

alex-w commented Dec 5, 2023

@hflemmen
Copy link
Author

hflemmen commented Dec 5, 2023

Thank you! I can confirm that it works now.

@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Dec 10, 2023
Copy link

Hello @hflemmen!

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

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Dec 23, 2023
Copy link

Hello @hflemmen!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
importance: critical Real showstopper, program fails here qt Issues, related to Qt framework
Development

Successfully merging a pull request may close this issue.

5 participants