Segfault on Exit

485 views
Skip to first unread message

Mike Finch

unread,
Nov 5, 2013, 4:48:52 PM11/5/13
to cppu...@googlegroups.com
I am running on a remote server and segfaulting after completing all the tests.
OK (256 tests, 256 ran, 10380144 checks, 0 ignored, 0 filtered out, 4037 ms)
05-Nov-2013 16:41:18
05-Nov-2013 16:41:18/bin/sh: line 1: 15145 Segmentation fault      ./MyProductTests_tests
05-Nov-2013 16:41:18make: *** [all] Error 139

Here are the relevant versions :

gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
gcov (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)

Stack trace:
Program received signal SIGSEGV, Segmentation fault. 0x0000003fa9a60694 in fread () from /lib64/libc.so.6 #0 0x0000003fa9a60694 in fread () from /lib64/libc.so.6 #1 0x000000000055c62c in gcov_read_words () #2 0x000000000055c69e in __gcov_read_counter () #3 0x000000000055d639 in __gcov_merge_add () #4 0x000000000055d568 in gcov_exit () #5 0x0000003fa9a33515 in exit () from /lib64/libc.so.6 #6 0x0000003fa9a1d99b in __libc_start_main () from /lib64/libc.so.6 #7 0x0000000000402129 in _start ()

Pain to debug since it runs locally in gcc 4.2.1

Any hints other than removing all the gcov flags?

Bas Vodde

unread,
Nov 11, 2013, 1:28:01 AM11/11/13
to cppu...@googlegroups.com

Hi Mike,

That is strange. Which CppUTest version?

Would you mind sending a backtrace from gcc?

I have no idea so far :)

Bas
> --
> You received this message because you are subscribed to the Google Groups "cpputest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cpputest+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Mike Finch

unread,
Nov 11, 2013, 8:10:27 AM11/11/13
to cppu...@googlegroups.com
That is the entire stack trace at the bottom of the post.

Sent from my Samsung Replenish

Bas Vodde <ba...@odd-e.com> wrote:

>You received this message because you are subscribed to a topic in the Google Groups "cpputest" group.
>To unsubscribe from this topic, visit https://groups.google.com/d/topic/cpputest/L_sR5RExRVY/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to cpputest+u...@googlegroups.com.

Mike Finch

unread,
Nov 13, 2013, 2:31:14 PM11/13/13
to cppu...@googlegroups.com
Sorry for the delay, I was out of the office.

I am running v 3.1 created 2012-04-08-14-34

I have updating on my TODO list, but just have not got to it yet.  Right now it's just a curiosity, not a major issue, since I get the test results before the crash.

Here is the complete stack trace.

Program received signal SIGSEGV, Segmentation fault. 0x0000003fa9a60694 in fread () from /lib64/libc.so.6 
#0 0x0000003fa9a60694 in fread () from /lib64/libc.so.6 
#1 0x000000000055c62c in gcov_read_words () 
#2 0x000000000055c69e in __gcov_read_counter () 
#3 0x000000000055d639 in __gcov_merge_add () 
#4 0x000000000055d568 in gcov_exit () 
#5 0x0000003fa9a33515 in exit () from /lib64/libc.so.6 
#6 0x0000003fa9a1d99b in __libc_start_main () from /lib64/libc.so.6 
#7 0x0000000000402129 in _start () 

Bas Vodde

unread,
Nov 18, 2013, 3:22:33 AM11/18/13
to cppu...@googlegroups.com

Hi Mike,

Ah ok, so it is an old CppUTest version. I thought we had fixed several end-of-run-crashes.

I’m not aware of a gcov related crash, but would be interested if it is still there at the latest version.

Most often the crashes relate to memory being accidentally deleted twice. This was sometimes done in the memory leak detector (ironically) but AFAIK that shouldn’t happen anymore.

Does that give you enough info?

Thanks!

Bas

Mike Finch

unread,
Jan 21, 2014, 11:54:33 AM1/21/14
to cppu...@googlegroups.com
Finally updated to CppUTeast v3.3 created on  2012-08-24-09-41 and issue is resolved.

Mike Finch

unread,
Jan 22, 2014, 11:42:24 AM1/22/14
to cppu...@googlegroups.com
Bas,
I jumped the gun.  One of my other tests was segfauting.  Once I resolved that I got the segfault on exit.  
GNU gdb (GDB) CentOS (7.0.1-42.el5.centos) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. .................................................. .................................................. .................................................. ...........................................!...!.. .................................................. ...........................!.. test/unit_test/gea/gea.cpp:232: error: Failure in TEST(gea, checkApplicatinHeaderResponse) expected <17> but was <13> difference starts at position 1 at: < 13 > ^ . test/unit_test/gea/gea.cpp:202: error: Failure in TEST(gea, sendPreparetoDownload) expected <17> but was <14> difference starts at position 1 at: < 14 > ^ . test/unit_test/gea/gea.cpp:175: error: Failure in TEST(gea, checkEnableFlashProgramming) expected <17> but was <15> difference starts at position 1 at: < 15 > ^ . test/unit_test/gea/gea.cpp:159: error: Failure in TEST(gea, checkEraseFlash) expected <17> but was <16> difference starts at position 1 at: < 16 > ^ ................. ........................hi.......................... ....................!... Errors (4 failures, 374 tests, 370 ran, 10380506 checks, 4 ignored, 0 filtered out, 3484 ms) Program received signal SIGSEGV, Segmentation fault. 0x00000000005db428 in __gcov_read_counter () No symbol table info available. #0 0x00000000005db428 in __gcov_read_counter () #1 0x00000000005dc3b9 in __gcov_merge_add () #2 0x00000000005dc2e8 in gcov_exit () #3 0x0000003fa9a33515 in exit () from /lib64/libc.so.6 #4 0x0000003fa9a1d99b in __libc_start_main () from /lib64/libc.so.6 #5 0x0000000000402189 in _start () A debugging session is active. Inferior 1 [process 20400] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal]

Bas Vodde

unread,
Jan 26, 2014, 4:36:26 AM1/26/14
to cppu...@googlegroups.com

Hi Mike,

Very strange. Do you know if this also happens in the latest version?

What environment is it on? Do you think we can re-produce it, so I can check it?

Thanks!

Bas

Mike Finch

unread,
Jan 26, 2014, 6:55:26 AM1/26/14
to cppu...@googlegroups.com
I have not got the latest version to run yet. It occurs on the CI server which runs RedHat. 4.1.2
Removing the gcov flags from my make file resolves it, but I'd like them back on.

Sent from my Samsung Replenish

Bas Vodde <ba...@odd-e.com> wrote:

>You received this message because you are subscribed to a topic in the Google Groups "cpputest" group.
>To unsubscribe from this topic, visit https://groups.google.com/d/topic/cpputest/L_sR5RExRVY/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to cpputest+u...@googlegroups.com.

Mike Finch

unread,
Feb 11, 2014, 9:14:26 PM2/11/14
to cppu...@googlegroups.com
Bas,
  finally got 3.5 up and the segfault on exit is no longer present.

Bas Vodde

unread,
Feb 12, 2014, 12:22:36 AM2/12/14
to cppu...@googlegroups.com

Hi Mike,

Good to know. Thanks for checking!

Bas

Vishwas Kulkarni

unread,
Sep 5, 2014, 6:13:48 AM9/5/14
to cppu...@googlegroups.com

Hi Mike,

    Even I am also facing the same issue.
   
    Did the issue got resolved automatically after updating the version or do we have to make any changes in our code ?

 Thanks
Vishwas

Mike Finch

unread,
Sep 8, 2014, 9:50:23 PM9/8/14
to cppu...@googlegroups.com
I never resolved, and we switched CI systems for other reasons and II neer went back to it.

Mike

--
You received this message because you are subscribed to a topic in the Google Groups "cpputest" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cpputest/L_sR5RExRVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cpputest+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages