Robotics StackExchange | Archived questions

Intermittent segfault when running gtests

Hi all,

I am trying to debug a strange intermittent issue, but I can't find the problem.

Platform:

Symptom(s):

Note: I've replaced the paths with ...

[ 32%] Built target _run_tests_... Segmentation fault (core dumped) -- run_tests.py: verify result "../test_results/.../gtest-test_....xml" Cannot find results, writing failure results to '...MISSING-gtest-test_....xml'

Initial thoughts:

I unfortunately cannot copy the code here because its proprietary.

Any ideas about what could be going on? Anybody has experienced similar intermittent issues like this with gtests? If yes, what was the cause?

Edit: here is what I see when I run valgrind on the libgtest.so file created for the package.

valgrind ./libgtest.so 
==2024== Memcheck, a memory error detector
==2024== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==2024== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==2024== Command: ./libgtest.so
==2024== 
==2024== Invalid read of size 8
==2024==    at 0x11FD59: testing::internal::FormatCxxExceptionMessage(char const*, char const*) (gtest.cc:2029)
==2024==  Address 0x28 is not stack'd, malloc'd or (recently) free'd
==2024== 
==2024== 
==2024== Process terminating with default action of signal 11 (SIGSEGV)
==2024==  Access not within mapped region at address 0x28
==2024==    at 0x11FD59: testing::internal::FormatCxxExceptionMessage(char const*, char const*) (gtest.cc:2029)
==2024==  If you believe this happened as a result of a stack
==2024==  overflow in your program's main thread (unlikely but
==2024==  possible), you can try to increase the size of the
==2024==  main thread stack using the --main-stacksize= flag.
==2024==  The main thread stack size used in this run was 8388608.
==2024== 
==2024== HEAP SUMMARY:
==2024==     in use at exit: 0 bytes in 0 blocks
==2024==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2024== 
==2024== All heap blocks were freed -- no leaks are possible
==2024== 
==2024== For counts of detected and suppressed errors, rerun with: -v
==2024== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault

This also happens in the other packages.

Asked by Pinknoise2077 on 2020-10-30 11:40:41 UTC

Comments

Answers