Project

General

Profile

Actions

Bug #230

closed

Bus error in applications when using big subbuf size and number

Added by Raphaël Beamonte almost 12 years ago. Updated almost 12 years ago.

Status:
Resolved
Priority:
Critical
Target version:
-
Start date:
04/26/2012
Due date:
% Done:

100%

Estimated time:

Description

When using LTTng UST with big subbuf size (4194304) and number (256), the application is crashing with the following gdb report :

Program received signal SIGBUS, Bus error.
[Switching to Thread 0x7ffff61db700 (LWP 17504)]
0x00007ffff79c2acf in channel_create (config=0x7ffff7bd35a0, name=0x7ffff79c91af "relay-discard-mmap", priv_data=0x7ffff61da0b8, priv_data_align=8, priv_data_size=112, priv_data_init=0x7ffff61da3d0, 
    buf_addr=0x0, subbuf_size=4194304, num_subbuf=256, switch_timer_interval=0, read_timer_interval=200, shm_fd=0x7ffff61da7e0, wait_fd=0x7ffff61da7e8, memory_map_size=0x7ffff61da7f0)
    at ring_buffer_frontend.c:492
492            chan->priv_data_offset = shmobj->allocated_len;

The lttng-sessiond daemon is giving those information when run with -vvv modes :

DEBUG1: Futex n to 1 prepare done [in futex_nto1_prepare() at futex.c:73]
DEBUG1: Dispatching UST registration pid:17500 ppid:17498 uid:1000 gid:1000 sock:19 name:sample (version 2.0) [in thread_dispatch_ust_registration() at main.c:1346]
DEBUG1: Woken up but nothing in the UST command queue [in thread_dispatch_ust_registration() at main.c:1334]
DEBUG3: Created hashtable size 4 at 0x1d4b470 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG1: App registered with pid:17500 ppid:17498 uid:1000 gid:1000 sock:19 name:sample (version 2.0) [in ust_app_register() at ust-app.c:1365]
DEBUG2: UST app PID 17500 is compatible with major version 2 (supporting <= 2) [in ust_app_validate_version() at ust-app.c:2625]
DEBUG2: UST app global update for app sock 19 for session id 1 [in ust_app_global_update() at ust-app.c:2295]
DEBUG2: UST app pid: 17500 session id 1 not found, creating it [in create_ust_app_session() at ust-app.c:883]
DEBUG3: Created hashtable size 4 at 0x1d4c770 of type 0 [in lttng_ht_new() at hashtable.c:96]
DEBUG2: Shadow copy of session handle -1 [in shadow_copy_session() at ust-app.c:794]
DEBUG2: Channel chanpouet not found on shadow session copy, creating it [in shadow_copy_session() at ust-app.c:823]
DEBUG3: Created hashtable size 4 at 0x1d521a0 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: Created hashtable size 4 at 0x1d52440 of type 0 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: UST app channel chanpouet allocated [in alloc_ust_app_channel() at ust-app.c:298]
DEBUG2: UST app shadow copy of channel chanpouet started [in shadow_copy_channel() at ust-app.c:734]
DEBUG2: UST event * not found on shadow copy channel [in shadow_copy_channel() at ust-app.c:761]
DEBUG3: Created hashtable size 4 at 0x1d52a70 of type 1 [in lttng_ht_new() at hashtable.c:96]
DEBUG3: UST app event * allocated [in alloc_ust_app_event() at ust-app.c:333]
DEBUG3: UST app shadow copy of channel chanpouet done [in shadow_copy_channel() at ust-app.c:771]
DEBUG2: UST app session created successfully with handle 2 [in create_ust_app_session() at ust-app.c:907]
Error: Creating channel chanpouet for app (pid: 17500, sock: 19) and session handle 2 with ret -22
DEBUG1: Starting tracing for ust app pid 17500 [in ust_app_start_trace() at ust-app.c:1970]
Error: UST app open metadata failed for app pid:17500 with ret -1
DEBUG3: Opening metadata failed. Cleaning up memory [in create_ust_app_metadata() at ust-app.c:1206]
DEBUG1: PID 17500 unregistering with sock 19 [in ust_app_unregister() at ust-app.c:1395]
DEBUG1: Apps thread polling on 2 fds [in thread_manage_apps() at main.c:1200]

The commands used to reproduce the error are the following :

$ sudo lttng create pouet
Session pouet created.
Traces will be written in /root/lttng-traces/pouet-20120426-182501
$ sudo lttng enable-channel chanpouet -u --subbuf-size 4194304 --num-subbuf 256
UST channel chanpouet enabled for session pouet
$ sudo lttng enable-event * -u -c chanpouet -a
All UST events are enabled in channel chanpouet
$ sudo lttng start
Tracing started for session pouet

The application returning the error in the example found here is the easy-ust one, in doc/examples/.

Actions

Also available in: Atom PDF