Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 710654 - media-gfx/inkscape-1.0_rc1 crashes at startup with no explanation
Summary: media-gfx/inkscape-1.0_rc1 crashes at startup with no explanation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mikle Kolyada (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-24 13:11 UTC by Michelangelo Scopelliti
Modified: 2020-05-05 18:32 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michelangelo Scopelliti 2020-02-24 13:11:15 UTC
Launching inkscape-1.0_beta2-r1 from .desktop file produces no results. Launching from the terminal, the following message appears:

Pango version: 1.42.4

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at https://inkscape.org/report
with a detailed description of the steps leading to the crash, so we can fix it.

Then, the only way to have back the terminal is to send a ctrl-c.

After a few tests, it seems that gcc optimizations flags are responsible:

I usually have "-march=native -mtune=native -O2 -pipe" as C{,XX}FLAGS; removing -O2 (switching back to the default -O0) solves the issue. "-O1" fails too.

So far, tested on
* AMD A8-3870 APU
* Intel Core i5-3337U
* Intel Core i7-7700

same issue, same workaround.

Reproducible: Always




emerge --info

Portage 2.3.89 (python 3.6.10-final-0, default/linux/amd64/17.1, gcc-9.2.0, glibc-2.30-r4, 5.5.6 x86_64)
=================================================================
System uname: Linux-5.5.6-x86_64-AMD_A8-3870_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.7
KiB Mem:    14335348 total,  11987328 free
KiB Swap:   16777212 total,  16777212 free
Head commit of repository gentoo: 76564b25906ca2a8e495a623c512d407b1d3837e

Head commit of repository libressl: 627d406a396adfd95cc7ab13a61e5aee569289d5

sh bash 5.0_p16
ld GNU gold (Gentoo 2.34 p1 2.34.0) 1.16
app-shells/bash:          5.0_p16::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17-r1::gentoo, 3.6.10::gentoo, 3.7.6::gentoo, 3.8.1::gentoo
dev-util/cmake:           3.16.4::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.1-r2::gentoo
sys-devel/binutils:       2.34::gentoo
sys-devel/gcc:            9.2.0-r4::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r4::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000

kernelpanic
    location: /var/db/repos/kernelpanic
    masters: gentoo
    priority: 0

libressl
    location: /var/db/repos/libressl
    sync-type: git
    sync-uri: https://github.com/gentoo/libressl.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE @EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -mtune=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup clean-logs compress-build-logs config-protect-if-modified distlocks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mtune=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 ao berkdb blas bluetooth bluray branding bzip2 cairo cdda cjk clang cli crypt cups curl cxx dbus djvu dri dvb dvd elogind encode eselect-ldso exif ffmpeg fftw flac fontconfig fortran gdbm gif gimp gmp gnome-keyring gsm harfbuzz heif iconv icu imlib inotify ipv6 jbig jemalloc jit jpeg jpeg2k lapack latex lcms libass libnotify libressl libtirpc lto lz4 lzma lzo mms mng mp3 mpeg multilib natspec ncurses nls nptl nss offensive ogg openal opencv openexr opengl openmp opus pam pango pcre pdf plotutils png policykit postproc postscript pulseaudio raw readline scanner seccomp smp sndfile sound sox speex spell spice split-usr ssl startup-notification svg theora threads tiff truetype udev udisks unicode usb vim-syntax vorbis vpx wavpack webp wmf x264 xattr xcb xcomposite xml xmp xpm xv xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="it en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby27" SANE_BACKENDS="xerox_mfp" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Michael Orlitzky gentoo-dev 2020-02-24 17:15:10 UTC
For best results, you should probably open an issue upstream:

> If you can reproduce this crash, please file a bug at https://inkscape.org/report with a detailed description of the steps leading to the crash, so we can fix it.

We don't do anything unusual with inkscape in Gentoo, so the fix will likely be upstream. Normally we're happy to shovel bug reports upstream for you, but in this case they'll probably ask for more information, like what happens if you build inkscape with some debugging flags and capture a crash dump with gdb. Having us act as a middle-man would just annoy everyone involved =)
Comment 2 Michelangelo Scopelliti 2020-02-25 08:35:00 UTC
(In reply to Michael Orlitzky from comment #1)
> For best results, you should probably open an issue upstream:
> 
> > If you can reproduce this crash, please file a bug at https://inkscape.org/report with a detailed description of the steps leading to the crash, so we can fix it.
> 
> We don't do anything unusual with inkscape in Gentoo, so the fix will likely
> be upstream. Normally we're happy to shovel bug reports upstream for you,
> but in this case they'll probably ask for more information, like what
> happens if you build inkscape with some debugging flags and capture a crash
> dump with gdb. Having us act as a middle-man would just annoy everyone
> involved =)

Having you act a s middle-man would be wrong at many levels, it's true. But the reason I'm posting here is not that, and is don't agree about the fact "we don't do anything unusual with inkscape".

According to their INSTALL.md, the thing to do should be

mkdir build
cd build
cmake ..
make
make install

leaving choosing the compiler and the optimization to cmake magic (or author presets). AFAICT, Gentoo enforces user *FLAGS -- unless some issue occur.

And that is what I'm writing about: -O2 (a flag suggested in the handbook, not by inkscape developers) causes runtime failures.

For that reason (and because -O2 is in the Gentoo installation handbook) I think it would be appropriate to filter out -O2 from *FLAGS (and also -O1/-O, according to my tests).
Comment 3 Michelangelo Scopelliti 2020-02-25 09:06:33 UTC
BTW: it could be related to bug #688212
Comment 4 Michael Orlitzky gentoo-dev 2020-02-26 18:29:55 UTC
Are you using graphite with GCC? If so, I agree that this is probably the same issue as bug 688212.


(In reply to Michelangelo Scopelliti from comment #2)
> leaving choosing the compiler and the optimization to cmake magic (or author presets). AFAICT, Gentoo enforces user *FLAGS -- unless some issue occur.
>
>And that is what I'm writing about: -O2 (a flag suggested in the handbook, not by inkscape developers) causes runtime failures.

This can be a grey area, but I don't think it is with -O2. The upstream build system will also use the user's CFLAGS by default, and -O2 is a very safe set of optimizations. Of course it's possible to put crazy stuff in CFLAGS, and then upstream will ignore your bug reports. But these days, even -O3 is fairly safe, and the flags in -O2 should never do anything wrong with correct code. So if -O2 causes problems, it's either a compiler bug or a code bug.
Comment 5 vowstar 2020-03-11 02:16:05 UTC
(In reply to Michelangelo Scopelliti from comment #0)
> Launching inkscape-1.0_beta2-r1 from .desktop file produces no results.
> Launching from the terminal, the following message appears:
> 
> Pango version: 1.42.4
> 
> Emergency save activated!
> Emergency save completed. Inkscape will close now.
> If you can reproduce this crash, please file a bug at
> https://inkscape.org/report
> with a detailed description of the steps leading to the crash, so we can fix
> it.
> 
> Then, the only way to have back the terminal is to send a ctrl-c.
> 
> After a few tests, it seems that gcc optimizations flags are responsible:
> 
> I usually have "-march=native -mtune=native -O2 -pipe" as C{,XX}FLAGS;
> removing -O2 (switching back to the default -O0) solves the issue. "-O1"
> fails too.
> 
> So far, tested on
> * AMD A8-3870 APU
> * Intel Core i5-3337U
> * Intel Core i7-7700
> 
> same issue, same workaround.
> 
> Reproducible: Always
> 
> 
> 
> 
> emerge --info
> 
> Portage 2.3.89 (python 3.6.10-final-0, default/linux/amd64/17.1, gcc-9.2.0,
> glibc-2.30-r4, 5.5.6 x86_64)
> =================================================================
> System uname:
> Linux-5.5.6-x86_64-AMD_A8-3870_APU_with_Radeon-tm-_HD_Graphics-with-gentoo-2.
> 7
> KiB Mem:    14335348 total,  11987328 free
> KiB Swap:   16777212 total,  16777212 free
> Head commit of repository gentoo: 76564b25906ca2a8e495a623c512d407b1d3837e
> 
> Head commit of repository libressl: 627d406a396adfd95cc7ab13a61e5aee569289d5
> 
> sh bash 5.0_p16
> ld GNU gold (Gentoo 2.34 p1 2.34.0) 1.16
> app-shells/bash:          5.0_p16::gentoo
> dev-java/java-config:     2.2.0-r4::gentoo
> dev-lang/perl:            5.30.1::gentoo
> dev-lang/python:          2.7.17-r1::gentoo, 3.6.10::gentoo, 3.7.6::gentoo,
> 3.8.1::gentoo
> dev-util/cmake:           3.16.4::gentoo
> sys-apps/baselayout:      2.7::gentoo
> sys-apps/openrc:          0.42.1::gentoo
> sys-apps/sandbox:         2.18::gentoo
> sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
> sys-devel/automake:       1.16.1-r2::gentoo
> sys-devel/binutils:       2.34::gentoo
> sys-devel/gcc:            9.2.0-r4::gentoo
> sys-devel/gcc-config:     2.2.1::gentoo
> sys-devel/libtool:        2.4.6-r6::gentoo
> sys-devel/make:           4.3::gentoo
> sys-kernel/linux-headers: 5.5::gentoo (virtual/os-headers)
> sys-libs/glibc:           2.30-r4::gentoo
> Repositories:
> 
> gentoo
>     location: /var/db/repos/gentoo
>     sync-type: git
>     sync-uri: https://github.com/gentoo/gentoo.git
>     priority: -1000
> 
> kernelpanic
>     location: /var/db/repos/kernelpanic
>     masters: gentoo
>     priority: 0
> 
> libressl
>     location: /var/db/repos/libressl
>     sync-type: git
>     sync-uri: https://github.com/gentoo/libressl.git
>     masters: gentoo
> 
> ACCEPT_KEYWORDS="amd64 ~amd64"
> ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE @EULA"
> CBUILD="x86_64-pc-linux-gnu"
> CFLAGS="-march=native -mtune=native -O2 -pipe"
> CHOST="x86_64-pc-linux-gnu"
> CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc
> /usr/share/gnupg/qualified.txt"
> CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d
> /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild
> /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d
> /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
> CXXFLAGS="-march=native -mtune=native -O2 -pipe"
> DISTDIR="/var/cache/distfiles"
> ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT
> PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME
> XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
> FCFLAGS="-march=native -mtune=native -O2 -pipe"
> FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup
> clean-logs compress-build-logs config-protect-if-modified distlocks
> fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news
> parallel-fetch pid-sandbox preserve-libs protect-owned
> qa-unresolved-soname-deps sandbox sfperms split-elog split-log strict
> unknown-features-warn unmerge-orphans userfetch userpriv usersandbox
> usersync xattr"
> FFLAGS="-march=native -mtune=native -O2 -pipe"
> GENTOO_MIRRORS="http://distfiles.gentoo.org"
> LANG="it_IT.UTF-8"
> LDFLAGS="-Wl,-O2 -Wl,--as-needed"
> MAKEOPTS="-j5"
> PKGDIR="/var/cache/binpkgs"
> PORTAGE_CONFIGROOT="/"
> PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
> --omit-dir-times --compress --force --whole-file --delete --stats
> --human-readable --timeout=180 --exclude=/distfiles --exclude=/local
> --exclude=/packages --exclude=/.git"
> PORTAGE_TMPDIR="/var/tmp"
> USE="X a52 aac acl acpi alsa amd64 ao berkdb blas bluetooth bluray branding
> bzip2 cairo cdda cjk clang cli crypt cups curl cxx dbus djvu dri dvb dvd
> elogind encode eselect-ldso exif ffmpeg fftw flac fontconfig fortran gdbm
> gif gimp gmp gnome-keyring gsm harfbuzz heif iconv icu imlib inotify ipv6
> jbig jemalloc jit jpeg jpeg2k lapack latex lcms libass libnotify libressl
> libtirpc lto lz4 lzma lzo mms mng mp3 mpeg multilib natspec ncurses nls nptl
> nss offensive ogg openal opencv openexr opengl openmp opus pam pango pcre
> pdf plotutils png policykit postproc postscript pulseaudio raw readline
> scanner seccomp smp sndfile sound sox speex spell spice split-usr ssl
> startup-notification svg theora threads tiff truetype udev udisks unicode
> usb vim-syntax vorbis vpx wavpack webp wmf x264 xattr xcb xcomposite xml xmp
> xpm xv xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018"
> ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x
> ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3
> trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core
> authz_core socache_shmcb unixd actions alias auth_basic authn_alias
> authn_anon authn_dbm authn_default authn_file authz_dbm authz_default
> authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid
> dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache
> filter headers include info log_config logio mem_cache mime mime_magic
> negotiation rewrite setenvif speling status unique_id userdir usertrack
> vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df
> interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext
> mmx mmxext popcnt sse sse2 sse3 sse4a" CURL_SSL="libressl" ELIBC="glibc"
> GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt
> gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle
> oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt
> ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="it en"
> LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb
> ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
> LLVM_TARGETS="AMDGPU" OFFICE_IMPLEMENTATION="libreoffice"
> PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11"
> PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6"
> RUBY_TARGETS="ruby27" SANE_BACKENDS="xerox_mfp" USERLAND="GNU"
> VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2
> ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal
> rawnat logmark ipmark dhcpmac delude chaos account"
> Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK,
> LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS,
> PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Same problem for me, and I find the root cause. This problem is caused by jemalloc.

You add jemalloc as your global USE.

The fix is add -jemalloc to /etc/portage/package.use/inkscape file to avoid inkscape use jemalloc.


media-gfx/inkscape -jemalloc


https://gitlab.com/inkscape/inkscape/-/issues/583
https://gitlab.com/inkscape/inkscape/issues/598
Comment 6 Michelangelo Scopelliti 2020-03-14 16:01:51 UTC
(In reply to vowstar from comment #5)
[CUT] 
> Same problem for me, and I find the root cause. This problem is caused by
> jemalloc.
> 
> You add jemalloc as your global USE.
> 
> The fix is add -jemalloc to /etc/portage/package.use/inkscape file to avoid
> inkscape use jemalloc.
> 
> 
> media-gfx/inkscape -jemalloc
> 
> 
> https://gitlab.com/inkscape/inkscape/-/issues/583
> https://gitlab.com/inkscape/inkscape/issues/598

Thank you, you suggestion works for me
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-04-23 19:25:15 UTC
Ditto for rc1
Comment 8 Michelangelo Scopelliti 2020-05-05 17:16:28 UTC
No crashes with inkscape-1.0 (USE=jemalloc)
Comment 9 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2020-05-05 18:32:31 UTC
Yep, I was unable to reproduce too.