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

xournalpp / xournal++ crashes at startup #63715

Closed
jluttine opened this issue Jun 24, 2019 · 23 comments
Closed

xournalpp / xournal++ crashes at startup #63715

jluttine opened this issue Jun 24, 2019 · 23 comments

Comments

@jluttine
Copy link
Member

Issue description

Xournalpp crashes immediately.

Steps to reproduce'

I don't have KDE nor GNOME installed in case that matters.

$ nix-build '<nixpkgs>' -A xournalpp
$ result/bin/xournalpp


** (xournalpp:2719): WARNING **: 08:08:07.696: Failed to load "colornames.ini" (/home/jluttine/.xournalpp/colornames.ini): No such file or directory

ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2636:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2636:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2636:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
**
Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Icon 'image-missing' not present in theme breeze (gtk-icon-theme-error-quark, 0)

** (xournalpp:2719): WARNING **: 08:08:07.827: [Crash Handler] Crashed with signal 6

** (xournalpp:2719): WARNING **: 08:08:07.832: [Crash Handler] Wrote crash log to: /home/jluttine/.xournalpp/errorlogs/errorlog.20190624-080807.log
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found
sh: addr2line: command not found

** (xournalpp:2719): WARNING **: 08:08:07.942: Trying to emergency save the current open document…

** (xournalpp:2719): WARNING **: 08:08:07.943: Successfully saved document to "/home/jluttine/.xournalpp/emergencysave.xopp"

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.47, NixOS, 19.09.git.4ab1c14 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - nixpkgs: `/etc/nixpkgs`
@jtojnar
Copy link
Member

jtojnar commented Jun 24, 2019

Do you have an icon theme installed?

@jluttine
Copy link
Member Author

I don't know, so maybe not..

@jtojnar
Copy link
Member

jtojnar commented Jun 24, 2019

#63089 (comment)

@KoviRobi
Copy link
Contributor

KoviRobi commented Dec 6, 2019

Installing gnome3.adwaita-icon-theme as per #63089 fixed it for me (but I tried hicolor-icon-theme first, which didn't). Though crashing is by no means a good or descriptive way to tell the user to install icons. I wonder if there is a fallback icon (not an icon set, just a single one) we could bundle with things to stop this

@wucke13
Copy link
Contributor

wucke13 commented Feb 7, 2020

This should be fixed IMO. It is very against the nix ideology to require one package to be installed for another to function.
cc @andrew-d @sikmir

@andrew-d
Copy link
Contributor

I'd be happy to take a fix to xournalpp here, but I'm not quite sure what the best approach is. My understanding is that GTK+ itself is what's crashing if the "image-missing" icon isn't found - see here.

As I understand it, we have the following options:

  • Unconditionally wrap xournalpp with some icon theme; I'm not sure how this interacts with allowing users to still customize things themselves.
  • Fix GTK+ to not crash if the icon is missing; I don't know how to do this
  • Try to detect this case in xournalpp or other utilities and throw an error; I could probably write a wrapper that searched XDG_ICON_DIRS, but I'm not 100% sure this works, and it feels too hacky.
  • Maybe create an "empty" icon theme that's always linked by default and contains only the image-missing.png image?

@andrew-d
Copy link
Contributor

I haven't had the chance to test it, but if anyone else wants to: here's an example of a Nix derivation for an icon theme that only contains the image-missing.png images from the Adwaita icon theme:
https://gist.github.com/andrew-d/41f2942a32b02249fac2dadf934cecec

@wucke13
Copy link
Contributor

wucke13 commented Feb 10, 2020

Why isn't

Unconditionally wrap xournalpp with some icon theme; I'm not sure how this interacts with allowing users to still customize things themselves.

The obvious solution? It is still possible to set another icon theme locally (if using .gtkrc and pendants), provided it is also installed to the regarding environment?

@KoviRobi
Copy link
Contributor

I guess it's mostly a question of icons are large (ish) and we don't want to install unnecessary icons. I am pro the image-missing solution, provided we also document it somewhere (not sure if NixOS manual is the best place, could apply to non-NixOS nix installations, so the Nix manual).

Also, the .gtkrc is an annoying solution as it's not part of the nixos config, I guess.

@jtojnar
Copy link
Member

jtojnar commented Feb 10, 2020

@KoviRobi

I guess it's mostly a question of icons are large (ish) and we don't want to install unnecessary icons. I am pro the image-missing solution, provided we also document it somewhere (not sure if NixOS manual is the best place, could apply to non-NixOS nix installations, so the Nix manual).

This is indeed the primary reason, see the discussion in #43150.

@andrew-d

  • Unconditionally wrap xournalpp with some icon theme; I'm not sure how this interacts with allowing users to still customize things themselves.

Customization is still possible (the theme used will be still the one set in profile, defaulting to Adwaita), the closure is the main concern.

  • Fix GTK+ to not crash if the icon is missing; I don't know how to do this

I talked with GTK devs on IRC a few days ago and they also said that GTK should use the image-missing from GTK and the source code looks like that is what should be happening but to no avail.

Actually, it seems to somewhat work – try running env XDG_DATA_DIRS= (nix-build -A gtk3.dev --no-out-link)/bin/gtk3-icon-browser, it will have the image-missing in the CSD.

  • Maybe create an "empty" icon theme that's always linked by default and contains only the image-missing.png image?

Brilliant idea. This would be an acceptable compromise, I think, until it is fixed in GTK. We should probably use fetchurl { url = "https://gitlab.gnome.org/GNOME/gtk/blob/3.24.13/gtk/icons/16x16/status/image-missing.png"; } to avoid depending on Adwaita, and add it to hicolor-icon-theme instead of new theme. Then we can add the icon theme to wrapGAppsHook.

  • Try to detect this case in xournalpp or other utilities and throw an error; I could probably write a wrapper that searched XDG_ICON_DIRS, but I'm not 100% sure this works, and it feels too hacky.

We might still want something like this to let users know they should install an icon theme. But we can worry about that once we prevent the crash.

@stale
Copy link

stale bot commented Aug 8, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 8, 2020
@gebner
Copy link
Member

gebner commented Aug 25, 2020

This is still an issue.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 25, 2020
@sikmir
Copy link
Member

sikmir commented Sep 7, 2020

Just in case, the same problem with MyPaint (#54677), it crashes at startup.

@stale
Copy link

stale bot commented Sep 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 19, 2021
@vojta001
Copy link
Contributor

I can only reproduce it when trying to export a pdf with xournalpp -p out.pdf in.xopp, which might be a different issue (yet still annoying).

What about you @sikmir @jluttine?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 16, 2021
@sikmir
Copy link
Member

sikmir commented Nov 16, 2021

I can only reproduce it when trying to export a pdf with xournalpp -p out.pdf in.xopp, which might be a different issue (yet still annoying).

What about you @sikmir @jluttine?

I really cannot reproduce the crash neither at startup, nor with xournalpp -p out.pdf in.xopp. Could you please provide crash dump or backtrace? Otherwise it's hard to say what is going wrong.

@jluttine
Copy link
Member Author

Seems to work for me now. I don't know what has changed. Should I close this or is it still an issue for someone?

@atilaTrackfy
Copy link

I still have this problem.

@sikmir
Copy link
Member

sikmir commented Feb 13, 2022

Try #159902, maybe it helps.

@vojta001
Copy link
Contributor

@sikmir I cannot reproduce the problem anymore. Good catch!

@jtojnar jtojnar closed this as completed Feb 15, 2022
@jotapesse
Copy link

Hello, this is still an issue for me! On a NixOS unstable 23.11 install with KDE Plasma. Same error as original post:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.5.5, NixOS, 23.11 (Tapir), 23.11pre531102.fdd898f8f79e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
$ xournalpp
xopp-Message: 15:37:02.273: TEXTDOMAINDIR = (null), Platform-specific locale dir = /nix/store/dn1g7biypbl60pamj5zsc4lhaq8zxggi-xournalpp-1.2.1/share/xournalpp/../locale, chosen directory = /nix/store/dn1g7biypbl60pamj5zsc4lhaq8zxggi-xournalpp-1.2.1/share/xournalpp/../locale
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2737:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2737:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2737:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
xopp-Message: 15:37:02.324: Plugin "MigrateFontSizes" UI initialized

(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.401: No device found. Is Xournal++ running in debugger / Eclipse...?
Probably this is the reason for not finding devices!


(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.418: No device found. Is Xournal++ running in debugger / Eclipse...?
Probably this is the reason for not finding devices!

**
Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Icon 'image-missing' not present in theme Adwaita (gtk-icon-theme-error-quark, 0)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Icon 'image-missing' not present in theme Adwaita (gtk-icon-theme-error-quark, 0)

(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.455: [Crash Handler] Crashed with signal 6

(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.455: [Crash Handler] Wrote crash log to: /home/joao/.cache/xournalpp/errorlogs/errorlog.20231007-153702.log
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found
sh: line 1: addr2line: command not found

(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.586: Trying to emergency save the current open document…

(com.github.xournalpp.xournalpp:93805): xopp-WARNING **: 15:37:02.586: Successfully saved document to "/home/joao/.config/xournalpp/emergencysave.xopp"

@LucaGawa
Copy link

LucaGawa commented Oct 10, 2023

installing the gnome.adwaita-icon-theme solved the problem for me

@jotapesse
Copy link

Thanks. I can confirm that it solves the issues. But if it is a known requirement/dependency for so long already shouldn't the xournalpp package install it in the first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests