Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415475 - sys-apps/sandbox should not unnecessarily call readlink (breaks some testsuites)
Summary: sys-apps/sandbox should not unnecessarily call readlink (breaks some testsuites)
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
: 423583 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-11 13:54 UTC by Marien Zwart (RETIRED)
Modified: 2015-09-28 20:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Do not resolve paths unnecessarily. (sandbox-2.5-times.patch,497 bytes, text/plain)
2012-05-11 13:54 UTC, Marien Zwart (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marien Zwart (RETIRED) gentoo-dev 2012-05-11 13:54:41 UTC
Created attachment 311427 [details]
Do not resolve paths unnecessarily.

When utimensat is called on a symlink with AT_SYMLINK_NOFOLLOW set sandbox calls realpath on the symlink. This subtly changes behavior: it updates the atime of the symlink when utimensat itself might not. Specifically it causes the testsuite of many packages that use gnulib to fail. Its testsuite does this (leaving out a few steps irrelevant to this problem):

- Create a symlink to a nonexistant file
- lstat it and remember the result
- sleep a few milliseconds
- call utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW) with "times" invalid
- lstat the symlink again, and assert atime is unchanged.

The attached patch seems to fix this, but I'm not exactly familiar with the sandbox code, so I might have broken something else.
Comment 1 SpanKY gentoo-dev 2012-12-25 00:01:09 UTC
can you provide a specific package that fails its testsuite due to this ?  i'm having a hard time putting together a test case that reproduces the bug for the sandbox testsuite.
Comment 2 Marien Zwart (RETIRED) gentoo-dev 2013-02-11 09:16:00 UTC
Gee, it sure would've been smart of me to include that piece of information when I filed this.

sys-apps/coreutils-8.20-r2 is affected (I see some other failures there too, but I believe this bug causes test-fdutimensat and test-utimensat in gnulib-tests to fail). Either run the entire ebuild or compare "make check" and "sandbox make check" in the gnulib-tests subdir after running ./configure && make in the root.
Comment 3 SpanKY gentoo-dev 2015-09-28 20:18:33 UTC
thanks ... there were a few nuances in my test case attempt that i missed.
i looked at the coreutils gnulib tests and was able to work out the bugs.

pushed now in master and will be in sandbox-2.10:
http://gitweb.gentoo.org/proj/sandbox.git/commit/?id=4377a68df2a20cda06aadb58c179ce2e8d78f7cd
Comment 4 SpanKY gentoo-dev 2015-09-28 20:19:32 UTC
*** Bug 423583 has been marked as a duplicate of this bug. ***