influxdb-c icon indicating copy to clipboard operation
influxdb-c copied to clipboard

Segmentation fault when calling influxdb_series_free()

Open radcheb opened this issue 9 years ago • 0 comments

I am creating a metric of 9 columns of different names length. I succeeded to send it to influxdb server (status=200) but I got segmentation fault when freeing it. I tried to see what happen with gdb and I got this:

*** Error in `/path/my_program': munmap_chunk(): invalid pointer: 0x000000000062c5b0 ***

When I asked for a "backtrace" I got this:

0 0x00007ffff6ec2cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56

1 0x00007ffff6ec60d8 in __GI_abort () at abort.c:89

2 0x00007ffff6eff394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff700db28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175

3 0x00007ffff6f0a0f7 in malloc_printerr (action=, str=0x7ffff700dea8 "munmap_chunk(): invalid pointer", ptr=) at malloc.c:4996

4 0x00007ffff77bcb99 in influxdb_series_free (series=series@entry=0x62c040, free_cb=free_cb@entry=0x0) at series.c:149

In series.c:149 I have: 145 free(series->points); 146 series->points_length = 0; 147 148 for (i = 0; i < series->columns_length; i++){ 149 free(series->columns[i]); 150 } 151 free(series->columns);

When I tried to print my column names just before calling free I got this wired character on the fourth one: The rest of the columns are all fine, even the next ones. I tried to change the name to something simple "ok" but I got the same issue.

Is the problem related in the way columns are created and allocated ?

radcheb avatar Aug 12 '15 12:08 radcheb