Project

General

Profile

Actions

Bug #141

closed

Root lttng-sessiond can only trace root userspace apps

Added by Yannick Brosseau over 12 years ago. Updated over 12 years ago.

Status:
Resolved
Priority:
Critical
Assignee:
-
Target version:
Start date:
03/01/2012
Due date:
% Done:

0%

Estimated time:

Description

I run a sessiond as root and create a session as root and try to run a non-root application but I don't get any traces.

When I run the application as root, I get the traces.

Actions #1

Updated by Yannick Brosseau over 12 years ago

OUTPUT of my application LTTNG_UST_DEBUG=1

libust[10806/10806]: LTT : ltt ring buffer client init
(in ltt_ring_buffer_metadata_client_init() at ltt-ring-buffer-metadata-client.h:318)
libust[10806/10806]: LTT : ltt ring buffer client init
(in ltt_ring_buffer_client_overwrite_init() at ltt-ring-buffer-client.h:575)
libust[10806/10806]: LTT : ltt ring buffer client init
(in ltt_ring_buffer_client_discard_init() at ltt-ring-buffer-client.h:575)
libust[10806/10807]: Info: sessiond not accepting connections to local apps socket (in ust_listener_thread() at lttng-ust-comm.c:688)
libust[10806/10807]: Waiting for local apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:610)
libust[10806/10808]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:688)
libust[10806/10808]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:610)
libust[10806/10806]: just registered probe lttng_ust containing 1 events (in ltt_probe_register() at ltt-probes.c:97)
libust[10806/10808]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:688)
libust[10806/10808]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:610)
liblttng_ust_tracepoint[10806/10806]: just registered a tracepoints section from 0x7f946efc3590 and having 1 tracepoints (in tracepoint_register_lib() at tracepoint.c:616)
liblttng_ust_tracepoint[10806/10806]: registered tracepoint: lttng_ust:metadata (in tracepoint_register_lib() at tracepoint.c:621)
libust[10806/10806]: just registered probe sample_tracepoint containing 1 events (in ltt_probe_register() at ltt-probes.c:97)
liblttng_ust_tracepoint[10806/10806]: just registered a tracepoints section from 0x601a40 and having 1 tracepoints (in tracepoint_register_lib() at tracepoint.c:616)
liblttng_ust_tracepoint[10806/10806]: registered tracepoint: sample_tracepoint:message (in tracepoint_register_lib() at tracepoint.c:621)
libust[10806/10808]: Info: sessiond not accepting connections to global apps socket (in ust_listener_thread() at lttng-ust-comm.c:688)
libust[10806/10808]: Waiting for global apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:610)
liblttng_ust_tracepoint[10806/10806]: just unregistered a tracepoints section from 0x601a40 (in tracepoint_unregister_lib() at tracepoint.c:656)
libust[10806/10806]: just unregistered probe sample_tracepoint (in ltt_probe_unregister() at ltt-probes.c:114)
liblttng_ust_tracepoint[10806/10806]: just unregistered a tracepoints section from 0x7f946efc3590 (in tracepoint_unregister_lib() at tracepoint.c:656)
libust[10806/10806]: just unregistered probe lttng_ust (in ltt_probe_unregister() at ltt-probes.c:114)
libust[10806/10806]: LTT : ltt ring buffer client exit
(in ltt_ring_buffer_client_discard_exit() at ltt-ring-buffer-client.h:581)
libust[10806/10806]: LTT : ltt ring buffer client exit
(in ltt_ring_buffer_client_overwrite_exit() at ltt-ring-buffer-client.h:581)
libust[10806/10806]: LTT : ltt ring buffer client exit
(in ltt_ring_buffer_metadata_client_exit() at ltt-ring-buffer-metadata-client.h:324)

Actions #2

Updated by Yannick Brosseau over 12 years ago

lttng-sessiond -vvv

DEBUG3: Creating LTTng run directory: /var/run/lttng [in create_lttng_rundir() at main.c:4062]
DEBUG2: Kernel consumer err path: /var/run/lttng/kconsumerd/error [in main() at main.c:4289]
DEBUG2: Kernel consumer cmd path: /var/run/lttng/kconsumerd/command [in main() at main.c:4291]
DEBUG1: Client socket path /var/run/lttng/client-lttng-sessiond [in main() at main.c:4334]
DEBUG1: Application socket path /var/run/lttng/apps-lttng-sessiond [in main() at main.c:4335]
DEBUG1: LTTng run directory path: /var/run/lttng [in main() at main.c:4336]
DEBUG2: UST consumer 32 bits err path: /var/run/lttng/ustconsumerd32/error [in main() at main.c:4345]
DEBUG2: UST consumer 32 bits cmd path: /var/run/lttng/ustconsumerd32/command [in main() at main.c:4347]
DEBUG2: UST consumer 64 bits err path: /var/run/lttng/ustconsumerd64/error [in main() at main.c:4356]
DEBUG2: UST consumer 64 bits cmd path: /var/run/lttng/ustconsumerd64/command [in main() at main.c:4358]
DEBUG2: Creating consumer directory: /var/run/lttng/kconsumerd [in set_consumer_sockets() at main.c:4104]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-tracer [in modprobe_lttng_control() at modprobe.c:163]
DEBUG2: Kernel tracer version validated (major version 1) [in kernel_validate_version() at kernel.c:630]
DEBUG1: Modprobe successfully lttng-ftrace [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-kprobes [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-kretprobes [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-lib-ring-buffer [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-client-discard [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-client-overwrite [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-metadata-client [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-client-mmap-discard [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-client-mmap-overwrite [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-ring-buffer-metadata-mmap-client [in modprobe_lttng_data() at modprobe.c:199]
WARNING: /etc/modprobe.d/lttng.conf line 1: ignoring bad line starting with 'alias'
DEBUG1: Modprobe successfully lttng-probe-lttng [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-types [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-block [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-irq [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-kvm [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-sched [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-signal [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-statedump [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Modprobe successfully lttng-probe-timer [in modprobe_lttng_data() at modprobe.c:199]
DEBUG1: Kernel tracer fd 6 [in init_kernel_tracer() at main.c:1756]
DEBUG2: Creating consumer directory: /var/run/lttng/ustconsumerd64 [in set_consumer_sockets() at main.c:4104]
DEBUG2: Creating consumer directory: /var/run/lttng/ustconsumerd32 [in set_consumer_sockets() at main.c:4104]
DEBUG1: Signal handler set for SIGTERM, SIGPIPE and SIGINT [in set_signal_handler() at main.c:4195]
DEBUG1: All permissions are set [in set_permissions() at main.c:4033]
DEBUG3: Created hashtable size 4 at 0x21a3680 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: Created hashtable size 4 at 0x21a3940 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG1: epoll set max size is 786534 [in compat_epoll_set_max_size() at compat/compat-epoll.c:220]
DEBUG1: [thread] Manage client started [in thread_manage_clients() at main.c:3595]
DEBUG1: [thread] Dispatch UST command started [in thread_dispatch_ust_registration() at main.c:1223]
DEBUG1: Futex n to 1 prepare done [in futex_nto1_prepare() at futex.c:74]
DEBUG1: Woken up but nothing in the UST command queue [in thread_dispatch_ust_registration() at main.c:1233]
DEBUG1: [thread] Manage application registration started [in thread_registration_apps() at main.c:1291]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Notifying applications of session daemon state: 1 [in notify_ust_apps() at main.c:610]
DEBUG1: Thread manage kernel started [in thread_manage_kernel() at main.c:799]
DEBUG1: Updating kernel poll set [in update_kernel_poll() at main.c:671]
DEBUG1: Thread kernel polling on 2 fds [in thread_manage_kernel() at main.c:828]
DEBUG1: Got the wait shm fd 18 [in get_wait_shm() at shm.c:113]
DEBUG1: [thread] Manage application started [in thread_manage_apps() at main.c:1077]
DEBUG1: Futex wait update active 1 [in futex_wait_update() at futex.c:63]
DEBUG1: Accepting application registration [in thread_registration_apps() at main.c:1322]
DEBUG1: Apps thread polling on 2 fds [in thread_manage_apps() at main.c:1098]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3703]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Processing client command 8 [in process_client_msg() at main.c:3166]
DEBUG2: Trying to find session by name auto-20120301-102034 [in session_find_by_name() at session.c:128]
DEBUG3: mkdir() recursive /root/lttng-traces/auto-20120301-102034 with mode 504 for uid 0 and gid 0 [in run_as_mkdir_recursive() at runas.c:288]
DEBUG1: Tracing session auto-20120301-102034 created in /root/lttng-traces/auto-20120301-102034 with ID 1 by UID 0 GID 0 [in session_create() at session.c:236]
DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3733]
DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:457]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3703]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Processing client command 6 [in process_client_msg() at main.c:3166]
DEBUG1: Getting session auto-20120301-102034 by name [in process_client_msg() at main.c:3217]
DEBUG2: Trying to find session by name auto-20120301-102034 [in session_find_by_name() at session.c:128]
DEBUG1: Creating UST session [in create_ust_session() at main.c:1824]
DEBUG3: Created hashtable size 4 at 0x21aca30 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: Created hashtable size 4 at 0x21accf0 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: Created hashtable size 4 at 0x21acfb0 of type 0 [in lttng_ht_new() at hashtable.c:96]
DEBUG2: UST trace session create successful [in trace_ust_create_session() at trace-ust.c:119]
DEBUG3: mkdir() recursive /root/lttng-traces/auto-20120301-102034/ust with mode 504 for uid 0 and gid 0 [in run_as_mkdir_recursive() at runas.c:288]
DEBUG1: Spawning consumerd [in spawn_consumerd() at main.c:1528]
DEBUG2: Consumer pid 10973 [in start_consumerd() at main.c:1699]
DEBUG2: Spawning consumer control thread [in start_consumerd() at main.c:1702]
DEBUG1: [thread] Manage consumer started [in thread_manage_consumer() at main.c:908]
DEBUG1: Using 64-bit UST consumer at: /usr/local/bin/lttng-consumerd [in spawn_consumerd() at main.c:1602]
DEBUG2: Receiving code from consumer err_sock [in thread_manage_consumer() at main.c:969]
DEBUG1: consumer command socket ready [in thread_manage_consumer() at main.c:988]
DEBUG2: Trace UST channel channel0 not found by name [in trace_ust_find_channel_by_name() at trace-ust.c:52]
DEBUG3: Created hashtable size 4 at 0x21ae910 of type 0 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: Created hashtable size 4 at 0x21aebd0 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG2: Trace UST channel channel0 created [in trace_ust_create_channel() at trace-ust.c:178]
DEBUG2: Channel channel0 being created in UST global domain [in channel_ust_create() at channel.c:248]
DEBUG2: UST app adding channel channel0 to global domain for session id 1 [in ust_app_create_channel_glb() at ust-app.c:1742]
DEBUG2: Channel channel0 created successfully [in channel_ust_create() at channel.c:273]
DEBUG2: Trace UST channel channel0 found by name [in trace_ust_find_channel_by_name() at trace-ust.c:47]
DEBUG2: Trace UST event NOT found by name * [in trace_ust_find_event_by_name() at trace-ust.c:79]
DEBUG3: Created hashtable size 4 at 0x21af0f0 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG2: Trace UST event *, loglevel (0,-1) created [in trace_ust_create_event() at trace-ust.c:251]
DEBUG1: UST app creating event * for all apps for session id 1 [in ust_app_create_event_glb() at ust-app.c:1866]
DEBUG1: Event UST * created in channel channel0 [in event_ust_enable_tracepoint() at event.c:424]
DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3733]
DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:457]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3703]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Processing client command 16 [in process_client_msg() at main.c:3166]
DEBUG1: Getting session auto-20120301-102034 by name [in process_client_msg() at main.c:3217]
DEBUG2: Trying to find session by name auto-20120301-102034 [in session_find_by_name() at session.c:128]
DEBUG1: Starting all UST traces [in ust_app_start_trace_all() at ust-app.c:2144]
DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3733]
DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:457]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3703]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Processing client command 17 [in process_client_msg() at main.c:3166]
DEBUG1: Getting session auto-20120301-102034 by name [in process_client_msg() at main.c:3217]
DEBUG2: Trying to find session by name auto-20120301-102034 [in session_find_by_name() at session.c:128]
DEBUG1: Stopping all UST traces [in ust_app_stop_trace_all() at ust-app.c:2170]
DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3733]
DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:457]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]
DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3664]
DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3699]
DEBUG1: Processing client command 13 [in process_client_msg() at main.c:3166]
DEBUG1: Counting number of available session for UID 0 GID 0 [in lttng_sessions_count() at main.c:1916]
DEBUG1: Getting all available session for UID 0 GID 0 [in list_lttng_sessions() at main.c:1943]
DEBUG1: Sending response (size: 4388, retcode: Success) [in thread_manage_clients() at main.c:3733]
DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:457]
DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3627]

Actions #3

Updated by Mathieu Desnoyers over 12 years ago

  • Status changed from New to Resolved

fixed by lttng-tools commit:

commit 61076f74f9e7ae286fe140d82ed0ac86895e3690
Author: David Goulet <>
Date: Thu Mar 1 10:36:06 2012 -0500

Fix security permission on lttng run directory
Add execute flag for other (r+x) on the lttng run directory at
/var/run/lttng so instrumented application not in the tracing group
can register to the global session daemon running as root.
(refs #141)
Signed-off-by: David Goulet &lt;&gt;
Actions

Also available in: Atom PDF