Re: [LTP] [PATCH] io_submit: uninitialized iocb may not return -EINVAL

Nitin Yadav
2012-07-05T13:05:57Z

[-- Attachment #1.1: Type: text/plain, Size: 13600 bytes --]

Hi ,

I getting below error because of io_submit return -1 EINVAL(after
appling the patch), while running the aio_tio in Linux 3.2 kernel.

ltp/testcases/kernel/io/aio/aio02# ./aio_tio

aio02/aio_tio 0 TINFO : Running test 1

aio02/aio_tio 0 TINFO : Running test 2

aio02/aio_tio 0 TINFO : Running test 3

aio02/aio_tio 0 TINFO : Running test 4

aio02/aio_tio 0 TINFO : Running test 5

aio02/aio_tio 0 TINFO : Running test 6

aio02/aio_tio 0 TINFO : Running test 7

aio02/aio_tio 0 TINFO : myctx = 2843729920l

io_fsync write: Invalid argument

while doing strace I came to know that io_submit returns -1 EINVAL,
please see the below trace for error(highlighted in RED) .

ltp-full-20120614/testcases/kernel/io/aio/aio02# strace ./aio_tio

execve("./aio_tio", ["./aio_tio"], [/* 15 vars */]) = 0

brk(0) = 0x1b0c000

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)

mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7fc145623000

access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)

open("/etc/ld.so.cache", O_RDONLY) = 3

fstat(3, {st_mode=S_IFREG|0644, st_size=30650, ...}) = 0

mmap(NULL, 30650, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc14561b000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)

open("/lib/libaio.so.1", O_RDONLY) = 3

read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\5\0\0\0\0\0\0"...,
832) = 832

fstat(3, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0

mmap(NULL, 2099936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x7fc145207000

mprotect(0x7fc145208000, 2093056, PROT_NONE) = 0

mmap(0x7fc145407000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fc145407000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)

open("/lib/libc.so.6", O_RDONLY) = 3

read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\355\1\0\0\0\0\0"...,
832) = 832

fstat(3, {st_mode=S_IFREG|0755, st_size=1437064, ...}) = 0

mmap(NULL, 3545160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x7fc144ea5000

mprotect(0x7fc144ffe000, 2093056, PROT_NONE) = 0

mmap(0x7fc1451fd000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x158000) = 0x7fc1451fd000

mmap(0x7fc145202000, 18504, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc145202000

close(3) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7fc14561a000

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7fc145619000

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7fc145618000

arch_prctl(ARCH_SET_FS, 0x7fc145619700) = 0

mprotect(0x7fc1451fd000, 16384, PROT_READ) = 0

mprotect(0x7fc145625000, 4096, PROT_READ) = 0

munmap(0x7fc14561b000, 30650) = 0

getpid() = 29055

mkdir("/tmp/aio12Pn7B", 0700) = 0

brk(0) = 0x1b0c000

brk(0x1b2d000) = 0x1b2d000

getgid() = 0

chown("/tmp/aio12Pn7B", 4294967295, 0) = 0

chmod("/tmp/aio12Pn7B", 0777) = 0

chdir("/tmp/aio12Pn7B") = 0

fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 2), ...}) = 0

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7fc145622000

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 45aio02/aio_tio 0
TINFO : Running test 1

) = 45

write(1, "\n", 1

) = 1

open("file1", O_WRONLY|O_CREAT|O_TRUNC|O_DIRECT, 0644) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 32

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 46aio02/aio_tio 0
TINFO : Running test 2

) = 46

open("file1", O_RDONLY|O_DIRECT) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 4

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 3

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 2

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 4

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 1

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 2

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 3

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 2

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 46aio02/aio_tio 0
TINFO : Running test 3

) = 46

open("file1", O_RDWR|O_TRUNC) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 32

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 46aio02/aio_tio 0
TINFO : Running test 4

) = 46

open("file1", O_RDWR) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 32

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 46aio02/aio_tio 0
TINFO : Running test 5

) = 46

open("file1", O_WRONLY|O_TRUNC) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 32

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 47aio02/aio_tio 0
TINFO : Running test 6

) = 47

open("file1", O_RDONLY) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

io_getevents(140468069470208, 1, 32, {...}{30, 0}) = 32

close(3) = 0

brk(0x1b2d000) = 0x1b2d000

io_destroy(140468069470208) = 0

write(1, "aio02/aio_tio 0 TINFO : Ru"..., 47aio02/aio_tio 0
TINFO : Running test 7

) = 47

open("file2", O_WRONLY|O_CREAT|O_TRUNC|O_DIRECT, 0644) = 3

io_setup(32, {140468069470208}) = 0

brk(0x1b5d000) = 0x1b5d000

brk(0x1b8d000) = 0x1b8d000

brk(0x1bae000) = 0x1bae000

brk(0x1bde000) = 0x1bde000

brk(0x1c0e000) = 0x1c0e000

brk(0x1c2f000) = 0x1c2f000

brk(0x1c5f000) = 0x1c5f000

brk(0x1c8f000) = 0x1c8f000

brk(0x1cb0000) = 0x1cb0000

brk(0x1ce0000) = 0x1ce0000

brk(0x1d10000) = 0x1d10000

brk(0x1d31000) = 0x1d31000

io_submit(140468069470208, 32, {...}) = 32

write(1, "aio02/aio_tio 0 TINFO : my"..., 50aio02/aio_tio 0
TINFO : myctx = 1164054528l

) = 50

io_submit(140468069470208, 1, {...}) = -1 EINVAL (Invalid argument)

write(2, "io_fsync write: Invalid argument"..., 33io_fsync write:
Invalid argument

) = 33

Could you please suggest me some pointer .

Thanks!

Nitin

Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended
for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded
to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly
prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete this mail from your records.

[-- Attachment #1.2: Type: text/html, Size: 43609 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]