Boost Test Framework: Any way to get a backtrace on SIGSEV? [duplicate]











up vote
0
down vote

favorite













This question already has an answer here:




  • How to automatically generate a stacktrace when my program crashes

    28 answers



  • How to get a stack trace for C++ using gcc with line number information?

    12 answers



  • How to programmatically cause a core dump in C/C++

    10 answers




Just starting out with boost test framework. Using Ubuntu + gcc (running on Windows through the new thing if that matters). When I run my tests, I get this:



unknown location(0): fatal error: in "PhraseListTest/everythingEqual8": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000080)
/mnt/c/projects/matching/matching-native/src/test/cpp/phrase_list_test.cpp(70): last checkpoint

*** 1 failure is detected in the test module "burningmime_matching_tests"


How would I go about finding where in my code that happened? The only indication that message gives points to a line in the test. The line in question is just:



BOOST_CHECK(matches(phraseList, bitset));


I'm fairly certain the problem is occurring somewhere inside the matches() function (probably many levels deep), but... where?



Another answer suggested I link with -lSegFault, but that didn't do anything (presumably because Boost's test execution engine is overriding the signal handler). I'm not doing anything fancy regarding the build steps (just doing -g -O0 -fPIC -march=native -lboost_unit_test_framework).



This one has been tricky to track down through printf() debugging, because it only happens occasionally and might have to do with some alignment issues. Any help in getting a nicely formatted stack trace (like one would get from Java/Python/C#) would be greatly appreciated.



I'm not married to boost test (this is a personal project), so if there's another testing framework that would work better, I'm more than willing to switch.



This is not a duplicate of any of the linked questions because boost test framework will override any signal handlers with its own signal handlers. Those answers are all about adding things which will conflict with the boost test stuff.










share|improve this question















marked as duplicate by πάντα ῥεῖ c++
Users with the  c++ badge can single-handedly close c++ questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Just run it under debugger
    – VTT
    2 days ago















up vote
0
down vote

favorite













This question already has an answer here:




  • How to automatically generate a stacktrace when my program crashes

    28 answers



  • How to get a stack trace for C++ using gcc with line number information?

    12 answers



  • How to programmatically cause a core dump in C/C++

    10 answers




Just starting out with boost test framework. Using Ubuntu + gcc (running on Windows through the new thing if that matters). When I run my tests, I get this:



unknown location(0): fatal error: in "PhraseListTest/everythingEqual8": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000080)
/mnt/c/projects/matching/matching-native/src/test/cpp/phrase_list_test.cpp(70): last checkpoint

*** 1 failure is detected in the test module "burningmime_matching_tests"


How would I go about finding where in my code that happened? The only indication that message gives points to a line in the test. The line in question is just:



BOOST_CHECK(matches(phraseList, bitset));


I'm fairly certain the problem is occurring somewhere inside the matches() function (probably many levels deep), but... where?



Another answer suggested I link with -lSegFault, but that didn't do anything (presumably because Boost's test execution engine is overriding the signal handler). I'm not doing anything fancy regarding the build steps (just doing -g -O0 -fPIC -march=native -lboost_unit_test_framework).



This one has been tricky to track down through printf() debugging, because it only happens occasionally and might have to do with some alignment issues. Any help in getting a nicely formatted stack trace (like one would get from Java/Python/C#) would be greatly appreciated.



I'm not married to boost test (this is a personal project), so if there's another testing framework that would work better, I'm more than willing to switch.



This is not a duplicate of any of the linked questions because boost test framework will override any signal handlers with its own signal handlers. Those answers are all about adding things which will conflict with the boost test stuff.










share|improve this question















marked as duplicate by πάντα ῥεῖ c++
Users with the  c++ badge can single-handedly close c++ questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Just run it under debugger
    – VTT
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:




  • How to automatically generate a stacktrace when my program crashes

    28 answers



  • How to get a stack trace for C++ using gcc with line number information?

    12 answers



  • How to programmatically cause a core dump in C/C++

    10 answers




Just starting out with boost test framework. Using Ubuntu + gcc (running on Windows through the new thing if that matters). When I run my tests, I get this:



unknown location(0): fatal error: in "PhraseListTest/everythingEqual8": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000080)
/mnt/c/projects/matching/matching-native/src/test/cpp/phrase_list_test.cpp(70): last checkpoint

*** 1 failure is detected in the test module "burningmime_matching_tests"


How would I go about finding where in my code that happened? The only indication that message gives points to a line in the test. The line in question is just:



BOOST_CHECK(matches(phraseList, bitset));


I'm fairly certain the problem is occurring somewhere inside the matches() function (probably many levels deep), but... where?



Another answer suggested I link with -lSegFault, but that didn't do anything (presumably because Boost's test execution engine is overriding the signal handler). I'm not doing anything fancy regarding the build steps (just doing -g -O0 -fPIC -march=native -lboost_unit_test_framework).



This one has been tricky to track down through printf() debugging, because it only happens occasionally and might have to do with some alignment issues. Any help in getting a nicely formatted stack trace (like one would get from Java/Python/C#) would be greatly appreciated.



I'm not married to boost test (this is a personal project), so if there's another testing framework that would work better, I'm more than willing to switch.



This is not a duplicate of any of the linked questions because boost test framework will override any signal handlers with its own signal handlers. Those answers are all about adding things which will conflict with the boost test stuff.










share|improve this question
















This question already has an answer here:




  • How to automatically generate a stacktrace when my program crashes

    28 answers



  • How to get a stack trace for C++ using gcc with line number information?

    12 answers



  • How to programmatically cause a core dump in C/C++

    10 answers




Just starting out with boost test framework. Using Ubuntu + gcc (running on Windows through the new thing if that matters). When I run my tests, I get this:



unknown location(0): fatal error: in "PhraseListTest/everythingEqual8": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000080)
/mnt/c/projects/matching/matching-native/src/test/cpp/phrase_list_test.cpp(70): last checkpoint

*** 1 failure is detected in the test module "burningmime_matching_tests"


How would I go about finding where in my code that happened? The only indication that message gives points to a line in the test. The line in question is just:



BOOST_CHECK(matches(phraseList, bitset));


I'm fairly certain the problem is occurring somewhere inside the matches() function (probably many levels deep), but... where?



Another answer suggested I link with -lSegFault, but that didn't do anything (presumably because Boost's test execution engine is overriding the signal handler). I'm not doing anything fancy regarding the build steps (just doing -g -O0 -fPIC -march=native -lboost_unit_test_framework).



This one has been tricky to track down through printf() debugging, because it only happens occasionally and might have to do with some alignment issues. Any help in getting a nicely formatted stack trace (like one would get from Java/Python/C#) would be greatly appreciated.



I'm not married to boost test (this is a personal project), so if there's another testing framework that would work better, I'm more than willing to switch.



This is not a duplicate of any of the linked questions because boost test framework will override any signal handlers with its own signal handlers. Those answers are all about adding things which will conflict with the boost test stuff.





This question already has an answer here:




  • How to automatically generate a stacktrace when my program crashes

    28 answers



  • How to get a stack trace for C++ using gcc with line number information?

    12 answers



  • How to programmatically cause a core dump in C/C++

    10 answers








c++ linux gcc segmentation-fault boost-test






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago

























asked 2 days ago









Robert Fraser

6,78364676




6,78364676




marked as duplicate by πάντα ῥεῖ c++
Users with the  c++ badge can single-handedly close c++ questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by πάντα ῥεῖ c++
Users with the  c++ badge can single-handedly close c++ questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
2 days ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Just run it under debugger
    – VTT
    2 days ago


















  • Just run it under debugger
    – VTT
    2 days ago
















Just run it under debugger
– VTT
2 days ago




Just run it under debugger
– VTT
2 days ago

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Bressuire

Vorschmack

Quarantine