Skip to content

[clang] pch-related test failures: fatal error: file './module.modulemap' has been modified since the module file '...' w as built: content changed #96379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mgorny opened this issue Jun 22, 2024 · 4 comments
Labels
clang:modules C++20 modules and Clang Header Modules

Comments

@mgorny
Copy link
Member

mgorny commented Jun 22, 2024

I'm guessing multiple tests are using the same output file and therefore there's some race condition there:

FAIL: Clang :: Modules/implicit-module-no-timestamp.cpp (12696 of 19835)
******************** TEST 'Clang :: Modules/implicit-module-no-timestamp.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 2: split-file /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/implicit-module-no-timestamp.cpp /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ split-file /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/implicit-module-no-timestamp.cpp /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 3: cd /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ cd /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 5: cp a1.h a.h
+ cp a1.h a.h
RUN: at line 6: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp test1.cpp
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp test1.cpp
test1.cpp:1:2: fatal error: file './module.modulemap' has been modified since the module file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp/3RPMK39W91IAT/a-2ZILJK6X9KN22.pcm' was built: content changed
    1 | #include "a.h"
      |  ^
test1.cpp:1:2: note: please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp/3RPMK39W91IAT/a-2ZILJK6X9KN22.pcm'
1 error generated.

--

********************
FAIL: Clang :: Modules/validate-file-content.m (13152 of 19835)
******************** TEST 'Clang :: Modules/validate-file-content.m' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 4: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -fmodules -fsyntax-only -fmodules-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -### 2>&1 | /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m
+ /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -fmodules -fsyntax-only -fmodules-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -###
RUN: at line 8: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
RUN: at line 9: mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
+ mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
RUN: at line 10: echo '// m.h' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
+ echo '// m.h'
RUN: at line 11: echo '#include "m.h"' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h
+ echo '#include "m.h"'
RUN: at line 12: echo 'module m { header "m.h" }' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/module.modulemap
+ echo 'module m { header "m.h" }'
RUN: at line 13: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
RUN: at line 14: touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
+ touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
RUN: at line 15: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -verify -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -verify -fvalidate-ast-input-files-content
error: no expected directives found: consider use of 'expected-no-diagnostics'
error: 'expected-error' diagnostics seen but not expected: 
  (frontend): file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h' has been modified since the precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch' was built: content changed
error: 'expected-note' diagnostics seen but not expected: 
  (frontend): '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h' required by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache/294COQL714QJ5/m-3JATOK4LPVBAZ.pcm'
  (frontend): '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache/294COQL714QJ5/m-3JATOK4LPVBAZ.pcm' required by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
  (frontend): please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
  (frontend): imported by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
6 errors generated.

--

********************
FAIL: Clang :: PCH/validate-file-content.m (14854 of 19835)
******************** TEST 'Clang :: PCH/validate-file-content.m' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 4: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -x objective-c-header -fsyntax-only -fpch-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -### 2>&1 | /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -x objective-c-header -fsyntax-only -fpch-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -###
+ /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m
RUN: at line 8: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
RUN: at line 9: mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
+ mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
RUN: at line 10: echo '// m.h' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
+ echo '// m.h'
RUN: at line 11: echo '#include "m.h"' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h
+ echo '#include "m.h"'
RUN: at line 12: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
RUN: at line 13: touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
+ touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
RUN: at line 14: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -verify -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -verify -fvalidate-ast-input-files-content
error: no expected directives found: consider use of 'expected-no-diagnostics'
error: 'expected-error' diagnostics seen but not expected: 
  (frontend): file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h' has been modified since the precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch' was built: content changed
error: 'expected-note' diagnostics seen but not expected: 
  (frontend): please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch'
3 errors generated.

--

********************
@mgorny mgorny added the clang Clang issues not falling into any other category label Jun 22, 2024
@mgorny mgorny changed the title [clang] pch-related test failures (race condition?): fatal error: file './module.modulemap' has been modified since the module file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp/3RPMK39W91IAT/a-2ZILJK6X9KN22.pcm' w as built: content changed [clang] pch-related test failures (race condition?): fatal error: file './module.modulemap' has been modified since the module file '...' w as built: content changed Jun 22, 2024
@mgorny mgorny added the clang:modules C++20 modules and Clang Header Modules label Jun 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 22, 2024

@llvm/issue-subscribers-clang-modules

Author: Michał Górny (mgorny)

I'm guessing multiple tests are using the same output file and therefore there's some race condition there:
FAIL: Clang :: Modules/implicit-module-no-timestamp.cpp (12696 of 19835)
******************** TEST 'Clang :: Modules/implicit-module-no-timestamp.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 2: split-file /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/implicit-module-no-timestamp.cpp /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ split-file /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/implicit-module-no-timestamp.cpp /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 3: cd /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
+ cd /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp
RUN: at line 5: cp a1.h a.h
+ cp a1.h a.h
RUN: at line 6: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp test1.cpp
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fmodules -fvalidate-ast-input-files-content -fno-pch-timestamp -fmodule-map-file=module.modulemap -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp test1.cpp
test1.cpp:1:2: fatal error: file './module.modulemap' has been modified since the module file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp/3RPMK39W91IAT/a-2ZILJK6X9KN22.pcm' was built: content changed
    1 | #include "a.h"
      |  ^
test1.cpp:1:2: note: please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/implicit-module-no-timestamp.cpp.tmp/3RPMK39W91IAT/a-2ZILJK6X9KN22.pcm'
1 error generated.

--

********************
FAIL: Clang :: Modules/validate-file-content.m (13152 of 19835)
******************** TEST 'Clang :: Modules/validate-file-content.m' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 4: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -fmodules -fsyntax-only -fmodules-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -### 2>&1 | /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m
+ /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -fmodules -fsyntax-only -fmodules-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -###
RUN: at line 8: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
RUN: at line 9: mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
+ mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp
RUN: at line 10: echo '// m.h' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
+ echo '// m.h'
RUN: at line 11: echo '#include "m.h"' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h
+ echo '#include "m.h"'
RUN: at line 12: echo 'module m { header "m.h" }' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/module.modulemap
+ echo 'module m { header "m.h" }'
RUN: at line 13: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
RUN: at line 14: touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
+ touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h
RUN: at line 15: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -verify -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -fmodules-cache-path=/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache -fmodules -fimplicit-module-maps -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/Modules/validate-file-content.m -verify -fvalidate-ast-input-files-content
error: no expected directives found: consider use of 'expected-no-diagnostics'
error: 'expected-error' diagnostics seen but not expected: 
  (frontend): file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h' has been modified since the precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch' was built: content changed
error: 'expected-note' diagnostics seen but not expected: 
  (frontend): '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/m.h' required by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache/294COQL714QJ5/m-3JATOK4LPVBAZ.pcm'
  (frontend): '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/cache/294COQL714QJ5/m-3JATOK4LPVBAZ.pcm' required by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
  (frontend): please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
  (frontend): imported by '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/Modules/Output/validate-file-content.m.tmp/a.pch'
6 errors generated.

--

********************
FAIL: Clang :: PCH/validate-file-content.m (14854 of 19835)
******************** TEST 'Clang :: PCH/validate-file-content.m' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 4: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -x objective-c-header -fsyntax-only -fpch-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -### 2>&1 | /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -x objective-c-header -fsyntax-only -fpch-validate-input-files-content /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -###
+ /usr/lib/llvm/19/bin/FileCheck --check-prefix=CHECK-CC1 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m
RUN: at line 8: rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
+ rm -rf /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
RUN: at line 9: mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
+ mkdir /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp
RUN: at line 10: echo '// m.h' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
+ echo '// m.h'
RUN: at line 11: echo '#include "m.h"' > /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h
+ echo '#include "m.h"'
RUN: at line 12: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -emit-pch -o /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -x objective-c-header /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.h -fvalidate-ast-input-files-content
RUN: at line 13: touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
+ touch -m -a -t 202901010000 /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h
RUN: at line 14: /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -verify -fvalidate-ast-input-files-content
+ /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/19/include -nostdsysteminc -fsyntax-only -I /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp -include-pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch /var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/clang/test/PCH/validate-file-content.m -verify -fvalidate-ast-input-files-content
error: no expected directives found: consider use of 'expected-no-diagnostics'
error: 'expected-error' diagnostics seen but not expected: 
  (frontend): file '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/m.h' has been modified since the precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch' was built: content changed
error: 'expected-note' diagnostics seen but not expected: 
  (frontend): please rebuild precompiled header '/var/tmp/portage/sys-devel/clang-19.0.0_pre20240622/work/x/y/clang-abi_x86_32.x86/test/PCH/Output/validate-file-content.m.tmp/a.pch'
3 errors generated.

--

********************

@mgorny
Copy link
Member Author

mgorny commented Jun 22, 2024

Full log: llvm.txt.gz

@mgorny
Copy link
Member Author

mgorny commented Jun 22, 2024

I was able to reproduce it multiple times in a row, so this doesn't seem like a random fluke. I'm going to try bisecting it.

@EugeneZelenko EugeneZelenko removed the clang Clang issues not falling into any other category label Jun 22, 2024
@mgorny mgorny changed the title [clang] pch-related test failures (race condition?): fatal error: file './module.modulemap' has been modified since the module file '...' w as built: content changed [clang] pch-related test failures: fatal error: file './module.modulemap' has been modified since the module file '...' w as built: content changed Jun 22, 2024
@mgorny
Copy link
Member Author

mgorny commented Jun 22, 2024

Bisect points to:

commit 874dcaea09171100de02fa6d5c0af0669aea900f
Author:     Fangrui Song <[email protected]>
AuthorDate: 2024-06-21 08:53:07 +0200
Commit:     GitHub <[email protected]>
CommitDate: 2024-06-21 08:53:07 +0200

    [Serialization] Use stable hash functions
    
    clangSerialization currently uses hash_combine/hash_value from
    Hashing.h, which are not guaranteed to be deterministic.
    Replace these uses with xxh3_64bits.
    
    Pull Request: https://github.com/llvm/llvm-project/pull/96136

 clang/lib/AST/ODRHash.cpp             |  2 +-
 clang/lib/Serialization/ASTReader.cpp | 10 ++++++----
 clang/lib/Serialization/ASTWriter.cpp |  7 +++++--
 llvm/include/llvm/ADT/FoldingSet.h    | 23 +++++++++++++++++++----
 4 files changed, 31 insertions(+), 11 deletions(-)

CC @MaskRay

This might actually be a bug on 32-bit arches, I'm trying pure 64-bit now.

AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this issue Jul 9, 2024
https://reviews.llvm.org/D67249 added content hash (see
-fvalidate-ast-input-files-content) using llvm::hash_code (size_t).
The hash value is 32-bit on 32-bit systems, which was unintentional.

Fix llvm#96379: llvm#96136 switched the hash function to xxh3_64bit but did not
update the ContentHash type, leading to mismatch between ASTReader and
ASTWriter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:modules C++20 modules and Clang Header Modules
Projects
None yet
Development

No branches or pull requests

3 participants