This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 2/2] posix: Implement preadv2 and pwritev2



On 02/06/2017 11:22, Zack Weinberg wrote:
> On Fri, Jun 2, 2017 at 10:07 AM, Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>>
>> On 02/06/2017 10:34, Florian Weimer wrote:
>>> On 06/02/2017 03:04 PM, Zack Weinberg wrote:
>>>> I see this as well, for both tst-preadvwritev2 and
>>>> tst-preadvwritev64v2 on my x86-64 machine (kernel 4.9).  Like HJ, if I
>>>> run the test manually, it succeeds.
>>>
>>> I see this on x86-64.
>>>
>>> pwritev2(3,
>>> [{iov_base="\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360",
>>> iov_len=32},
>>> {iov_base="\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17"...,
>>> iov_len=64}], 2, 0, 0x30 /* RWF_??? */) = -1 EOPNOTSUPP (Operation not
>>> supported)
>>>
>>> On a kernel which supports pwritev2 in general.  I do not know yet where
>>> the 0x30 comes from.
>>>
>>> Florian
>>>
>>
>> This one still puzzles me, on 4.10.0 with gcc 6.3.0 I am seeing:
>>
>> [...]
>> [pid 28447] setpgid(0, 0)               = 0
>> [pid 28447] pwritev2(3, [{"\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360", 32}, {"\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17"..., 64}], 2, 0, 0) = 96
>> [pid 28447] pwritev2(3, [{"\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360", 32}, {"\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17"..., 64}], 2, 96, 0) = 96
>> [pid 28447] preadv2(3, [{"\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360", 32}, {"\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17"..., 64}], 2, 0, 0) = 96
>> [pid 28447] preadv2(3, [{"\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360\360", 32}, {"\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17\17"..., 64}], 2, 96, 0) = 96
>> [pid 28447] getpid()                    = 28447
>> [...]
>>
>> This only issue I can think of is something very fuzzy in test build or a miscompilation.
> 
> There's gotta be something wonky with the argument passing. Maybe try
> running the test case under valgrind?  Also this trick often helps
> when a failure goes away when you run it manually:
> 
> export CHANGE_SIZE_OF_ENV=""
> while
>     the-command-that-should-fail
> do
>     CHANGE_SIZE_OF_ENV="${CHANGE_SIZE_OF_ENV}x"
>     echo -n .
> done; echo
> 
> zw
> 

I am even more confident this is indeed a miscompilation from GCC7 branch.
Using a previous built x86_64-linux-gnu with GCC6 branch I saw no issue, however
using GCC7 there is indeed the test failure.  And it seems to show only for kernels
with support for p{read,write}v2 syscall, which means it stress the default
SYSCALL_CANCEL path.

However, running a GCC6 built testcase with a GCC7 build glibc (with testrun.sh)
I saw no issue.  The GCC7 built test also fails with a GCC6 built glibc.  I will
check with GCC master to see if this is something only on GCC7 branch or if it
is still on master.

Also, I seems that for GCC7 only x86_64-linux-gnu is affect on x86.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]