Skip to contentSkip to conversation

open12 failing on i386 with EOVERFLOW

LTP Jan Stancek 2 participants 5 messages Aug 20, 2014 – Aug 21, 2014 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

I'm seeing following failure in this testcase on RHEL-6.5 Server i386 GA distro:

# env PATH=`pwd`:$PATH ./open12
open12      1  TFAIL  :  open12.c:104: test O_APPEND for open failed
open12      2  TCONF  :  open12.c:123: test O_NOATIME flag for open needs filesystems which is mounted without noatime and relatime
open12      3  TPASS  :  test O_CLOEXEC for open success
open12      4  TPASS  :  test O_LARGEFILE for open success
open12      0  TWARN  :  tst_tmpdir.c:206: tst_rmdir: rmobj(/tmp/opexIqjV3) failed: lstat(/tmp/opexIqjV3/large_file) failed; errno=75: Value too large for defined data type

Since it's linked from library, adding -D_FILE_OFFSET_BITS=64 to this testcase has no effect.

One simple way to fix it would be to unlink it in test, so that rmobj.c doesn't hit it.

$ diff -u open12.c /tmp/open12.c 
--- open12.c	2014-08-14 17:46:33.052044613 +0200
+++ /tmp/open12.c	2014-08-20 14:48:35.655208417 +0200
@@ -221,6 +221,10 @@
 		tst_resm(TPASS, "test O_LARGEFILE for open success");
 		SAFE_CLOSE(cleanup, TEST_RETURN);
 	}
+
+	/* clean it up here, because lib/rmobj.c on 32bit will
+	 * hit EOVERFLOW in lstat() */
+	unlink(LARGE_FILE);
 }

static void cleanup(void)

Any thoughts?

Regards,
Jan

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

----- Original Message -----

Quoted 10 lines

From: "Jan Stancek" <[email protected]>
To: "ltp-list" <[email protected]>
Sent: Wednesday, 20 August, 2014 2:53:26 PM
Subject: [LTP] open12 failing on i386 with EOVERFLOW

Hi,

I'm seeing following failure in this testcase on RHEL-6.5 Server i386 GA distro:

Quoted 10 lines
# env PATH=`pwd`:$PATH ./open12
open12      1  TFAIL  :  open12.c:104: test O_APPEND for open failed
open12      2  TCONF  :  open12.c:123: test O_NOATIME flag for open needs
filesystems which is mounted without noatime and relatime
open12      3  TPASS  :  test O_CLOEXEC for open success
open12      4  TPASS  :  test O_LARGEFILE for open success
open12      0  TWARN  :  tst_tmpdir.c:206: tst_rmdir: rmobj(/tmp/opexIqjV3)
failed: lstat(/tmp/opexIqjV3/large_file) failed; errno=75: Value too large
for defined data type

Same issue in openat02:

# env PATH=`pwd`:$PATH ./openat02
openat02    1  TPASS  :  test O_APPEND for openat success
openat02    2  TPASS  :  test O_CLOEXEC for openat success
openat02    3  TPASS  :  test O_LARGEFILE for openat success
openat02    4  TCONF  :  openat02.c:242: test O_NOATIME flag for openat needs filesystems which are mounted without noatime and relatime
openat02    5  TPASS  :  test O_NOFOLLOW for openat success
openat02    6  TPASS  :  test O_TRUNC for openat success
openat02    0  TWARN  :  tst_tmpdir.c:206: tst_rmdir: rmobj(/tmp/opeim4IKK) failed: lstat(/tmp/opeim4IKK/large_file) failed; errno=75: Value too large for defined data type
Quoted 27 lines

Since it's linked from library, adding -D_FILE_OFFSET_BITS=64 to this testcase has
no effect.

One simple way to fix it would be to unlink it in test, so that rmobj.c doesn't hit it.

$ diff -u open12.c /tmp/open12.c
tmp/open12.c renamed from open12.c +4 -0
@@ -221,6 +221,10 @@
 		tst_resm(TPASS, "test O_LARGEFILE for open success");
 		SAFE_CLOSE(cleanup, TEST_RETURN);
 	}
+
+	/* clean it up here, because lib/rmobj.c on 32bit will
+	 * hit EOVERFLOW in lstat() */
+	unlink(LARGE_FILE);
 }
 
 static void cleanup(void)

Any thoughts?

Regards,
Jan

Quoted 9 lines

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to Jan Stancek

Hi!

Quoted 7 lines
# env PATH=`pwd`:$PATH ./open12
open12      1  TFAIL  :  open12.c:104: test O_APPEND for open failed
open12      2  TCONF  :  open12.c:123: test O_NOATIME flag for open needs filesystems which is mounted without noatime and relatime
open12      3  TPASS  :  test O_CLOEXEC for open success
open12      4  TPASS  :  test O_LARGEFILE for open success
open12      0  TWARN  :  tst_tmpdir.c:206: tst_rmdir: rmobj(/tmp/opexIqjV3) failed: lstat(/tmp/opexIqjV3/large_file) failed; errno=75: Value too large for defined data type
Quoted 5 lines

Since it's linked from library, adding -D_FILE_OFFSET_BITS=64 to this testcase has no effect.

One simple way to fix it would be to unlink it in test, so that rmobj.c doesn't hit it.

That is simple enough but I'm a bit reluctant to add the fix to each test that will test O_LARGEFILE.

Given that the only purpose of lstat() in rmobj() is to figure out if given path is a file or directory, we can try to work around this by trying to opendir() the path first and treat it like a file when we get ENOTDIR. What do you think?

Signature · 11 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Hi!

Quoted 9 lines
Quoted 7 lines

That is simple enough but I'm a bit reluctant to add the fix to each test that will test O_LARGEFILE.

Given that the only purpose of lstat() in rmobj() is to figure out if given path is a file or directory, we can try to work around this by trying to opendir() the path first and treat it like a file when we get ENOTDIR. What do you think?

I like the idea. I can try it tomorrow, unless you have patch ready.

Not yet, I've been working on enabling keyctl01 testcase that was previously wrongly disabled by configure checks.

(It looks like the TCONF propagation is starting to pay off because
it's far easier to spot and review skipped testcases.)

Signature · 11 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Hi!

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

That is simple enough but I'm a bit reluctant to add the fix to each test that will test O_LARGEFILE.

Given that the only purpose of lstat() in rmobj() is to figure out if given path is a file or directory, we can try to work around this by trying to opendir() the path first and treat it like a file when we get ENOTDIR. What do you think?

Quoted 4 lines
Quoted 1 line

I like the idea. I can try it tomorrow, unless you have patch ready.

I hit some issues with opendir() because it tries to follow symlinks, so in case of bad symlink I was getting ENOENT, in some testcases ELOOP.

Doesn't that mean that we are not dealing with a directory and should proceed with the unlink()? Or am I mistaken?

Quoted 3 lines

I posted version using plain open(O_DIRECTORY | O_NOFOLLOW,..), if you want to comment on such approach. Initial results from x86 and ppc64 looked good, so I'll run it through some more testing.

This looks good, maybe better than the original idea and given that both flags were added to kernel 2.1.126 we can just assume that these are present anywhere.

Signature · 11 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list