Project

General

Profile

Bug #237

Make 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

Added by Philippe Proulx over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
High
Category:
-
Target version:
-
Start date:
05/14/2012
Due date:
% Done:

0%

Estimated time:

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.

#1

Updated by Mathieu Desnoyers over 8 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).

#2

Updated by Mathieu Desnoyers over 8 years ago

Fixed by commit:

commit aee35fcc7e82d20396d82d151de93b1b51325398
Author: Mathieu Desnoyers <>
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 &lt;&gt;
#3

Updated by Mathieu Desnoyers over 8 years ago

  • Status changed from Confirmed to Resolved

Also available in: Atom PDF