FAQ: [#6462] [ltp] some ltp test cases will fail when MAP_PRIVATE is enabled in uclinux(2011)

Document created by Aaronwu Employee on Sep 11, 2013
Version 1Show Document
  • View in full screen mode

[#6462] [ltp] some ltp test cases will fail when MAP_PRIVATE is enabled in uclinux

Submitted By: Vivi Li

Open Date

2011-01-24 05:09:58    

Priority:

Medium     Assignee:

steven miao

Status:

Open     Fixed In Release:

N/A

Found In Release:

2011R1     Release:

Category:

N/A     Board:

N/A

Processor:

ALL     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

gcc4.3-2010_Dec_09

App binary format:

N/A     

Summary: [ltp] some ltp test cases will fail when MAP_PRIVATE is enabled in uclinux

Details:

 

remove macro "#define MAP_PRIVATE_EXCEPT_UCLINUX 0" which is defined in include/test.h and enable MAP_PRIVATE, some ltp test cases will fail in trunk.

Not a regression bug.

 

--

root:/> chmod06

chmod06     1  TPASS  :  chmod() fails, Process is not owner/root: TEST_ERRNO=EPERM(1): Operation not permitted

chmod06     2  TPASS  :  chmod() fails, No Search permissions to process: TEST_ERRNO=EACCES(13): Permission denied

chmod06     3  TFAIL  :  chmod() fails, Address beyond address space, expected errno:14: TEST_ERRNO=ENOENT(2): No such file or dy

chmod06     4  TFAIL  :  chmod() fails, Negative address, expected errno:14: TEST_ERRNO=ENOENT(2): No such file or directory

chmod06     5  TPASS  :  chmod() fails, Pathname too long: TEST_ERRNO=ENAMETOOLONG(36): File name too long

chmod06     6  TPASS  :  chmod() fails, Pathname is empty: TEST_ERRNO=ENOENT(2): No such file or directory

chmod06     7  TPASS  :  chmod() fails, Path contains regular file: TEST_ERRNO=ENOTDIR(20): Not a directory

 

root:/> chown04

chown04     1  TPASS  :  chown() fails, Process is not owner/root: TEST_ERRNO=EPERM(1): Operation not permitted

chown04     2  TPASS  :  chown() fails, No Search permissions to process: TEST_ERRNO=EACCES(13): Permission denied

chown04     3  TFAIL  :  chown() fails, Address beyond address space, expected errno:14: TEST_ERRNO=ENAMETOOLONG(36): File name g

chown04     4  TFAIL  :  chown() fails, Negative address, expected errno:14: TEST_ERRNO=ENOENT(2): No such file or directory

chown04     5  TPASS  :  chown() fails, Pathname too long: TEST_ERRNO=ENAMETOOLONG(36): File name too long

chown04     6  TPASS  :  chown() fails, Pathname is empty: TEST_ERRNO=ENOENT(2): No such file or directory

chown04     7  TPASS  :  chown() fails, Path contains regular file: TEST_ERRNO=ENOTDIR(20): Not a directory

 

root:/> chown04_16

chown04     1  TPASS  :  chown() fails, Process is not owner/root: TEST_ERRNO=EPERM(1): Operation not permitted

chown04     2  TPASS  :  chown() fails, No Search permissions to process: TEST_ERRNO=EACCES(13): Permission denied

chown04     3  TFAIL  :  chown() fails, Address beyond address space, expected errno:14: TEST_ERRNO=ENAMETOOLONG(36): File name g

chown04     4  TFAIL  :  chown() fails, Negative address, expected errno:14: TEST_ERRNO=ENOENT(2): No such file or directory

chown04     5  TPASS  :  chown() fails, Pathname too long: TEST_ERRNO=ENAMETOOLONG(36): File name too long

chown04     6  TPASS  :  chown() fails, Pathname is empty: TEST_ERRNO=ENOENT(2): No such file or directory

chown04     7  TPASS  :  chown() fails, Path contains regular file: TEST_ERRNO=ENOTDIR(20): Not a directory

 

root:/> lchown02 prep_create_link

sh: can't execute 'D//create_link': No such file or directory

lchown02    1  TBROK  :  Fail to modify tfile_1 ownership(s)!

lchown02    2  TBROK  :  Remaining cases broken

lchown02    3  TBROK  :  Remaining cases broken

lchown02    4  TBROK  :  Remaining cases broken

lchown02    5  TBROK  :  Remaining cases broken

lchown02    6  TBROK  :  Remaining cases broken

lchown02    7  TBROK  :  Remaining cases broken

 

root:/> lchown02_16 prep_create_link

sh: can't execute 'D//create_link': No such file or directory

lchown02    1  TBROK  :  Fail to modify tfile_1 ownership(s)!

lchown02    2  TBROK  :  Remaining cases broken

lchown02    3  TBROK  :  Remaining cases broken

lchown02    4  TBROK  :  Remaining cases broken

lchown02    5  TBROK  :  Remaining cases broken

lchown02    6  TBROK  :  Remaining cases broken

lchown02    7  TBROK  :  Remaining cases broken

 

root:/> mkdir01

mkdir01     1  TFAIL  :  mkdir - path argument pointing below allocated address space failed with errno 2 : No such file or dire)

root:/>

--

 

Follow-ups

 

--- steven miao                                              2011-02-11 05:08:56

chmod06, chown04, chown04_16 test 3, UCLINUX can not check Address beyond

address space and return EFAULT, we should drop this test.

 

chmod06, chown04, chown04_16 test 4,Negative address, UCLINUX can not get bad

address with mmap, we should change these case like following:

 

#ifndef UCLINUX

     bad_addr = mmap(0, 1, PROT_NONE,

             MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);

     if (bad_addr == MAP_FAILED) {

@@ -264,6 +266,7 @@

     }

 

     Test_cases[3].pathname = bad_addr;

+#endif

 

--- steven miao                                              2011-02-11 05:19:14

lchown02 prep_create_link

sh: can't execute 'D//create_link': No such file or directory

lchown02_16 prep_create_link

sh: can't execute 'D//create_link': No such file or directory

 

it looks like testcase execute environment issue, try cd /testcases/bin and run

./lchown02

 

--- steven miao                                              2011-02-14 02:07:58

commit two patch to ltp-20101031, see attached files

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

create_link_permission.patch    text/x-patch    2690    steven miao

disable_mmap_gen_badadress.patch    text/x-patch    3130    steven miao

Outcomes