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] Fix test-errno issues



On 13/03/2017 18:12, Wainer dos Santos Moschetta wrote:
> On 03/13/2017 11:21 AM, Adhemerval Zanella wrote:
>> This patch fixes multiple issues of test-errno.c (9a56f8718341):
>>
>>   - Rename Linux test-errno.c to test-errno-linux.c to avoid build
>>     the same source for both tests.
>>
>>   - Add a mlock check for 32 bits build running on 64 bits kernels.
>>     Althuough man pages states that mlock fails with EINVAL if final
>>     address overflows, kernels does not return it for aforementioned
>>     condition (it returns ENOMEM instead).  Although it seems to be
>>     a kernel issue for compat syscall handling, I think it is worth
>>     to still check syscall return and document the behavior.
>>
>>   - Initialize option lenght for setsockopt check.
>>
>> Checked on x86_64-linux-gnu and i686-linux-gnu (running on 64 bits
>> kernel).
>>
>> 	* posix/test-errno.c (do_test): Initialize setsockopt optlen.
>> 	* sysdeps/unix/sysv/linux/test-errno.c: Move to ...
>> 	* sysdeps/unix/sysv/linux/test-errno-linux.c: ... here.
>> 	(do_test): Handle mlock return on 64 bits kernels with 32 bits
>> 	binaries.
> With these changes test-errno passes in ppc64le and ppc32. It fails in ppc64 (big endian) with:
> FAIL: open: errno is: 20 (Not a directory) expected: 22 (Invalid argument)

The test is passing all possible flags on open and kernel had some change
on flags handling over the versions.  For instance, for 3.2 build_open_flags
does not return EINVAL.

So I think it might be the case where the flags combination plus specific
kernel version is not triggering EINVAL with all possible flag combination.
A more simple test should trigger an expected errno regardless, so I am
thinking about replacing the open testcase with:

fails |= test_wrp (EISDIR, open, "/bin", EISDIR, O_WRONLY);

> 
> Nonetheless, it is OK if you commit these changes since they fix the test for other architectures. I'll investigate the failure in ppc64 and propose a further change later if applicable.
> 


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