free(): invalid pointer
Closed this issue · 4 comments
Hi,
trying to go through 2 files a read the content, read in a separate run is ok, but when I run the code like in my example I got an error:
free(): invalid pointer
My program is like:
int main( void ){
// definitions, etc.
processFile( path_1, ...arrays, variables );
processFile( path_2, ...arrays, variables );
}
void processFile( char *path, ...arrays, variables ){
// definitions
io::CSVReader< 44 > in( path );
in.read_header( io::ignore_extra_column, ...column_names... );
while( in.read_row( ...columns... ) ){
// do some stuff with lines
}
return;
}
Pls help.
Hi Ben,
I'm not able to reproduce an error in some minimum compilable example, so I had to provide you a bigger part of the code.
I'm using these 2 datasets:
[ 1 ] https://www.unsw.adfa.edu.au/unsw-canberra-cyber/cybersecurity/ADFA-NB15-Datasets/a%20part%20of%20training%20and%20testing%20set/UNSW_NB15_training-set.csv
[ 2 ] https://www.unsw.adfa.edu.au/unsw-canberra-cyber/cybersecurity/ADFA-NB15-Datasets/a%20part%20of%20training%20and%20testing%20set/UNSW_NB15_testing-set.csv
and trying to read and encode it...
reader.zip
Hi Ben,
thank you for your help, -fsanitize=address helped me, the problem wasn't null terminators, but I made a mistake and declared the number of lines for test_dataset( God is witness that I checked it thousand times ) and Call Stack pointed to CSVReader and LineReader, so sorry for that, but thank you anyway.
Best Regards