New submission from Matthias Klose:

The test_resource test fails at least on all non x86 linux systems; the
test case notes:

# Now check to see what happens when the RLIMIT_FSIZE is small.  Some
# versions of Python were terminated by an uncaught SIGXFSZ, but
# pythonrun.c has been fixed to ignore that exception.  If so, the
# write() should return EFBIG when the limit is exceeded.

however instead of EFBIG errno is set to ESPIPE, causing an IOException.
and letting the test fail.

----------
components: Extension Modules
files: tst.c
messages: 56520
nosy: doko
severity: normal
status: open
title: test_resource fails on recent linux systems (
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file8561/tst.c

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1291>
__________________________________
#include <signal.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>

#include <stdio.h>

void catch_sigxfsz(int sig_num)
{
  signal(SIGINT, catch_sigxfsz);
  printf("catched SIGXFSZ\n");
  fflush(stdout);
}

int main()
{
  int rc, fd, i;
  struct sigaction context, ocontext;
  struct rlimit fsize;

  context.sa_handler = SIG_IGN;
  context.sa_handler = catch_sigxfsz;
  sigemptyset(&context.sa_mask);
  context.sa_flags = 0;
  if (sigaction(SIGXFSZ, &context, &ocontext) == -1)
    perror("sigaction");

  getrlimit(RLIMIT_FSIZE, &fsize);
  fsize.rlim_cur = 8 * 128;
  if (setrlimit(RLIMIT_FSIZE, &fsize))
    perror("setrlimit");

  unlink("tstrlimit");
  fd = creat("tstrlimit", 0);
  for (i=0; i<128; i++)
    if (write(fd, "1234567\n", 8) == -1)
      perror("write");

  if (write(fd, "1234567\n", 1) == -1)
    {
      perror("write2");
      printf("errno: %d (EFBIG=%d, ESPIPE=%d)\n", errno, EFBIG, ESPIPE);
    }

  return 0;
}
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to