LTTng-modules returns indexes starting from zero. Hence, if nbmem is zero and index is zero the table will fail to grow to contain one element.
This situation should never happen since nbmem is assigned the value of SYSCALL_TABLE_INIT_SIZE which is 256 currently. Signed-off-by: Jonathan Rajotte <[email protected]> --- src/bin/lttng-sessiond/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/syscall.c b/src/bin/lttng-sessiond/syscall.c index c21e4d8..51214bf 100644 --- a/src/bin/lttng-sessiond/syscall.c +++ b/src/bin/lttng-sessiond/syscall.c @@ -85,7 +85,7 @@ int syscall_init_table(void) size_t new_nbmem; /* Double memory size. */ - new_nbmem = max(index, nbmem << 1); + new_nbmem = max(index + 1, nbmem << 1); if (new_nbmem > (SIZE_MAX / sizeof(*new_list))) { /* Overflow, stop everything, something went really wrong. */ ERR("Syscall listing memory size overflow. Stopping"); -- 2.7.4 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
