bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-stack: use libsigsegv when possible


From: Bruno Haible
Subject: Re: c-stack: use libsigsegv when possible
Date: Sun, 20 Jul 2008 19:21:22 +0200
User-agent: KMail/1.5.4

Eric Blake wrote:
> this is what exposed the libsigsegv on OpenBSD 4.0

Currently the test-c-stack2.sh gets a SKIP with a confusing error message:
it says "consider installing libsigsegv" although libsigsegv is already being
used. You noticed that it's a bug in libsigsegv; normal testers may overlook it.
I propose to turn it into a FAIL:

  cannot tell stack overflow from crash, despite of libsigsegv
  FAIL: test-c-stack2.sh

OK to apply? (Note: One needs the '(exit 77); exit 77' idiom only when
a trap handler is installed which refers to $?. In most gnulib tests it
is not needed.)


2008-07-20  Bruno Haible  <address@hidden>

        * modules/c-stack-tests (Makefile.am): Add LIBSIGSEGV to
        TESTS_ENVIRONMENT.
        * tests/test-c-stack2.sh: React differently if LIBSIGSEGV is in use.

*** modules/c-stack-tests.orig  2008-07-20 19:18:47.000000000 +0200
--- modules/c-stack-tests       2008-07-20 19:05:27.000000000 +0200
***************
*** 10,16 ****
  
  Makefile.am:
  TESTS += test-c-stack.sh test-c-stack2.sh
! TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
  check_PROGRAMS += test-c-stack
  test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@
  MOSTLYCLEANFILES += t-c-stack.tmp t-c-stack2.tmp
--- 10,16 ----
  
  Makefile.am:
  TESTS += test-c-stack.sh test-c-stack2.sh
! TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LIBSIGSEGV='@LIBSIGSEGV@'
  check_PROGRAMS += test-c-stack
  test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@
  MOSTLYCLEANFILES += t-c-stack.tmp t-c-stack2.tmp
*** tests/test-c-stack2.sh.orig 2008-07-20 19:18:47.000000000 +0200
--- tests/test-c-stack2.sh      2008-07-20 19:08:27.000000000 +0200
***************
*** 11,21 ****
  
  case $? in
    77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
!       echo 'cannot tell stack overflow from crash; consider installing 
libsigsegv' >&2
        else
!        cat t-c-stack2.tmp >&2
        fi
!       (exit 77); exit 77 ;;
    0) (exit 1); exit 1 ;;
  esac
  if grep 'program error' t-c-stack2.tmp >/dev/null ; then
--- 11,28 ----
  
  case $? in
    77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
!       if test -z "$LIBSIGSEGV"; then
!         echo 'cannot tell stack overflow from crash; consider installing 
libsigsegv' >&2
!         exit 77
!       else
!         echo 'cannot tell stack overflow from crash, despite of libsigsegv' 
>&2
!         exit 1
!       fi
        else
!       cat t-c-stack2.tmp >&2
!       exit 77
        fi
!       ;;
    0) (exit 1); exit 1 ;;
  esac
  if grep 'program error' t-c-stack2.tmp >/dev/null ; then





reply via email to

[Prev in Thread] Current Thread [Next in Thread]