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:09:59 +0000 (12:09 -0400)
commit987af24193476d1cb2fbf9ddccfe5980da52f9c4
treeda450250fbaefacf808b70e95f175b0875df83d4
parentb6d67aac976434ea1d13d96ee3640624df8eccb7
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.026125 seconds and 4 git commands to generate.