Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sigsegv on running basic scenario #649

Closed
curb1968 opened this issue Apr 28, 2016 · 3 comments
Closed

sigsegv on running basic scenario #649

curb1968 opened this issue Apr 28, 2016 · 3 comments

Comments

@curb1968
Copy link

curb1968 commented Apr 28, 2016

I'm attempting to use catch to perform unit testing for an embedded target running on a microblaze processor. I'm testing using QEMU and using gcc version 4.6.4 (20120924). I've provided my unit test code as well as the backtrace of the call tree immediately prior to the sigsegv.

/*
- Unit test application written for testing within QEMU
  */
  #define CATCH_CONFIG_RUNNER // This tells Catch that we will provide a main() - ONLY PROVIDE THIS ONCE!!!
  #include "catch.hpp"
# include <iostream>
# include <string>
# include <memory>   // unique_ptr

int main( int argc, char\* const argv[] )
{
    int result = Catch::Session().run( argc, argv );
    return result;
}
SCENARIO( "test the UT framework under qemu", "[CATCH]" )
{
    GIVEN( "UT has started" )
    {
        REQUIRE( (1 == 1) );
    }
}

Here's the stack trace under gdb:

> # 0  Catch::FreeFunctionTestCase::invoke (this=0x1019abc8)
> 
> 
> at ../deps/include/catch.hpp:5810
> 
> # 1  0x100090c0 in Catch::TestCase::invoke (this=0x1019c208)
> 
> 
> at ../deps/include/catch.hpp:6715
> 
> # 2  0x100251fc in Catch::RunContext::invokeActiveTestCase (this=0xbffffa28)
> 
> 
> at ../deps/include/catch.hpp:5412
> 
> # 3  0x10024dfc in Catch::RunContext::runCurrentTest (this=0xbffffa28, redirectedCout=..., redirectedCerr=...)
> 
> 
> at ../deps/include/catch.hpp:5384
> 
> # 4  0x100230d4 in Catch::RunContext::runTest (this=0xbffffa28, testCase=...)
> 
> 
> at ../deps/include/catch.hpp:5223
> 
> # 5  0x10025ad8 in Catch::Runner::runTests (this=0xbffffb38)
> 
> 
> at ../deps/include/catch.hpp:5543
> 
> # 6  0x100272cc in Catch::Session::run (this=0xbffffcbc)
> 
> 
> at ../deps/include/catch.hpp:5670
> 
> # 7  0x10027000 in Catch::Session::run (this=0xbffffcbc, argc=1, argv=0xbffffe04)
> 
> 
> at ../deps/include/catch.hpp:5650
> 
> # 8  0x10011738 in main (argc=1, argv=0xbffffe04) at ../UnitTest/unitTest.cpp:26
> 
> (gdb) n
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000008 in ?? ()
> (gdb) bt
> # 0  0x00000008 in ?? ()
> # 1  0x00000008 in ?? ()
> 
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb) 
> # 0  0x00000008 in ?? ()
> # 1  0x00000008 in ?? ()
@horenmar
Copy link
Member

horenmar commented Jan 8, 2017

I edited the issue to make the example code more legible.

Can anyone with QEMU confirm if this is happening with current Catch?

@philsquared
Copy link
Collaborator

This looks like it could be related to #661

@horenmar
Copy link
Member

horenmar commented Jun 8, 2017

Since it has been ~5 months without new information, I am going to close this issue. If someone manages to reliably reproduce this with latest Catch, please open a new issue and link this one.

@horenmar horenmar closed this as completed Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants