Fix: use off_t type for lseek function return value to avoid overflow
authorGregory LEOCADIE <g.leocadie@criteo.com>
Thu, 29 Mar 2018 10:52:30 +0000 (12:52 +0200)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Apr 2018 16:10:25 +0000 (12:10 -0400)
commitb61e1dca934c1cda7632d154c243dcf56aabac60
tree72893539e23c0f0c15e67deff144447df4060b0e
parentd05bfdc25f188177d1be28d05962e99f3e500191
Fix: use off_t type for lseek function return value to avoid overflow

Context: LTTng is configured in live mode with only one channel, getting
traces for a long-running application (days of uptime)

The trace file gets bigger (many GBs), so the offset (bigger than
int.MaxValue). When getting a packet for such offset, the lseek returns
bigger than int.MaxValue. This value is stored in a variable "ret" of
type int. We have an overflow which leads to sending an error to the
viewer (babeltrace), which stops.
[error] get_data_packet: error.
[error] get_data_packet failed
[error] Unknown return code 0

Signed-off-by: Gregory LEOCADIE <g.leocadie@criteo.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c
src/bin/lttng-sessiond/cmd.c
src/common/utils.c
This page took 0.026938 seconds and 4 git commands to generate.