Bug #450
closedCan't open trace files smaller than the page size
0%
Description
- metadata
- stream
When the "stream" file (actual trace data) is smaller than a page size, babeltrace can't read it.
I attached a sample trace. I believe with all my heart that it is a valid trace.
Files
Updated by Simon Marchi almost 12 years ago
Pointer in the code, open fails at this check: if (filestats.st_size < MAX_PACKET_HEADER_LEN / CHAR_BIT)
Updated by Mathieu Desnoyers almost 12 years ago
fixing this imply a couple of things:
1) removing the check:
if (filestats.st_size < MAX_PACKET_HEADER_LEN / CHAR_BIT)
return -EINVAL;
(easy part)
2) adding checks at each step of create_stream_packet_index() that ensures we have the expected amount of data required to read the header fields available within the file. Basically, we need to always gracefully handle an oddly-formed file (even corner-cases designed to crash or exploit babeltrace maliciously).
(this is the hard part)
Updated by Mathieu Desnoyers over 11 years ago
- Status changed from New to Resolved
commit b620ec4a9bee4f2df11d5108e73077804cfa3c85
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Mon Apr 8 08:36:44 2013 -0400
Add smalltrace succeed/fail test cases
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
commit ec32346491f3e11fbc802a04f7dfd3259e6a8b17
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Mon Apr 8 08:35:20 2013 -0400
Support packets and trace files smaller than page size
Fixes #450
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>