Bug #89
closedsessiond does not handle channel creation errors for UST
0%
Description
With UST commit:
commit e52b0723a0f08966ee0913707b549235b2bce96d
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Tue Feb 21 19:20:51 2012 -0500
Fix: Return -EINVAL instead of print warning if non power of 2 size/num_subbuf
Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng create
lttng enable-channel test -u --num-subbuf 3 # known bad number of buffers.
lttng enable-event -u -a
lttng start
./hello
segfaults lttng-sessiond. Backtrace:
#0 ustctl_create_stream (sock=19, channel_data=0x0, _stream_data=0xf040a8)
at ustctl.c:274
lum = {handle = 0, cmd = 96, u = {channel = {overwrite = 0, subbuf_size = 0,
num_subbuf = 0, switch_timer_interval = 0, read_timer_interval = 0,
output = LTTNG_UST_MMAP, padding = '\000' <repeats 287 times>}, stream = {
padding = '\000' <repeats 15 times>, u = {
padding = '\000' <repeats 287 times>}}, event = {
instrumentation = LTTNG_UST_TRACEPOINT, name = '\000' <repeats 255 times>,
loglevel_type = LTTNG_UST_LOGLEVEL_ALL, loglevel = 0,
padding = '\000' <repeats 15 times>, u = {
padding = '\000' <repeats 287 times>}}, context = {
ctx = LTTNG_UST_CONTEXT_VTID, padding = '\000' <repeats 15 times>, u = {
padding = '\000' <repeats 287 times>}}, version = {major = 0, minor = 0,
patchlevel = 0}, tracepoint = {name = '\000' <repeats 255 times>,
loglevel = 0, padding = '\000' <repeats 15 times>}}}
lur = {handle = 1407809808, cmd = 32560, ret_code = 4328272, ret_val = 0, u = {
channel = {memory_map_size = 4370524}, stream = {memory_map_size = 4370524},
version = {major = 4370524, minor = 0, patchlevel = 1498267712},
tracepoint = {
name = "\\\260B\000\000\000\000\000@\300MY0\177\000\000\003\000\000\000\000\000\000\000\357\265@\000\350\003\000\000\350\003\000\000\370\001\000\000H\346\357\000\000\000\000\000H\346\357\000\000\000\000\000\370\001\000\000\000\000\000\000 z\351S0\177\000\000+\316@\000\000\000\000\000\240\021GXi6LT \177\357\000\000\000\000\000\330\345\356\000\000\000\000\000\000\346\357\000\000\000\000\000\020`iI0\177\000\000\004\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000m\231 \242*2l\226\060`iI0\177\000\000(\346\357\000\000\000\000\000\060\020\000\000\000\000\000\000\270\276EX0\177\000\000?EX0\177\000\000\000z\351S0\177\000\000 \020\000\000\000\000\000\000P\201\357\000c\000\000\000P\020\000\000\000\000\000\000\300y\351S\003\001\000\000?\310A", '\000' <repeats 13 times>..., loglevel = 4128,
padding = "\000\000\000\000`\276EX0\177\000\000`\276EX"}}}
stream_data = 0xf040d0
ret = <optimized out>
fd = <optimized out>
err = 0
func = "ustctl_create_stream"
#1 0x000000000040ecfa in ust_app_start_trace (usess=0xeee5d0, app=0xef7f20)
at ust-app.c:1958
ret = 0
iter = {iter = {node = 0xf00688, next = 0xf00e78}}
ua_sess = 0xefe600
ua_chan = 0xf00400
ustream = 0xf030a0
consumerd_fd = 0
func = "ust_app_start_trace"
#2 0x000000000040fac2 in ust_app_global_update (usess=0xeee5d0, sock=19)
at ust-app.c:2296
ret = 0
....
So it looks like a NULL channel object is still around and is being used to create a stream.