On Sun, Aug 10, 2014 at 3:59 PM, Sebastian Andrzej Siewior
<[email protected]> wrote:
> Package: babeltrace
> Version: 1.2.2-2
> Severity: wishlist
>
> I've been looking at the sparc issue and this is just a tracker bug.
> One patch that helps passing half the testsuite is cae67efbd9 ("Fix:
> Align buffers from objstack_alloc on sizeof(void *)") [0].
> I would suggest to use an alignment of 8 even on 32bit architectures.
> The 4 additional bytes shouldn't matter and the Sparc FPU provides
> double support which have a size of 8 bytes and so probably require an
> aligment of 8 even on 32bit (the test suite didn't complain here).
> Jérémie?
>

It seems you don't have the following patch applied:

commit 6a0b6cd5133db9e3c72914d4e5dd7fc792360934
Author: Mathieu Desnoyers <[email protected]>
Date:   Wed Jul 16 10:58:48 2014 -0400

    Fix: don't perform unaligned integer read/writes

    Signed-off-by: Mathieu Desnoyers <[email protected]>

I may be misunderstanding here, but we don't read floats directly in a
trace. We basically use the ctf_integer_read functions, as you can see
in _ctf_float_copy() in formats/ctf/types/floats.c

That patch should ensure the accesses are always aligned (see the use
of memcpy).

Have you spotted a place where an unaligned float access is performed?

> And the second bug I stumbled on is in test_ctf_writer:
> |…
> |ok 75 - Flush trace stream with one event
> |ok 76 - Add a new event class to a stream class after writing an event
> |ok 77 - Append 100 000 events to a stream
> |
> |Program received signal SIGSEGV, Segmentation fault.
> |0xf7f6f778 in ctf_integer_write (ppos=0x70022328, definition=<optimized 
> out>) at integer.c:325
> |325                             
> bt_bitfield_write_be(mmap_align_addr(pos->base_mma) +
> |(gdb) bt
> |#0  0xf7f6f778 in ctf_integer_write (ppos=0x70022328, definition=<optimized 
> out>) at integer.c:325
> |#1  0xf7f88014 in bt_ctf_field_integer_serialize (field=0x700cd928, 
> pos=0x70022328) at event-fields.c:1065
> |#2  0xf7f88c88 in bt_ctf_field_serialize (field=0x700cd928, pos=0x70022328) 
> at event-fields.c:660
> |#3  0xf7f88f10 in bt_ctf_field_structure_serialize (field=0x700cd8c8, 
> pos=0x70022328) at event-fields.c:1143
> |#4  0xf7f88c88 in bt_ctf_field_serialize (field=0x700cd8c8, pos=0x70022328) 
> at event-fields.c:660
> |#5  0xf7f857bc in bt_ctf_stream_flush (stream=0x70022310) at stream.c:458
> |#6  0x7000577c in packet_resize_test (stream_class=<optimized out>, 
> stream=0x70022310, clock=0x70022108) at test_ctf_writer.c:698
> |#7  0x70002750 in main (argc=<optimized out>, argv=0xffffd6f4) at 
> test_ctf_writer.c:818
> |
> |=> 0xf7f6f778 <+600>:   ldub  [ %l3 + %l1 ], %g4
> |
> |l1             0x10002  65538
> |l3             0xf7bb4000       -138723328
>
> and _bt_bitfield_write_le() had __ptr = 0xf7bb4000 and this_unit = 65538
>
> |(gdb) print *((struct ctf_stream_pos *)ppos)->base_mma
> |$3 = {page_aligned_addr = 0xf7bb4000, page_aligned_length = 131072, addr = 
> 0xf7bb4000, length = 131072}
>
> So it looks like it tried to load a byte from 0xf7bb4000 + 0x10002 and
> this segfaulted. The mapping should be 131072 bytes in size it should
> fit. This is confirmed by proc, too
> |f7bb0000-f7bd0000 -w-s 00010000 fe:02 262357 
> /tmp/ctfwriter_5uYQD4/test_stream_0
> |Size:                128 kB
>
> So everything looks legal…
>

Thanks for looking into this! Any idea what could cause this to fail?

Jérémie

> [0] 
> http://git.efficios.com/?p=babeltrace.git;a=commitdiff;h=cae67efbd9ddf2cee6bbefec076dc8933ababc43
>
> Sebastian



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to