Closed
Description
- Version of collectd: master (16c9dcd)
- Operating system / distribution: Fedora Rawhide
Expected behavior
All tests pass
Actual behavior
make[3]: Entering directory '/home/ruben/src/collectd'
./build-aux/test-driver: line 107: 12373 Segmentation fault (core dumped) "$@" > $log_file 2>&1
FAIL: test_common
Steps to reproduce
run make check
.
The test log contains:
==12373== Invalid write of size 1
==12373== at 0x4046DB: strjoin (common.c:364)
==12373== by 0x403C93: test_strjoin (common_test.c:174)
==12373== by 0x402587: main (common_test.c:368)
==12373== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==12373==
{
<insert_a_suppression_name_here>
Memcheck:Addr1
fun:strjoin
fun:test_strjoin
fun:main
}
==12373==
==12373== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==12373== Access not within mapped region at address 0x0
==12373== at 0x4046DB: strjoin (common.c:364)
==12373== by 0x403C93: test_strjoin (common_test.c:174)
==12373== by 0x402587: main (common_test.c:368)
==12373== If you believe this happened as a result of a stack
==12373== overflow in your program's main thread (unlikely but
==12373== possible), you can try to increase the size of the
==12373== main thread stack using the --main-stacksize= flag.
==12373== The main thread stack size used in this run was 8388608.
The test that triggers this is:
/* use (NULL, 0) to determine required buffer size. */
EXPECT_EQ_INT(3, strjoin(NULL, 0, (char *[]){"a", "b"}, 2, "-"));
I looked at the implementation of strjoin(), but determining the buffer size by passing in NULL doesn't actually seem to be implemented?