#1055432 kontact: Attaching file to email tries to mount filesystems

Package:
kontact
Source:
kontact
Description:
integrated application for personal information management
Submitter:
Juha Jäykkä
Date:
2023-11-06 15:03:04 UTC
Severity:
normal
#1055432#5
Date:
2023-11-05 23:19:11 UTC
From:
To:
Dear Maintainer,

Kontact email composition window "Attach file" should not try to mount filesystems that
aren't already mounted and the user does not explicitly try to enter.

Reproduce:

1. Set up an automounted filesystem, e.g. at /mnt/foobar
2. Mount it
3. Add /mnt/foobar to the sidebar either in Places, Recent Locations, or Remote,
   do not enter the directory (or come out of it after so it's not the last one
   you were in while the dialog is open)
4. Close the compose window
5. Umount /mnt/foobar
6. Compose another email and attach a file: /mnt/foobar gets mounted.

I appreciate this is an attempt to be helpful, gathering information about known mountpoints,
but the nature of autofs mountpoints is that they are not guaranteed to be always available
to be mounted so causing an attempt to mount them without user explicitly asking for it is
not good.

This is especially bad when the mountpoint is an NFS mount: kontact will hang until autofs
succeeds in mounting it. If the NFS server is never coming back, data loss follows as kontact
will never recover from an uninterruptible system call.

This is also highly annoying even when the server is available but /mnt/foobar is not yet
mounted: opening the file selection dialog takes as long as it takes for the mount to finish,
which is long enough to be annoying.

Kontact needs to be selective in its helpfulness: avoid causing autofs mounts to be triggered
if they are not yet mounted unless explicitly requested by the user.

Cheers,
Juha

#1055432#10
Date:
2023-11-06 14:35:36 UTC
From:
To:
severity 1055432 normal
thanks

I think we aren't in the "It is better to release without the entirety of
KDE's software stack", so downgrading

This is an issue in one of the underlying libraries, but we should probably
investigate exactly which one.

What I think is happening is something along the following:
 - the sidebar has possibility to add fancy icon, name or other fancyness read
from the location in question
 - this happens maybe unconditionally, maybe conditional of "is mounted".
 - autofs filesystems is mounted with type=autofs until accessed

I guess, if we can locate the right place to do it, maybe do a early check if
file system type is autofs and not really mounted, before looking further.

What I suggest to do to track this down is the following, given you have a
setup to reproduce it:

1) look up how to install debug packages using one of the ways in
https://wiki.debian.org/HowToGetABacktrace

2) Run an application under GDB. (I'm sure kwrite is a simpler application
that can show the same behavior)

3) Get the application into the state, break in gdb and get the full backtrace
(thread apply all bt)

4) read over the backtrace and verify that nothing not for public consumption
is in it

5) post it as a reply.

Maybe we can figure it out together.

/Sune