[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Linux 2.0 test failures (was glibc 2.2: math test failures)
From: |
Andreas Jaeger |
Subject: |
Re: Linux 2.0 test failures (was glibc 2.2: math test failures) |
Date: |
11 Jun 2001 10:13:50 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.1 (Cuyahoga Valley) |
Michael Deutschmann <address@hidden> writes:
> On 30 Apr 2001, you wrote:
>> > No, I meant that the tests presuppose Linux 2.2 features, so if I run
>> > "make check" on Linux *2.0*, these two tests always fail, as 2.0 does not
>> > support LFS or "realtime" signals above 32.
>>
>> I see. If it still fails for you in 2.2.3, please send a patch to fix
>> it. The glibc developers don't use such an old kernel and therefore
>
> 2.2.3 still has the problems, although I think I've got them handled.
>
> The LFS was actually easy to fix. The test was already prepared to
> check for LFS-not-available. The problem was it expected an unimplemented
> write() in the 64-bit region to return EINVAL, rather than EFBIG.
Thanks, I fixed this.
> That said, there are some other minor niggles with the test. From most
> serious down:
>
> - it assumes write() will always return -1 or 5. Incomplete writes are
> highly unlikely on such a small area of a regular file, but this isn't
> guaranteed to my knowledge. As it is, if it did happen, it would be
> reported as an error using whatever garbage happened to be in errno.
>
> - It would be a good idea to verify that the filesystem supports holes
> before performing the check -- otherwise `spurious' ENOSPC errors could
> occur...
Ok, I've added a check for ENOSPC.
> - it considers the LFS not supported case in the stdio-level subtests.
> this is actually not neccessary since that part would be skipped if
> the low-level test detected no LFS. If LFS is available at the low
> level, then there is no excuse for a failure at stdio-level.
Can you send a patch?
> - there are a few cases where the punctuation at the end of a message
> in "error()" is not appropriate, considering that error() will tack
> on the strerror() text.
I've tried to fix those.
> But I decided to keep it simple for now and just change EINVAL to EFBIG.
Feel free to send further patches.
> I also changed the aio4 test to detect lack of SIGRTMIN/SIGRTMAX. One
> thing -- I noticed the present code just assumes SIGRTMIN+11 is
> available, without verifying it is under SIGRTMAX. My code takes the
> average of the two values to choose a signal. (I assume there was some
> reason just using SIGRTMAX or SIGRTMIN wouldn't trip as many bugs.)
>
>> can't test it themselves - and no, we're not going to add a test "if
>> this is Linux 2.0,..." but checks for ENOSYS tests are fine.
>
> Fine. Although you should know glibc already has such a test, for the
> same feature. The code reads the kernel version in uname() and compares
> against 2.1.70 -- something that could be unstable in the face of
> backports, "slimmed down" kernels, and Linux emulators.
That's in the *implementation* of the features - but I do not want
this in the testsuite.
> IMO, it would be better if you probed by attempting to read the signal
> handler for __SIGRTMAX with sigaction(), and checking for EINVAL. This
> could easily be extended to a binary search for the highest working
> RT signal, allowing kernels with any number of signals to be supported.
Thanks, I added this.
I've appended the diff for test-lfs.
Thanks,
Andreas
2001-06-11 Michael Deutschmann <address@hidden>
* rt/tst-aio4.c (do_test): Test whether rt signals are supported.
Use my_signo instead of MY_SIGNO and initialize it so that the
used signal is always available.
2001-06-11 Andreas Jaeger <address@hidden>,
Michael Deutschmann <address@hidden>
* io/test-lfs.c (do_prepare): Clean up error messages.
(test_ftello): Check for EFBIG and ENOSP, clean up error messages.
(do_test): Likewise.
Index: io/test-lfs.c
===================================================================
RCS file: /cvs/glibc/libc/io/test-lfs.c,v
retrieving revision 1.7
diff -u -r1.7 test-lfs.c
--- test-lfs.c 2001/02/05 21:38:48 1.7
+++ test-lfs.c 2001/06/11 08:07:09
@@ -65,7 +65,7 @@
if (errno == ENOSYS)
{
/* Fail silently. */
- error (0, errno, "open64 is not supported");
+ error (0, 0, "open64 is not supported");
exit (EXIT_SUCCESS);
}
else
@@ -100,29 +100,29 @@
ret = fseeko64 (f, TWO_GB+100, SEEK_SET);
if (ret == -1 && errno == ENOSYS)
{
- error (0, errno, "fseeko64 is not supported");
+ error (0, 0, "fseeko64 is not supported.");
exit (EXIT_SUCCESS);
}
if (ret == -1 && errno == EINVAL)
{
- error (0, errno, "LFS seems not to be supported ");
+ error (0, 0, "LFS seems not to be supported");
exit (EXIT_SUCCESS);
}
if (ret == -1)
{
- error (0, errno, "fseeko64 failed with error: ");
+ error (0, errno, "fseeko64 failed with error");
exit (EXIT_FAILURE);
}
ret = fwrite ("Hello", 1, 5, f);
- if (ret == -1 && errno == EINVAL)
+ if (ret == -1 && errno == EFBIG)
{
- error (0, errno, "LFS seems not to be supported.");
+ error (0, errno, "LFS seems not to be supported");
exit (EXIT_SUCCESS);
}
if (ret != 5)
- error (EXIT_FAILURE, errno, "cannot write test string to large file");
+ error (EXIT_FAILURE, errno, "Cannot write test string to large file");
pos = ftello64 (f);
@@ -144,27 +144,33 @@
ret = lseek64 (fd, TWO_GB+100, SEEK_SET);
if (ret == -1 && errno == ENOSYS)
{
- error (0, errno, "lseek64 is not supported");
+ error (0, 0, "lseek64 is not supported.");
exit (EXIT_SUCCESS);
}
if (ret == -1 && errno == EINVAL)
{
- error (0, errno, "LFS seems not to be supported ");
+ error (0, 0, "LFS seems not to be supported.");
exit (EXIT_SUCCESS);
}
if (ret == -1)
{
- error (0, errno, "lseek64 failed with error: ");
+ error (0, errno, "lseek64 failed with error");
exit (EXIT_FAILURE);
}
ret = write (fd, "Hello", 5);
- if (ret == -1 && errno == EINVAL)
+ if (ret == -1 && errno == EFBIG)
{
- error (0, errno, "LFS seems not to be supported.");
+ error (0, 0, "LFS seems not to be supported.");
exit (EXIT_SUCCESS);
}
+ if (ret == -1 && errno == ENOSPC)
+ {
+ error (0, 0, "Not enough space to write file.");
+ exit (EXIT_SUCCESS);
+ }
+
if (ret != 5)
error (EXIT_FAILURE, errno, "cannot write test string to large file");
@@ -176,7 +182,7 @@
ret = stat64 (name, &statbuf);
if (ret == -1 && (errno == ENOSYS || errno == EOVERFLOW))
- error (0, errno, "stat64 is not supported");
+ error (0, 0, "stat64 is not supported.");
else if (ret == -1)
error (EXIT_FAILURE, errno, "cannot stat file `%s'", name);
else if (statbuf.st_size != (TWO_GB + 100 + 5))
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj