[lttng-dev] Getting SIGBUS in babeltrace - occasionally

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Jul 24 09:20:12 EDT 2013


* Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> * Amit Margalit (AMITM at il.ibm.com) wrote:
> > Hi,
> > 
> > I am getting occasional SIGBUS inside _aligned_integer_read() in 
> > ./formats/ctf/types/integer.c
> > 
> > Here is the backtrace, maybe someone could take a look and suggest 
> > something:
> 
> It looks like you're hitting the internal checks for overflow on the
> buffer boundaries.

Please forget about my previous email, I'm utterly wrong. That should
teach me to reply before my first morning coffee ;)

We indeed have internal checks for overflows in babeltrace, but those
are not triggering SIGBUS ever, they return failure gracefully.

What seems to happen in your case is documented here:

mmap(2) manpage:

       SIGBUS Attempted access to a portion of the buffer that does not corre‐
              spond  to  the  file  (for  example, beyond the end of the file,
              including the case  where  another  process  has  truncated  the
              file).

I'm curious to learn which versions of babeltrace/ust/modules you are
using, if you modified them (and how), and if you can get us a sample
trace that triggers the issue.

Also, a bit of context about your setup: is this 32-bit or 64-bit
user-space, which OS.

Hrm.

By any chance, is it possible that you record your trace on a platform
with 4kB pages, and run babeltrace on it on a platform having 64kB
pages? Everything points me to include/babeltrace/mmap-align.h
mmap_align_addr(). We might be mmaping beyond the end of file in this
case.

Thanks!

Mathieu

> 
> On which babeltrace version can you reproduce it ? Did you do any
> modification to babeltrace on your own on top ?
> 
> Are you getting this with a lttng-ust or lttng-modules trace ? If yes,
> which version of the tool has generated the trace ?
> 
> Can you provide a sample trace that triggers this issue ?
> 
> Can you give us the detailed sequence of steps you use to reproduce ?
> 
> Thanks,
> 
> Mathieu
> 
> > #0  _aligned_integer_read (definition=0x954320, ppos=0x106e028) at 
> > integer.c:81
> > #1  ctf_integer_read (ppos=0x106e028, definition=0x954320) at 
> > integer.c:224
> > #2  0x00007ffff070e36e in generic_rw (definition=<optimized out>, 
> > pos=0x106e028) at ../include/babeltrace/types.h:133
> > #3  bt_struct_rw (ppos=0x106e028, definition=0x9542e0) at struct.c:56
> > #4  0x00007ffff13f7fda in generic_rw (definition=<optimized out>, 
> > pos=0x106e028) at ../../include/babeltrace/types.h:133
> > #5  ctf_packet_seek (stream_pos=0x106e028, index=<optimized out>, 
> > whence=<optimized out>) at ctf.c:860
> > #6  0x00007ffff070a3f1 in seek_file_stream_by_timestamp 
> > (cfs=cfs at entry=0x106cf90, timestamp=timestamp at entry=1374636821498972926) 
> > at iterator.c:141
> > #7  0x00007ffff070aa96 in seek_ctf_trace_by_timestamp 
> > (stream_heap=0x176d310, timestamp=1374636821498972926, tin=<optimized 
> > out>) at iterator.c:188
> > #8  bt_iter_set_pos (iter=iter at entry=0xfdafa0, iter_pos=0x2bf59f0) at 
> > iterator.c:439
> > #9  0x00007ffff1624f01 in _wrap__bt_iter_set_pos (self=<optimized out>, 
> > args=<optimized out>) at babeltrace_wrap.c:3805
> > #10 0x00007ffff7b28c0c in call_function (oparg=<optimized out>, 
> > pp_stack=<optimized out>) at Python/ceval.c:3679
> > #11 PyEval_EvalFrameEx (f=0x1c243c0, throwflag=<optimized out>) at 
> > Python/ceval.c:2370
> > #12 0x00007ffff7b2e0d2 in PyEval_EvalCodeEx (co=0xa8e5d0, 
> > globals=<optimized out>, locals=<optimized out>, args=0x2088cc8, 
> > argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
> >     at Python/ceval.c:2942
> > .
> > .
> > .
> > 
> > Any suggestions are welcome.
> > 
> > Amit Margalit
> > IBM XIV - Storage Reinvented
> > XIV-NAS Development Team
> > Tel. 03-689-7774
> > Fax. 03-689-7230
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev at lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> 
> -- 
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list