Ticket #2435: execution_monitor.ipp.patch
File execution_monitor.ipp.patch, 6.1 KB (added by , 14 years ago) |
---|
-
execution_monitor.ipp
old new 148 148 # define BOOST_TEST_USE_ALT_STACK 149 149 # endif 150 150 151 # if defined(__FreeBSD__) 152 # if __FreeBSD_version <= 70000 153 # define BOOST_SKIP_SIGNAL_TESTS 154 # define BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE 155 # endif 156 # endif 157 151 158 # if defined(SIGPOLL) && !defined(__CYGWIN__) && \ 152 159 !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && \ 153 160 !defined(__NetBSD__) && \ … … 155 162 # define BOOST_TEST_CATCH_SIGPOLL 156 163 # endif 157 164 165 #ifdef BOOST_SKIP_SIGNAL_TESTS 166 # define BOOST_SKIP_SIGILL_TESTS 167 # define BOOST_SKIP_SIGFPE_TESTS 168 # define BOOST_SKIP_SIGSEGV_TESTS 169 # define BOOST_SKIP_SIGBUS_TESTS 170 # define BOOST_SKIP_SIGCHLD_TESTS 171 # define BOOST_SKIP_SIGPOLL_TESTS 172 #endif 173 158 174 # ifdef BOOST_TEST_USE_ALT_STACK 159 175 # define BOOST_TEST_ALT_STACK_SIZE SIGSTKSZ 160 176 # endif … … 290 306 switch( m_sig_info->si_signo ) { 291 307 case SIGILL: 292 308 switch( m_sig_info->si_code ) { 309 #ifndef BOOST_SKIP_SIGILL_TESTS 293 310 case ILL_ILLOPC: 294 311 report_error( execution_exception::system_fatal_error, 295 312 "signal: illegal opcode; address of failing instruction: 0x%08lx", … … 329 346 report_error( execution_exception::system_fatal_error, 330 347 "signal: internal stack error; address of failing instruction: 0x%08lx", 331 348 m_sig_info->si_addr ); 332 break; 333 } 334 break; 349 break; 350 #endif /* BOOST_SKIP_SIGILL_TESTS */ 351 default: 352 report_error( execution_exception::system_fatal_error, 353 "signal: SIGILL (llegal instruction; address of failing instruction: 0x%08lx)", 354 m_sig_info->si_addr ); 355 break; 356 } 335 357 336 358 case SIGFPE: 337 switch( m_sig_info->si_code ) { 359 switch( m_sig_info->si_code ) { 360 #ifndef BOOST_SKIP_SIGFPE_TESTS 338 361 case FPE_INTDIV: 339 362 report_error( execution_exception::system_error, 340 363 "signal: integer divide by zero; address of failing instruction: 0x%08lx", … … 375 398 "signal: subscript out of range; address of failing instruction: 0x%08lx", 376 399 m_sig_info->si_addr ); 377 400 break; 401 #endif /* BOOST_SKIP_SIGFPE_TESTS */ 402 default: 403 report_error( execution_exception::system_error, 404 "signal: SIGFPE (errnoneous arithmetic operations; address of failing instruction: 0x%08lx)", 405 m_sig_info->si_addr ); 406 break; 378 407 } 379 break;380 408 381 409 case SIGSEGV: 382 410 switch( m_sig_info->si_code ) { 411 #ifndef BOOST_SKIP_SIGSEGV_TESTS 383 412 case SEGV_MAPERR: 384 413 report_error( execution_exception::system_fatal_error, 385 414 "memory access violation at address: 0x%08lx: no mapping at fault address", … … 390 419 "memory access violation at address: 0x%08lx: invalid permissions", 391 420 m_sig_info->si_addr ); 392 421 break; 422 #endif /* BOOST_SKIP_SIGSEGV_TESTS */ 423 default: 424 report_error( execution_exception::system_fatal_error, 425 "signal: SIGSEGV (memory access violation at address: 0x%08lx: invalid permissions)", 426 m_sig_info->si_addr ); 427 break; 393 428 } 394 break;395 429 396 430 case SIGBUS: 397 431 switch( m_sig_info->si_code ) { 432 #ifndef BOOST_SKIP_SIGBUS_TESTS 398 433 case BUS_ADRALN: 399 434 report_error( execution_exception::system_fatal_error, 400 435 "memory access violation at address: 0x%08lx: invalid address alignment", … … 410 445 "memory access violation at address: 0x%08lx: object specific hardware error", 411 446 m_sig_info->si_addr ); 412 447 break; 413 } 414 break; 448 #endif /* BOOST_SKIP_SIGBUS_TESTS */ 449 default: 450 report_error( execution_exception::system_fatal_error, 451 "signal: SIGBUS (memory access violation at address: 0x%08lx: object specific hardware error)", 452 m_sig_info->si_addr ); 453 break; 454 } 415 455 416 456 case SIGCHLD: 417 457 switch( m_sig_info->si_code ) { 458 #ifndef BOOST_SKIP_SIGCHLD_TESTS 418 459 case CLD_EXITED: 419 460 report_error( execution_exception::system_error, 420 461 "child has exited; pid: %d; uid: %d; exit value: %d", … … 445 486 "stopped child had continued; pid: %d; uid: %d; exit value: %d", 446 487 (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status ); 447 488 break; 448 } 449 break; 489 #endif /* BOOST_SKIP_SIGCHLD_TESTS */ 490 default: 491 report_error( execution_exception::system_error, 492 "signal: SIGSEGV (child process has terminated; pid: %d; uid: %d; exit value: %d)", 493 (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status ); 494 break; 495 } 450 496 451 497 #if defined(BOOST_TEST_CATCH_SIGPOLL) 452 498 453 499 case SIGPOLL: 454 500 switch( m_sig_info->si_code ) { 501 #ifndef BOOST_SKIP_SIGPOLL_TESTS 455 502 case POLL_IN: 456 503 report_error( execution_exception::system_error, 457 504 "data input available; band event %d", … … 484 531 (int)m_sig_info->si_band ); 485 532 break; 486 533 #endif 534 #endif /* BOOST_SKIP_SIGPOLL_TESTS */ 535 default: 536 report_error( execution_exception::system_error, 537 "signal: SIGPOLL (asynchronous I/O event occured; band event %d)", 538 (int)m_sig_info->si_band ); 539 break; 487 540 } 488 break;489 541 490 #endif 542 #endif /* BOOST_TEST_CATCH_SIGPOLL */ 491 543 492 544 case SIGABRT: 493 545 report_error( execution_exception::system_error, … … 695 747 696 748 static bool ignore_sigchild( siginfo_t* info ) 697 749 { 698 return info->si_signo == SIGCHLD && info->si_code == CLD_EXITED750 return info->si_signo == SIGCHLD 699 751 #ifdef BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE 700 752 ; 701 753 #else 702 && (int)info->si_status == 0;754 && info->si_code == CLD_EXITED && (int)info->si_status == 0; 703 755 #endif 704 756 } 705 757