Environment: Ubuntu 16.04 x86_64
Version: dcc9b9cdb2cd6de7c5b300b8d1f5dfb3f0b31ab2


readv.test is fail on Ubuntu 16.04 x86_64


test-suite.log/readv.log:


251 FAIL: readv
252 ===========
253 
254 ../strace: invalid descriptor '65534'
255 readv.test: failed test: ../strace -a16 -eread=65534 -ewrite=65535 -e 
trace=readv,writev ./readv failed with code 1
256 FAIL readv.test (exit status: 1)


readv.test.tmp and readv.test.tmp.exp is empty.


In my computer fds[0] = 65534, fds[1] = 65534, biger then 0x7fff, so in 
function qual_desc will return -1.


/* syscall.c: 734 */
qual_desc(const char *s, const unsigned int bitflag, const int not)
{
        int desc = string_to_uint_upto(s, 0x7fff);
        if (desc < 0)
                return -1;
        qualify_one(desc, bitflag, not, -1, NULL);
        return 0;
}


My patch:


From c58e2972c732eb545c7c3bff76222f1806474a03 Mon Sep 17 00:00:00 2001
From: JingPiao Chen <chenjingp...@foxmail.com>
Date: Sun, 4 Dec 2016 19:56:19 +0800
Subject: [PATCH] tests: fix maximum fd in pipe_maxfd


* tests/pipe_maxfd.c: Change INT_MAX to 0x7fff.
---
 tests/pipe_maxfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/tests/pipe_maxfd.c b/tests/pipe_maxfd.c
index a1343f9..c7ba7d8 100644
--- a/tests/pipe_maxfd.c
+++ b/tests/pipe_maxfd.c
@@ -58,8 +58,8 @@ pipe_maxfd(int pipefd[2])
        if (pipe(pipefd))
                perror_msg_and_fail("pipe");
 
-       int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX)
-                    ? rlim.rlim_cur - 1 : INT_MAX;
+       int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < 0x7fff)
+                    ? rlim.rlim_cur - 1 : 0x7fff;
 
        move_fd(&pipefd[1], &max_fd);
        --max_fd;
-- 
2.7.4
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to