Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 674088

Summary: sys-devel/llvm-6.0.1, 7.0.1 test failure: Support/./SupportTests/FileSystemTest.RealPath
Product: Gentoo Linux Reporter: Alexey <alexey+gentoo>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: UNCONFIRMED ---    
Severity: normal CC: dev-portage, mgorny
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.llvm.org/show_bug.cgi?id=40274
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build.log.bz2
7.0.1 build.log.bz2

Description Alexey 2018-12-30 14:28:29 UTC
Created attachment 558992 [details]
emerge --info

Similar to https://bugs.gentoo.org/show_bug.cgi?id=649994 but for the current stable version.
Comment 1 Alexey 2018-12-30 14:29:46 UTC
Created attachment 558996 [details]
build.log.bz2
Comment 2 Alexey 2018-12-30 16:35:37 UTC
The same error with 7.0.1, and one more error there:

FAIL: LLVM-Unit :: Support/./SupportTests/FileSystemTest.RealPath (2387 of 27005)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/FileSystemTest.RealPath' FAILED ********************
Note: Google Test filter = FileSystemTest.RealPath
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from FileSystemTest
[ RUN      ] FileSystemTest.RealPath
/mnt/ssdhome/portage-tmp/portage/sys-devel/llvm-7.0.1/work/llvm-7.0.1.src/unittests/Support/Path.cpp:550: Failure
fs::real_path(HomeDir, Expected): did not return errc::success.
error number: 2
error message: No such file or directory

/mnt/ssdhome/portage-tmp/portage/sys-devel/llvm-7.0.1/work/llvm-7.0.1.src/unittests/Support/Path.cpp:469: Failure
fs::remove(TestDirectory.str()): did not return errc::success.
error number: 39
error message: Directory not empty

[  FAILED  ] FileSystemTest.RealPath (5 ms)
[----------] 1 test from FileSystemTest (5 ms total)

...

FAIL: LLVM-Unit :: Support/./SupportTests/JSONTest.Integers (2433 of 27005)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/JSONTest.Integers' FAILED ********************
Note: Google Test filter = JSONTest.Integers
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from JSONTest
[ RUN      ] JSONTest.Integers
/mnt/ssdhome/portage-tmp/portage/sys-devel/llvm-7.0.1/work/llvm-7.0.1.src/unittests/Support/JSONTest.cpp:320: Failure
      Expected: T.Val
      Which is: 4611686018427387905
To be equal to: *Doc
      Which is: 4611686018427387905
Integer, not exact double. Stored as int64, convertible.
/mnt/ssdhome/portage-tmp/portage/sys-devel/llvm-7.0.1/work/llvm-7.0.1.src/unittests/Support/JSONTest.cpp:320: Failure
      Expected: T.Val
      Which is: -4611686018427387905
To be equal to: *Doc
      Which is: -4611686018427387905
Negative integer, not exact double. Stored as int64, convertible.
[  FAILED  ] JSONTest.Integers (1 ms)
[----------] 1 test from JSONTest (1 ms total)
Comment 3 Alexey 2018-12-30 16:36:12 UTC
Created attachment 559018 [details]
7.0.1 build.log.bz2
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 17:34:40 UTC
What's the filesystem type used for $PORTAGE_TMPDIR?
Comment 5 Alexey 2018-12-30 17:37:07 UTC
tmpfs

$ cat /etc/fstab|grep portage
none /mnt/portagetmp tmpfs size=16G,noatime 0 0
Comment 6 Alexey 2018-12-30 17:42:16 UTC
Oops, no, sorry. It's ext4.

$ cat /etc/portage/env/notmpfs.conf
PORTAGE_TMPDIR="/mnt/ssdhome/portage-tmp"

$ cat /etc/portage/package.env/x | grep llvm
sys-devel/llvm notmpfs.conf
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 18:22:51 UTC
Ok, my guess for the first error is that home directory of 'portage' user does not exist.  Could you verify whether that is the case?

The JSON test is going to be harder to debug.  If you have some spare computing power, you may try upgrading to gcc-7.4.0 and retrying.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 18:32:15 UTC
(In reply to Michał Górny from comment #7)
> Ok, my guess for the first error is that home directory of 'portage' user
> does not exist.  Could you verify whether that is the case?
> 

Hmm but it should respect the ${HOME} override, so I don't think it could actually not exist.  Do you have a build-dir present still?  I think it might be useful to run the test executables manually and see if the first one fails as different users, and possibly with $HOME set to different values.  You may also try looking into it via gdb, if you feel like trying.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 20:17:04 UTC
Ok, so it seems that non-existing homedir is the problem indeed.  It seems that for some reason the test spawned by llvm-lit doesn't get ${HOME} from environment; if I call the test executable directly with HOME set, it works fine.
Comment 10 Alexey 2018-12-30 20:23:42 UTC
/var/tmp/portage which is $HOME for 'portage' user does not exist indeed.

> Do you have a build-dir present still?

No, but I was just rebuilding it to test it, when I saw your last post. I guess that's not necessary anymore, but I'll let it finish for now...

> you may try upgrading to gcc-7.4.0

I can try later. When gcc-7.4.0 is going to stabilize?
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 20:47:56 UTC
https://reviews.llvm.org/D56162 is for the path test failure.

(In reply to Alexey from comment #10)
> > you may try upgrading to gcc-7.4.0
> 
> I can try later. When gcc-7.4.0 is going to stabilize?

I'm sorry but i don't know that.  However, I'm going to try to reproduce the other issue anyway.
Comment 12 Alexey 2018-12-30 21:02:47 UTC
Thanks for the fix!
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-30 21:21:35 UTC
Sadly, I have no idea how to reproduce that JSON error.  Could you maybe try lowering -march=, e.g. to -march=x86-64?
Comment 14 Alexey 2018-12-31 10:44:26 UTC
Changing -march=bdver2 to -march=x86-64 didn't have any effect wrt JSON.
But compiling llvm-7.0.1 with clang-6.0.1 fixes the JSON issue, even with -march=bdver2.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-31 13:52:28 UTC
@dev-portage, do you think Portage should complain when pw_home does not exist?
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-31 16:21:34 UTC
I've been able to reproduce the JSON issue with gcc 7.3.0 and 7.4.0 (but not 6.4.0).  Apparently it occurs only with -O2, so it looks like new gcc optimization breaking something.
Comment 17 Zac Medico gentoo-dev 2018-12-31 23:32:47 UTC
(In reply to Michał Górny from comment #15)
> @dev-portage, do you think Portage should complain when pw_home does not
> exist?

Yes, filed as bug 674212.