> On 11/07/13 09:32, Dodji Seketeli wrote: > >> From the above, what I can say is that input.o was already linked with >> gcov. But I think it's minimal enough to only drag libcpp and the >> diagnostic subsystem. > > I disagree. While input.o was available to gcov, I don't think it was being > pulled into the executable (if it was, I'd like to understand why). I think > dragging in libcpp & diagnostics is a major bloat -- have you measured the > before and after gcov text sizes?
I agree that this should be avoided. However both versions of read_line need to be fixed eventually. Just for the records, this is not only a theoretical issue for gcov: The OOM error can also be reproduced in gcov. The attached test.c has some dozends of comment lines: //xx\0EOL That are lines with text before and after the \0. If compiled without -Wall, it will crash in gcov: gcc -fprofile-arcs -ftest-coverage test.c ./a.out gcov test File 'test.c' Lines executed:100.00% of 1 Creating 'test.c.gcov' gcov: out of memory allocating 1677721600 bytes after a total of 135168 bytes Bernd.
//00 EOL //01 EOL //02 EOL //03 EOL //04 EOL //05 EOL //06 EOL //07 EOL //08 EOL //09 EOL //10 EOL //11 EOL //12 EOL //13 EOL //14 EOL //15 EOL //16 EOL //17 EOL //18 EOL //19 EOL //20 EOL //21 EOL //22 EOL //23 EOL //24 EOL //25 EOL //26 EOL //27 EOL //28 EOL //29 EOL //30 EOL //31 EOL //32 EOL //33 EOL //34 EOL //35 EOL //36 EOL //37 EOL //38 EOL //39 EOL //40 EOL //41 EOL //42 EOL int main() { } // EOF