[Boost-testing] Patch for sigaltstack failure on Leopard wit…

Top Page

Reply to this message
Author: Jeroen van der Wulp
Date:  
To: boost-testing
Subject: [Boost-testing] Patch for sigaltstack failure on Leopard with XCode 3.0
Hello everyone,

The recent changes to Boost.test on trunk have caused testing failures
on OS X. The problem is that internally an exception is thrown on
destruction of every signal_handler. The result looks like this:

boost/boost/test/minimal.hpp(123): exception "system_error produced by:
::sigaltstack( &sigstk, 0 ) != -1: Cannot allocate memory" caught in
function: 'int main(int, char**)'

The cause seems to be that the implementation of sigaltstack() on
Leopard requires the ss_size of a stack_t structure to be MINSIGSTKSZ at
least.

The attached patch accomplishes just this.

Regards,

Jeroen van der Wulp
Index: 3rd-party/boost/boost/test/impl/execution_monitor.ipp
===================================================================
--- 3rd-party/boost/boost/test/impl/execution_monitor.ipp    (revision 47301)
+++ 3rd-party/boost/boost/test/impl/execution_monitor.ipp    (working copy)
@@ -669,6 +669,7 @@
#ifdef BOOST_TEST_USE_ALT_STACK
stack_t sigstk = {};

+ sigstk.ss_size = BOOST_TEST_ALT_STACK_SIZE;
sigstk.ss_flags = SS_DISABLE;
BOOST_TEST_SYS_ASSERT( ::sigaltstack( &sigstk, 0 ) != -1 );
#endif
_______________________________________________
Boost-Testing mailing list
Boost-Testing@???
http://lists.boost.org/mailman/listinfo.cgi/boost-testing