Bug #237
closedMake sure that a trace with a source architecture page size of 4 kiB can be opened/read with Babeltrace on a system with 64 kiB pages
0%
Description
Babeltrace uses mmap()
to read traces and the file offset
of mmap()
must be a multiple of the system page size. Babeltrace maps the input files per-packet, giving mmap()
the packet size as the mapping length:
pos->base = mmap(NULL, pos->packet_size / CHAR_BIT, pos->prot, pos->flags, pos->fd, pos->mmap_offset);
If a system with a page size of 4 kiB is traced and its viewer using Babeltrace is on a system with 64 kiB pages, most packets (except those aligned on a multiple of 65536) will probably make mmap()
return MAP_FAILED
and set errno
to EINVAL
, which will clearly crash the app. as it is currently implemented.
Updated by Mathieu Desnoyers almost 12 years ago
- Status changed from New to Confirmed
- Assignee set to Mathieu Desnoyers
- Priority changed from Normal to High
Also affects reading traces produced on linux system from babeltrace running under cygwin (64k page size).
Updated by Mathieu Desnoyers almost 12 years ago
Fixed by commit:
commit aee35fcc7e82d20396d82d151de93b1b51325398
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Tue May 29 18:54:43 2012 -0400
Use mmap_align
Allow reading traces with packet size different from the machine page
size.
Fixes #237
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Updated by Mathieu Desnoyers almost 12 years ago
- Status changed from Confirmed to Resolved