Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segmentation fault with gcov

I compiled my source files with gcov flags on a remote server.

CFLAGS += -fprofile-arcs -ftest-coverage -lgcov -coverage

Compilation works fine. gcc 4.7 was used for compilation. .gcno file generated has 407* format. all functions works fine. i get coverage report using gcov main.c

Now i am trying get coverage data, in my local system which has gcc version 4.1.2

I get segmentation fault.

Error:

main.gcno:version `407*', prefer 401p'
Segmentation fault (core dumped)

Does version of gcc is the reason for this? Why am i getting segmentation fault? What are the changes made in the new gcc. What are possible solutions? ( I cant update gcc)

Any suggestions would be helpful..

like image 269
ssh99 Avatar asked Oct 16 '25 13:10

ssh99


1 Answers

Seems like different versions of gcov are not compatible and there is no backward compatibility. Just upgraded gcc to 4.7 and everything works just fine.

like image 105
ssh99 Avatar answered Oct 18 '25 08:10

ssh99



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!