Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482036 - kde-base/kmail kde-base/dolphin 4.11.0 - selecting "Open with 'LibreOffice Writer'" crashes dolphin/kmail/...
Summary: kde-base/kmail kde-base/dolphin 4.11.0 - selecting "Open with 'LibreOffice Wr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL: https://gerrit.libreoffice.org/6018
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-21 23:38 UTC by Tanktalus
Modified: 2013-12-30 19:01 UTC (History)
2 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 Tanktalus 2013-08-21 23:38:26 UTC
KDE team implies this is a Gentoo problem, I'm not sure.

Basically, when I open .doc or .docx files (haven't tried other office files, but I assume they're the same), by clicking on them as an attachment in kmail and then selecting "Open with 'LibreOffice Writer'" (and not via "Open With..." - that works), I get a crash, whose backtrace you can see in the KDE bug linked above.

I just checked, based on the original discussion, and I get the same problem opening a .doc file in dolphin.

I was assuming that it was due to libreoffice's /usr/lib64/libreoffice/share/xdg/writer.desktop having the following two lines:


Exec=libreoffice --writer %F
X-KDE-Protocols=file,http,smb,ftp,webdav

Because it makes no sense to use %F (list of local files) when you support protocols like http.  Instead, %U would make more sense.

However, in IRC with genstorm, they claimed their desktop file looks the same and yet they don't get a crash, so I'm not sure why anymore, but thought I'd open this to see if anyone else has an idea.

Reproducible: Always

Steps to Reproduce:
1. Find a .doc file in email attachment or via dolphin
2. Click on it.  If attachment, then click on "Open With 'LibreOffice Writer'"

Actual Results:  
Crash.

Expected Results:  
libreoffice comes up with the document in question

[I] app-office/libreoffice
     Available versions:  4.0.4.2 **4.0.9999 (~)4.1.0.4 **4.1.9999 **9999-r2 {aqua bluetooth +branding +cups dbus debug eds firebird gnome gstreamer +gtk gtk3 java jemalloc kde mysql odk opengl postgres telepathy test +vba +webdav ELIBC="FreeBSD" LIBREOFFICE_EXTENSIONS="nlpsolver presenter-minimizer scripting-beanshell scripting-javascript wiki-publisher" PYTHON_SINGLE_TARGET="python2_7 python3_3" PYTHON_TARGETS="python2_7 python3_3"}
     Installed versions:  4.1.0.4(02:28:24 PM 07/26/2013)(branding cups dbus gtk java kde opengl vba webdav -aqua -bluetooth -debug -eds -gnome -gstreamer -gtk3 -jemalloc -mysql -odk -postgres -telepathy -test ELIBC="-FreeBSD" LIBREOFFICE_EXTENSIONS="presenter-minimizer -nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python2_7 -python3_3" PYTHON_TARGETS="python2_7 -python3_3")
     Homepage:            http://www.libreoffice.org
     Description:         LibreOffice, a full office productivity suite.


Portage 2.2.0 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.10.9-gentoo x86_64)
=================================================================
System uname: Linux-3.10.9-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_930_@_2.80GHz-with-gentoo-2.2
KiB Mem:    12296784 total,    567800 free
KiB Swap:   25165820 total,  25161072 free
Timestamp of tree: Wed, 21 Aug 2013 07:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5, 3.2.5-r1
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.4_p6-r1, 1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo private x11 kde
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=core2 -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=core2 -ggdb"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.arcticnetwork.ca/ ftp://gentoo.mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo ftp://gentoo.arcticnetwork.ca/pub/gentoo/ http://gentoo.llarian.net/ ftp://gentoo.llarian.net/pub/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j13 -l25"
PKGDIR="/usr/portage/packages"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/dmcbride/cvs/portdir-mine /usr/portage/local/layman/x11 /usr/portage/local/layman/kde"
SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apache2 audiofile avahi avi bash-completion berkdb branding bzip2 cairo cdda cddb cdparanoia cdr cli consolekit cracklib crypt css cups cxx dbus dri dvd dvdr dvdread enca encode exif expat ffmpeg fftw firefox fontconfig fortran gd gdbm gif gimp gmp gnutls gs handbook htmlhandbook iconv imagemagick ipv6 java jbig jpeg jpeg2k kde kipi lcms libnotify lzma lzo mad mjpeg mmx mng modules mp3 mpeg mudflap multilib ncurses nls nptl nsplugin ogg opengl openmp pam pcre perl png policykit python qt4 rdesktop readline scanner sdl semantic-desktop session smp sse sse2 ssl subversion svg tcpd threads tiff truetype udev unicode vaapi vcd vde vorbis win32codecs wmf x264 xcb xcomposite xinerama xml xulrunner xvid zlib" ABI_X86="32 64" 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="proxy proxy_http 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Tanktalus 2013-09-04 22:02:57 UTC
Changing writer.desktop to end with:


[X-New Shortcut Group]
UnityQuicklist=New Document
Exec=libreoffice --writer %U
TargetEnvironment=Unity

(changing the %F to %U on the second last line here) resolves the issue.  I'm not sure how to cause that change in libreoffice, though.

Meanwhile, I've asked upstream if crashing could be avoided, and a useful error message could be emitted instead.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2013-09-11 19:06:36 UTC
(In reply to Tanktalus from comment #0)
> KDE team implies this is a Gentoo problem, I'm not sure.
Yeah, some parts of upstream, especially PIM, are not too keen on Gentoo.

> Basically, when I open .doc or .docx files (haven't tried other office
> files, but I assume they're the same), by clicking on them as an attachment
> in kmail and then selecting "Open with 'LibreOffice Writer'" (and not via
> "Open With..." - that works), I get a crash, whose backtrace you can see in
> the KDE bug linked above.
As per the upstream bug, the crash is occurring because we are using a "debug" build (or rather, not explicitly using the magic release build type). It looks like the magic CFLAGS are -DNDEBUG -DQT_NO_DEBUG. We already use the latter for USE="-debug", I guess we should add the former too.

> I was assuming that it was due to libreoffice's
> /usr/lib64/libreoffice/share/xdg/writer.desktop having the following two
> lines:
> 
> 
> Exec=libreoffice --writer %F
> X-KDE-Protocols=file,http,smb,ftp,webdav
> 
> Because it makes no sense to use %F (list of local files) when you support
> protocols like http.  Instead, %U would make more sense.
@openoffice, from the upstream bug:
The desktop files in libreoffice/sysui/desktop/share/brand.pl substitute %%FILE%% to %U if --urls is true (else, it uses %F) "--urls" is defined in libreoffice/sysui/CustomTarget_share.mk if ENABLE_GIO or ENABLE_GNOMEVFS is true. and finally ENABLE_GNOMEVFS is true if gnome-vfs is found while configuring libreoffice

According to comment #1, it works after manually changing it, so maybe it would be useful to ship that change.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2013-09-11 19:16:21 UTC
(In reply to Michael Palimaka (kensington) from comment #2)
> As per the upstream bug, the crash is occurring because we are using a
> "debug" build (or rather, not explicitly using the magic release build
> type). It looks like the magic CFLAGS are -DNDEBUG -DQT_NO_DEBUG. We already
> use the latter for USE="-debug", I guess we should add the former too.

Did you build your KDE applications with USE="debug"? It turns out that we already do pass both those flags.
Comment 4 Tanktalus 2013-09-11 20:27:43 UTC
(In reply to Michael Palimaka (kensington) from comment #3)
> Did you build your KDE applications with USE="debug"? It turns out that we
> already do pass both those flags.

Yes.  And after upgrading Qt to 4.8.5, the problem also seems to have disappeared.  No idea why that would be after the explanation upstream.
Comment 5 Tomáš Chvátal (RETIRED) gentoo-dev 2013-09-23 12:19:31 UTC
Submitted fix to gerrit, lets see if it is really the way how to fix it.
Comment 6 Tomáš Chvátal (RETIRED) gentoo-dev 2013-12-27 08:58:26 UTC
Ok fixed in 4.1.4.2 so closing.
Comment 7 Tanktalus 2013-12-30 19:01:52 UTC
To be honest, I'm still getting this with KDE 4.12.0 and libreoffice 4.1.4.2 - it's still using %F instead of %U in the desktop files.

According to eix, it was merged as:

     Installed versions:  4.1.4.2(09:30:10 AM 12/27/2013)(branding cups dbus gtk java kde opengl vba webdav -aqua -bluetooth -debug -eds -gnome -gstreamer -gtk3 -jemalloc -mysql -odk -postgres -telepathy -test ELIBC="-FreeBSD" LIBREOFFICE_EXTENSIONS="presenter-minimizer -nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python2_7 -python3_3" PYTHON_TARGETS="python2_7 python3_3")

I'm not sure if one of the missing USEs is not setting something that is required for it to move from %F to %U?