Skip to contentSkip to conversation

POSIX "aio_return/2-1" failed.

LTP Mitani 2 participants 7 messages Oct 8, 2010 – Oct 27, 2010

lore
Share & tools
lore

Mitani

author
#0 lore raw

Hi,

"conformance/interfaces/aio_return/2-1" failed with following message:
------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
- RHEL5.5 --- (x86, x86_64, ia64)
- RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request, after aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3) Linux Programmer's Manual
AIO_RETURN(3)

NAME
aio_return - get return status of asynchronous I/O operation

SYNOPSIS

       #include <aio.h>

       ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
The aio_return function returns the final return status for the
asynchronous I/O
request with control block pointed to by aiocbp.

This function should be called only once for any given
request, after
aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
If the asynchronous I/O operation has completed, this function
returns the value
that would have been returned in case of a synchronous read, write,
or fsync
request. Otherwise the return value is undefined. On error, the
error value is
returned.

ERRORS
EINVAL aiocbp does not point at a control block for an asynchronous
I/O request
of which the return status has not been retrieved yet.

CONFORMING TO

       POSIX 1003.1-2003

SEE ALSO

       aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_read(3),
aio_suspend(3),
       aio_write(3)

                                       2003-11-14

AIO_RETURN(3)
#
------------

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request. Otherwise the return value is undefined. On error, the error value is returned.".

It can be supposed that the return value of second "aio_return()" is undefined.
Therefore, it is not mistake that return value of the second "aio_return()" is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

How does that look?

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 84 lines · Mitani

Hi,

"conformance/interfaces/aio_return/2-1" failed with following message:
------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request,  after aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O operation

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status for the asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  any  given request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this function returns the value
      that would have been returned in case of a synchronous  read,  write, or  fsync
      request.  Otherwise the return value is undefined.  On error, the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved yet.

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO
      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_read(3), aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

Quoted 6 lines

It can be supposed that the return value of second "aio_return()" is undefined.
Therefore, it is not mistake that return value of the second "aio_return()" is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

I'll respond to this sometime in the next couple of days after I
do some more investigation on the issue.
Thanks,
-Garrett

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to Mitani
Quoted 84 lines · Mitani

Hi,

"conformance/interfaces/aio_return/2-1" failed with following message:
------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request,  after aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O operation

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status for the asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  any  given request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this function returns the value
      that would have been returned in case of a synchronous  read,  write, or  fsync
      request.  Otherwise the return value is undefined.  On error, the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved yet.

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO
      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_read(3), aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

Quoted 6 lines

It can be supposed that the return value of second "aio_return()" is undefined.
Therefore, it is not mistake that return value of the second "aio_return()" is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

No. POSIX clearly states:

"If the asynchronous I/O operation has completed, then the return status, as described for read(), write(), and fsync(), shall be returned. If the asynchronous I/O operation has not yet completed, the results of aio_return() are undefined.

If the aio_return() function fails, it shall return -1 and set errno to indicate the error."

ERRORS

"The aio_return() function may fail if:

[EINVAL]
The aiocbp argument does not refer to an asynchronous operation
whose return status has not yet been retrieved."

What the test implementers were looking to do was test out that -1
/ EINVAL were returned, and maybe that fact that they were testing was in fact implementation defined, as opposed to what's stated in the standard, as the spec doesn't state that the behavior for aio_return would be s.t. the state of the AIO stream is reset when aio_return is called.
So yes, I agree this should be fixed, but let me check with the
POSIX folks what the best course of action is.
Thanks,
-Garrett

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 110 lines · Garrett Cooper
Quoted 84 lines · Mitani

Hi,

"conformance/interfaces/aio_return/2-1" failed with following message:
------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request,  after aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O operation

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status for the asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  any  given request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this function returns the value
      that would have been returned in case of a synchronous  read,  write, or  fsync
      request.  Otherwise the return value is undefined.  On error, the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved yet.

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO
      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_read(3), aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

Quoted 6 lines

It can be supposed that the return value of second "aio_return()" is undefined.
Therefore, it is not mistake that return value of the second "aio_return()" is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

   No. POSIX clearly states:

"If the asynchronous I/O operation has completed, then the return status, as described for read(), write(), and fsync(), shall be returned. If the asynchronous I/O operation has not yet completed, the results of aio_return() are undefined.

If the aio_return() function fails, it shall return -1 and set errno to indicate the error."

ERRORS

"The aio_return() function may fail if:

[EINVAL]
   The aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved."

Quoted 8 lines

   What the test implementers were looking to do was test out that -1 / EINVAL were returned, and maybe that fact that they were testing was in fact implementation defined, as opposed to what's stated in the standard, as the spec doesn't state that the behavior for aio_return would be s.t. the state of the AIO stream is reset when aio_return is called.
   So yes, I agree this should be fixed, but let me check with the POSIX folks what the best course of action is.

I've read into this a bit more, and I think that the aio_return
testcases were written incorrectly. Please try out this testcase... if it works for you, then I'll apply necessary logic to other testcases as well.
It worked for me at least on FreeBSD.
Thanks,
-Garrett

testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c +8 -14
index bfc8e12..090387c 100644
@@ -43,8 +43,10 @@ int main(void)
 	struct aiocb aiocb;
 	int fd, retval;
 
+#if 0
 	if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L)
 		return PTS_UNSUPPORTED;
+#endif
 
 	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_return_1_1_%d", 
 		  getpid());
@@ -73,26 +75,18 @@ int main(void)
 		exit(PTS_FAIL);
 	}
 
-	do {
-		retval = aio_error(&aiocb);
-		if (retval == -1) {
-			close(fd);
-			printf(TNAME " Error at aio_error(): %s\n",
-				strerror(errno));
-			exit(PTS_FAIL);
-		}
-	} while (retval == EINPROGRESS);
-
+	while (aio_error(&aiocb) == EINPROGRESS)
+		sleep(1);
 	retval = aio_return(&aiocb);
 
-	if (retval != BUF_SIZE) {
-		close(fd);
+	if (retval == -1) {
 		printf(TNAME " Error at aio_return(): %s\n",
-		       strerror(errno));
+		       strerror(aio_error(&aiocb)));
 		exit(PTS_FAIL);
 	}
-	
+
 	close(fd);
+	printf("aio_return(&aiocb) = %d\n", retval);
 	printf("Test PASSED\n");
 	exit(PTS_PASS);
 }

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#4 lore raw
Quoted 143 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, October 21, 2010 6:42 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] POSIX "aio_return/2-1" failed.

Quoted 5 lines · Garrett Cooper
Quoted 4 lines · Mitani

Hi,

"conformance/interfaces/aio_return/2-1" failed with following

message:

Quoted 33 lines
Quoted 33 lines

------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request, after
aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O operation

Quoted 7 lines
Quoted 7 lines

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status for

the

Quoted 4 lines
Quoted 4 lines

asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  an

y  given

Quoted 5 lines
Quoted 5 lines

request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this

function

Quoted 2 lines
Quoted 2 lines

returns the value
      that would have been returned in case of a

synchronous  read,

Quoted 2 lines
Quoted 2 lines

write, or  fsync
      request.  Otherwise the return value is undefined.  On

error,

Quoted 7 lines
Quoted 7 lines

the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved

yet.

Quoted 6 lines
Quoted 6 lines

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO
      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_r

ead(3),

Quoted 8 lines
Quoted 8 lines

aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

Quoted 8 lines
Quoted 8 lines

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

It can be supposed that the return value of second "aio_return()"

is

Quoted 2 lines
Quoted 2 lines

undefined.
Therefore, it is not mistake that return value of the second

"aio_return()"

Quoted 9 lines
Quoted 3 lines

is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

   No. POSIX clearly states:

"If the asynchronous I/O operation has completed, then the return status, as described for read(), write(), and fsync(), shall be returned. If the asynchronous I/O operation has not yet completed,

the

Quoted 7 lines

results of aio_return() are undefined.

If the aio_return() function fails, it shall return -1 and set errno to indicate the error."

ERRORS

Quoted 7 lines

"The aio_return() function may fail if:

[EINVAL]
   The aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved."

   What the test implementers were looking to do was test out that

-1

Quoted 1 line

/ EINVAL were returned, and maybe that fact that they were testing

was

Quoted 3 lines

in fact implementation defined, as opposed to what's stated in the standard, as the spec doesn't state that the behavior for aio_return would be s.t. the state of the AIO stream is reset when aio_return

is

Quoted 3 lines

called.
   So yes, I agree this should be fixed, but let me check with the POSIX folks what the best course of action is.

Quoted 7 lines

I've read into this a bit more, and I think that the aio_return
testcases were written incorrectly. Please try out this testcase... if it works for you, then I'll apply necessary logic to other testcases as well.
It worked for me at least on FreeBSD.
Thanks,
-Garrett

I confirmed that your revision worked in my environment.
I also look forward to other testcases (2-1, 3-2, 4-1) being revised.

Thank you--

-Tomonori Mitani

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw
Quoted 152 lines · Mitani
Quoted 143 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, October 21, 2010 6:42 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] POSIX "aio_return/2-1" failed.

Quoted 5 lines · Garrett Cooper
Quoted 4 lines · Mitani

Hi,

"conformance/interfaces/aio_return/2-1" failed with following

message:

Quoted 33 lines
Quoted 33 lines

------------
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1 : 111
------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request, after
aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O operation

Quoted 7 lines
Quoted 7 lines

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status for

the

Quoted 4 lines
Quoted 4 lines

asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  an

y  given

Quoted 5 lines
Quoted 5 lines

request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this

function

Quoted 2 lines
Quoted 2 lines

returns the value
      that would have been returned in case of a

synchronous  read,

Quoted 2 lines
Quoted 2 lines

write, or  fsync
      request.  Otherwise the return value is undefined.  On

error,

Quoted 7 lines
Quoted 7 lines

the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved

yet.

Quoted 6 lines
Quoted 6 lines

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO
      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_r

ead(3),

Quoted 8 lines
Quoted 8 lines

aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

Quoted 8 lines
Quoted 8 lines

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

It can be supposed that the return value of second "aio_return()"

is

Quoted 2 lines
Quoted 2 lines

undefined.
Therefore, it is not mistake that return value of the second

"aio_return()"

Quoted 9 lines
Quoted 3 lines

is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

   No. POSIX clearly states:

"If the asynchronous I/O operation has completed, then the return status, as described for read(), write(), and fsync(), shall be returned. If the asynchronous I/O operation has not yet completed,

the

Quoted 7 lines

results of aio_return() are undefined.

If the aio_return() function fails, it shall return -1 and set errno to indicate the error."

ERRORS

Quoted 7 lines

"The aio_return() function may fail if:

[EINVAL]
   The aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved."

   What the test implementers were looking to do was test out that

-1

Quoted 1 line

/ EINVAL were returned, and maybe that fact that they were testing

was

Quoted 3 lines

in fact implementation defined, as opposed to what's stated in the standard, as the spec doesn't state that the behavior for aio_return would be s.t. the state of the AIO stream is reset when aio_return

is

Quoted 3 lines

called.
   So yes, I agree this should be fixed, but let me check with the POSIX folks what the best course of action is.

Quoted 7 lines

    I've read into this a bit more, and I think that the aio_return testcases were written incorrectly. Please try out this testcase... if it works for you, then I'll apply necessary logic to other testcases as well.
    It worked for me at least on FreeBSD.
Thanks,
-Garrett

Quoted 2 lines

I confirmed that your revision worked in my environment.
I also look forward to other testcases (2-1, 3-2, 4-1) being revised.

Please update your git, rebuild, and test :).
Let me know if you run into any issues.
Cheers,
-Garrett

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#6 lore raw
Quoted 173 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, October 21, 2010 9:00 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] POSIX "aio_return/2-1" failed.

Quoted 9 lines · Mitani
Quoted 9 lines

-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Thursday, October 21, 2010 6:42 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] POSIX "aio_return/2-1" failed.

On Mon, Oct 18, 2010 at 5:00 AM, Garrett Cooper <[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines · Mitani
Quoted 4 lines

Hi,

"conformance/interfaces/aio_return/2-1" failed with following

message:

Quoted 2 lines
Quoted 2 lines

------------
conformance/interfaces/aio_return/2-1: execution: FAILED:

Output:

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

aio_return/2-1.c Second call to aio_return() should return -1 :

111

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

------------

Same problem occurs in "aio_return/3-2.c" and "aio_return/4-1".

Environment is as follows:
 - RHEL5.5 --- (x86, x86_64, ia64)
 - RHEL4.8 --- (x86, x86_64, ia64)

This testset seems to be the error root test for "aio_return()".

First "aio_return()" returned with 111. This return value is the length of buffer of "aio_write()".
But second "aio_return()" returned with 111, too. It's unexpected result for this test set.
Therefore, this test failed.

Man page says that
"This function should be called only once for any given request, after
aio_error(2) returns something other than EINPROGRESS.":
------------
# LANG=C man 3 aio_return

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

AIO_RETURN(3)                  Linux Programmer's Manual AIO_RETURN(3)

NAME
      aio_return - get return status of asynchronous I/O

operation

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

SYNOPSIS
      #include <aio.h>

      ssize_t aio_return(struct aiocb *aiocbp);

DESCRIPTION
      The aio_return function returns the final return status

for

Quoted 61 lines
Quoted 61 lines

the

Quoted 3 lines
Quoted 3 lines

asynchronous I/O
      request with control block pointed to by aiocbp.

      This  function  should  be  called  only  once  for  an y  given

Quoted 5 lines
Quoted 5 lines

request,  after
      aio_error(2) returns something other than EINPROGRESS.

RETURN VALUE
      If the asynchronous I/O operation has completed, this

function

Quoted 2 lines
Quoted 2 lines

returns the value
      that would have been returned in case of a

synchronous  read,

Quoted 2 lines
Quoted 2 lines

write, or  fsync
      request.  Otherwise the return value is undefined.  On

error,

Quoted 7 lines
Quoted 7 lines

the error value is
      returned.

ERRORS
      EINVAL aiocbp does not point at a control block for an asynchronous I/O  request
             of which the return status has not been retrieved

yet.

Quoted 5 lines
Quoted 5 lines

CONFORMING TO
      POSIX 1003.1-2003

SEE ALSO

      aio_cancel(3),    aio_error(3),   aio_fsync(3),   aio_r ead(3),

Quoted 8 lines
Quoted 8 lines

aio_suspend(3),
      aio_write(3)

                                      2003-11-14
AIO_RETURN(3)
#
------------

Quoted 8 lines
Quoted 8 lines

And, it says that
"If the asynchronous I/O operation has completed, this function returns the value that would have been returned in case of a synchronous read, write, or fsync request.  Otherwise the return value is undefined.  On error, the error value is returned.".

It can be supposed that the return value of second "aio_return()"

is

Quoted 2 lines
Quoted 2 lines

undefined.
Therefore, it is not mistake that return value of the second

"aio_return()"

Quoted 6 lines
Quoted 3 lines

is one at success, I think.
And, I think that "UNTESTED" or "UNRESOLVED" may be is more appropriate for this test.

   No. POSIX clearly states:

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

"If the asynchronous I/O operation has completed, then the return status, as described for read(), write(), and fsync(), shall be returned. If the asynchronous I/O operation has not yet completed,

the

Quoted 3 lines

results of aio_return() are undefined.

If the aio_return() function fails, it shall return -1 and set

errno

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

to indicate the error."

ERRORS

"The aio_return() function may fail if:

[EINVAL]
   The aiocbp argument does not refer to an asynchronous

operation

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

whose return status has not yet been retrieved."

   What the test implementers were looking to do was test out

that

Quoted 4 lines
Quoted 4 lines

-1

Quoted 1 line

/ EINVAL were returned, and maybe that fact that they were testing

was

Quoted 1 line

in fact implementation defined, as opposed to what's stated in

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

standard, as the spec doesn't state that the behavior for

aio_return

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

would be s.t. the state of the AIO stream is reset when aio_return

is

Quoted 2 lines

called.
   So yes, I agree this should be fixed, but let me check with

the

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

POSIX folks what the best course of action is.

    I've read into this a bit more, and I think that the aio_return testcases were written incorrectly. Please try out this testcase... if it works for you, then I'll apply necessary logic to other

testcases

Quoted 6 lines
Quoted 4 lines

as well.
    It worked for me at least on FreeBSD.
Thanks,
-Garrett

Quoted 7 lines
Quoted 2 lines

I confirmed that your revision worked in my environment.
I also look forward to other testcases (2-1, 3-2, 4-1) being revised.

Please update your git, rebuild, and test :).
Let me know if you run into any issues.
Cheers,
-Garrett

I tried to run "aio_return" tests, but some of them failed with following message:
------------
conformance/interfaces/aio_return/3-2: execution: FAILED: Output:
aio_return/3-2.c aio_return() should fail with (-1, 22); failed with (4096,
0) instead
conformance/interfaces/aio_return/2-1: execution: FAILED: Output:
aio_return/2-1.c Second call to aio_return() should return -1; aio_return() returned 111
------------

Environment is as follows:
- RHEL4.8 --- (x86, x86_64, ia64)
- RHEL5.5 --- (x86, x86_64, ia64)
- kernel --- kernel-2.6.9-89.EL
- glibc --- glibc-2.3.4-2.43

The reason of above failures is that second "aio_return()" doesn't return "-1".

The manpage of "aio_return()" of "FreeBSD 9-current" says:
--------------------
RETURN VALUES
If the asynchronous I/O request has completed, the status is returned
as
described in read(2), write(2), or fsync(2). Otherwise, aio_return() returns -1 and sets errno to indicate the error condition.
--------------------
http://www.freebsd.org/cgi/man.cgi?query=aio_return&apropos=0&sektion=0&manp
ath=FreeBSD+9-current&format=html

On the other hand, the manpage of RHEL4.8/RHEL5.5 says:
--------------------
RETURN VALUE
If the asynchronous I/O operation has completed, this function
returns
the value that would have been returned in case of a synchronous
read,
write, or fsync request. Otherwise the return value is undefined.
On
error, the error value is returned.
--------------------

According to this manual, the return value may not be "-1" in Redhat systems.
Perhaps "aio_return()" doesn't have guarantee to return "-1" even in other Linux systems, I think.

Regards--

-Tomonori Mitani

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list