Project

General

Profile

Actions

Bug #1026

open

lttng create should recover from a bad output option more gracefully

Added by Daniel U. Thibault over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
06/14/2016
Due date:
% Done:

0%

Estimated time:

Description

(LTTng 2.8.0 lttng-tools a0f518a on Ubuntu 14.04.4, kernel 4.2.0-27-generic)
Currently, if you set the session output path to somewhere you do not have write-access, you get this:

$ lttng create mysession -o=/root/traces/mysession
PERROR - 16:04:51.933320 [4683/4683] realpath (partial_realpath): Permission denied (in utils_partial_realpath() at utils.c:124)
Segmentation fault (core dumped)

Surely lttng should recover more gracefully than a core dump? (lttng-sessiond is unharmed)

Actions #1

Updated by Daniel U. Thibault over 8 years ago

Other permission configurations yield different behaviour. If the user has read access (but no write access) to the output folder (/path/traces exists), we get:

$ mkdir /path/traces/mysession
mkdir: cannot create directory '/path/traces/mysession': Permission denied
$ lttng create mysession -o=/path/traces/mysession
Session mysession created.
$ lttng enable-event -k --all --syscall --channel syscalls
Error: Events: Kernel create session failed (channel syscalls, session mysession)
Error: Command error

Note how LTTng failed to report the root cause of the error (mkdir: Permission denied).

I'm also getting this:

$ mkdir /path/traces/mysession
$ rmdir /path/traces/mysession
$ lttng create mysession -o=/path/traces/mysession
Session mysession created.
$ lttng enable-event -k --all --syscall --channel syscalls
Error: Events: Kernel create session failed (channel syscalls, session mysession)
Error: Command error

This time /path/traces has group access (create and delete), others access (none). The user belongs to the folder's group but root does not. Note that $ sudo -u root mkdir /path/traces/mysession succeeds.

/path/traces (owner: root) permissions:

  • group root (create and delete), others (create and delete) - success
  • group root (create and delete), others (access files) - success
  • group root (create and delete), others (none) - segmentation fault (core dump)
  • group root (access files), others (create and delete) - enable-event error
  • group root (access files), others (access files) - enable-event error
  • group root (access files), others (none) - segmentation fault (core dump)
  • group root (none), others (create and delete) - enable-event error
  • group root (none), others (access files) - enable-event error
  • group root (none), others (none) - segmentation fault (core dump)
  • group vboxsf (create and delete), others (create and delete) - success
  • group vboxsf (create and delete), others (access files) - enable-event error
  • group vboxsf (create and delete), others (none) - enable-event error
  • group vboxsf (access files), others (create and delete) - success
  • group vboxsf (access files), others (access files) - enable-event error
  • group vboxsf (access files), others (none) - enable-event error
  • group vboxsf (none), others (create and delete) - segmentation fault (core dump)
  • group vboxsf (none), others (access files) - segmentation fault (core dump)
  • group vboxsf (none), others (none) - segmentation fault (core dump)
Actions

Also available in: Atom PDF