online-judge-tools / verification-helper

a testing framework for snippet libraries used in competitive programming
MIT License
225 stars 54 forks source link

oj-verify print too long source #380

Closed yosupo06 closed 3 years ago

yosupo06 commented 3 years ago

Summary / 概要

手元でoj-verify runを実行すると数万行の出力が出てきます。

Steps to reproduce / 再現方法

  1. https://github.com/yosupo06/yosupo-libraryfeature/oj branchを手元にclone、トップでoj-verify runを実行

environments:

$ oj --version
online-judge-tools 11.1.3 (+ online-judge-api-client 10.8.0)
$ pip3 list | grep online
online-judge-api-client    10.8.0
online-judge-tools         11.1.3
online-judge-verify-helper 5.5.2

Expected behavior / 期待される挙動

Actual behavior / 実際の挙動

INFO:onlinejudge_verify.config:no config file
WARNING:onlinejudge_verify.verify:failed to increase the stack size
INFO:onlinejudge_verify.verify:verify: test-oj/aplusb.test.cpp
clang: warning: -Wl,-stack_size,0x10000000: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -Wl,-stack_size,0x10000000: 'linker' input unused [-Wunused-command-line-argument]
INFO:onlinejudge.dispatch:problem recognized: LibraryCheckerProblem.from_url('https://judge.yosupo.jp/problem/many_aplusb'): https://judge.yosupo.jp/problem/many_aplusb
INFO:onlinejudge_verify.verify:problem: https://judge.yosupo.jp/problem/many_aplusb
INFO:onlinejudge_verify.verify:$ sleep 2
INFO:onlinejudge_verify.verify:$ oj download --system -d .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test --silent https://judge.yosupo.jp/problem/many_aplusb
[INFO] online-judge-tools 11.1.3 (+ online-judge-api-client 10.8.0)
[INFO] problem recognized: LibraryCheckerProblem.from_url('https://judge.yosupo.jp/problem/many_aplusb'): https://judge.yosupo.jp/problem/many_aplusb
[INFO] load cookie from: /Users/yosupo/Library/Application Support/online-judge-tools/cookie.jar
git version 2.24.3 (Apple Git-128)
[INFO] $ git -C /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems pull
Already up to date.
[INFO] $ /usr/local/opt/python@3.9/bin/python3.9 /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/generate.py /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/info.toml
00:13:51 [INFO] Start many_aplusb
00:13:51 [INFO] generate params.h
00:13:51 [INFO] Test cases are already generated
00:13:51 [INFO] The checker is already compiled
[INFO] save cookie to: /Users/yosupo/Library/Application Support/online-judge-tools/cookie.jar

[INFO] sample 0
[INFO] input: all_max_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.in
[INFO] output: all_max_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.out

[INFO] sample 1
[INFO] input: all_zero_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.in
[INFO] output: all_zero_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.out

[INFO] sample 2
[INFO] input: example_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.in
[INFO] output: example_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.out

[INFO] sample 3
[INFO] input: max_random_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.in
[INFO] output: max_random_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.out

[INFO] sample 4
[INFO] input: max_random_01
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.in
[INFO] output: max_random_01
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.out

[INFO] sample 5
[INFO] input: random_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.in
[INFO] output: random_00
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.out

[INFO] sample 6
[INFO] input: random_01
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.in
[INFO] output: random_01
[SUCCESS] saved to: .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.out
INFO:onlinejudge_verify.languages.cplusplus:$ /usr/bin/g++ --std=c++17 -O2 -Wall -g -Wl,-stack_size,0x10000000 -I /Users/yosupo/Programs/yosupo-library -o .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/a.out test-oj/aplusb.test.cpp
git version 2.24.3 (Apple Git-128)
INFO:onlinejudge.service.library_checker:$ git -C /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems pull
Already up to date.
INFO:onlinejudge.service.library_checker:$ /usr/local/opt/python@3.9/bin/python3.9 /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/generate.py /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/info.toml --compile-checker
00:13:54 [WARNING] --compile-checker is deprecated. Checker is compiled in default
00:13:54 [INFO] Start many_aplusb
00:13:54 [INFO] generate params.h
00:13:54 [INFO] Test cases are already generated
00:13:54 [INFO] The checker is already compiled
INFO:onlinejudge_verify.verify:$ oj test -c .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/a.out -d .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test --print-input --tle 60 --judge-command /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker
[INFO] online-judge-tools 11.1.3 (+ online-judge-api-client 10.8.0)
[INFO] 7 cases found
time: illegal option -- f
usage: time [-lp] command.
[WARNING] GNU time is not available: time

[INFO] all_max_00
[INFO] time: 0.082224 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpztvqxscz/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] all_zero_00
[INFO] time: 0.020410 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpsum6m6mw/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] example_00
[INFO] time: 0.003764 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmp270gk32x/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.out
ok 3 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] max_random_00
[INFO] time: 0.083291 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpd3entydp/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] max_random_01
[INFO] time: 0.083143 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpr7p7gh0b/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] random_00
[INFO] time: 0.034881 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpwwyjwq8w/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.out
ok 389813 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] random_01
[INFO] time: 0.040022 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpuwrwbabm/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.out
ok 463046 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] slowest: 0.083291 sec  (for max_random_00)
[SUCCESS] test success: 7 cases
INFO:onlinejudge_verify.languages.cplusplus:$ /usr/bin/clang++ --std=c++17 -O2 -Wall -g -Wl,-stack_size,0x10000000 -I /Users/yosupo/Programs/yosupo-library -o .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/a.out test-oj/aplusb.test.cpp
INFO:onlinejudge.service.library_checker:$ /usr/local/opt/python@3.9/bin/python3.9 /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/generate.py /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/info.toml --compile-checker
00:13:58 [WARNING] --compile-checker is deprecated. Checker is compiled in default
00:13:58 [INFO] Start many_aplusb
00:13:58 [INFO] generate params.h
00:13:58 [INFO] Test cases are already generated
00:13:58 [INFO] The checker is already compiled
INFO:onlinejudge_verify.verify:$ oj test -c .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/a.out -d .verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test --print-input --tle 60 --judge-command /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker
[INFO] online-judge-tools 11.1.3 (+ online-judge-api-client 10.8.0)
[INFO] 7 cases found
time: illegal option -- f
usage: time [-lp] command.
[WARNING] GNU time is not available: time

[INFO] all_max_00
[INFO] time: 0.085610 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmp89r4xfov/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_max_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] all_zero_00
[INFO] time: 0.021544 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmp9gu3pqf_/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/all_zero_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] example_00
[INFO] time: 0.003889 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmp5ibj_dnz/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/example_00.out
ok 3 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] max_random_00
[INFO] time: 0.085486 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmplj23ct_2/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_00.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] max_random_01
[INFO] time: 0.085069 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpvynhr2x7/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/max_random_01.out
ok 1000000 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] random_00
[INFO] time: 0.034541 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmp3avluwyv/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_00.out
ok 389813 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] random_01
[INFO] time: 0.039327 sec
[INFO] $ /Users/yosupo/Library/Caches/online-judge-tools/library-checker-problems/sample/many_aplusb/checker /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.in /private/var/folders/y9/jmjk4w395kscrg_jsgfxkpfm0000gn/T/tmpyc64vwd5/actual.out /Users/yosupo/Programs/yosupo-library/.verify-helper/cache/4eadb574dcb743b83b4a231fcab69002/test/random_01.out
ok 463046 tokens
judge's output:
(empty)
[SUCCESS] AC

[INFO] slowest: 0.085610 sec  (for all_max_00)
[SUCCESS] test success: 7 cases
clang: warning: -Wl,-stack_size,0x10000000: 'linker' input unused [-Wunused-command-line-argument]
# 1 "/Users/yosupo/Programs/yosupo-library/test-oj/aplusb.test.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 424 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/Users/yosupo/Programs/yosupo-library/test-oj/aplusb.test.cpp" 2

# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdio" 1 3
# 98 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdio" 3
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 1 3
# 57 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
# 841 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
namespace std { inline namespace __1 { } }
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdio" 2 3
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h" 1 3
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h" 3
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 1 3
# 102 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h" 2 3
# 105 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h" 3

# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h" 1 3 4
# 64 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h" 1 3 4
# 68 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h" 1 3 4
# 630 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_symbol_aliasing.h" 1 3 4
# 631 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h" 2 3 4
# 696 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_posix_availability.h" 1 3 4
# 697 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h" 2 3 4
# 69 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h" 2 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/Availability.h" 1 3 4
# 259 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/Availability.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/AvailabilityInternal.h" 1 3 4
# 260 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/Availability.h" 2 3 4
# 70 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h" 2 3 4

# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h" 1 3 4
# 27 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h" 1 3 4
# 33 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h" 1 3 4
# 32 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h" 3 4
# 1 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/i386/_types.h" 1 3 4
# 37 "/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/i386/_types.h" 3 4
typedef signed char __int8_t;

typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;

以後数万行のソースコード

int main() {
    int t;
    sc.read(t);

    for (int i = 0; i < t; i++) {
        long long a, b;
        sc.read(a, b);
        pr.writeln(a + b);
    }
}
INFO:onlinejudge_verify.verify:all tests succeeded
::warning ::failed to ulimit

Other notes / その他

yosupo06 commented 3 years ago

CXX=g++-10 oj-verify run をした場合出力からソースコードが消えました。macなので g++clang++ へのエイリアスになっています

kmyk commented 3 years ago

これはよくないですね。提出先の問題をマクロを流用して定義する仕様がかなり失敗だった感があり、ちょうどそのうち置き換えたいなと思っていたところでした。そのうちなんとかします。数十行のシェルスクリプトだったときのハックとしてはマクロはそう悪くなかったはずで、いわゆる技術的負債というやつですね。

workaround としては $CXX を指定してもらう以外に、提出先の問題などの指定を #define [KEY] [VALUE] でなく // verification-helper: [KEY] [VALUE] の形で書くというものがあります。これがあるとマクロの検査が省略される (高速化にもなる) ので、出力は消えると思います。この指定方法はまだ undocumented なのですが、そのうち documented にする予定のものです。

yosupo06 commented 3 years ago
// verification-helper: PROBLEM https://judge.yosupo.jp/problem/many_aplusb

に書き換えてみましたが、状況は変わりませんでした(CXX=g++-10をつけた場合のみ正常に動作) 😢

kmyk commented 3 years ago

となると、依存関係の解析が問題を起こしている気がします。互換性問題があるとすればマクロの周辺でしょと思ってしまいましたが、別の怪しい処理として依存関係の解析もあることを忘れていました。

@yosupo06 今のところ以下のようなコマンドで処理をしています。どれが悪いのか試してみてほしいです。

ちなみに、私の Ubuntu の環境 (g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 / clang version 6.0.0-1ubuntu2) では g++ を clang++ に置き換えて試しても特に問題なく動きます。

yosupo06 commented 3 years ago

3000行ほど出てきました。ここに全てを貼ることは出来ないため、独断で一部を抜き出したものが以下です

$ g++ -std=c++17 -O2 -Wall -g -Wl,-stack_size,0x10000000 -dM -E test-oj/aplusb.test.cpp -I .
clang: warning: -Wl,-stack_size,0x10000000: 'linker' input unused [-Wunused-command-line-argument]
#define ACCESSX_MAX_DESCRIPTORS 100
#define ACCESSX_MAX_TABLESIZE (16 * 1024)
#define ARG_MAX (256 * 1024)
#define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
#define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
#define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
#define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
#define ATOMIC_FLAG_INIT {false}
#define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
#define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
#define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
#define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
#define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
#define ATOMIC_VAR_INIT(__v) {__v}
#define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
:
#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
#define _LC_NUM_MASK 6
#define _LIBCPP_ABI_ITANIUM
#define _LIBCPP_ABI_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
#define _LIBCPP_ABI_VERSION 1
:
#define __AVAILABILITY_INTERNAL__IPHONE_NA __attribute__((availability(ios,unavailable)))
#define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA __attribute__((availability(ios,unavailable)))
#define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA_MSG(_msg) __attribute__((availability(ios,unavailable)))
#define __AVAILABILITY_INTERNAL__IPHONE_NA__IPHONE_NA __attribute__((availability(ios,unavailable)))
#define __AVAILABILITY_INTERNAL__MAC_10_0 __attribute__((availability(macosx,introduced=10.0)))
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0 __attribute__((availability(macosx,introduced=10.0,deprecated=10.0)))
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_0_MSG(_msg) __attribute__((availability(macosx,introduced=10.0,deprecated=10.0,message=_msg)))
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_1 __attribute__((availability(macosx,introduced=10.0,deprecated=10.1)))
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10 __attribute__((availability(macosx,introduced=10.0,deprecated=10.10)))
#define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_10_2 __attribute__((availability(macosx,introduced=10.0,deprecated=10.10.2)))
:
#define sa_sigaction __sigaction_u.__sa_sigaction
#define sigmask(m) (1 << ((m)-1))
#define stderr __stderrp
#define stdin __stdinp
#define stdout __stdoutp
#define sv_onstack sv_flags
#define va_arg(ap,type) __builtin_va_arg(ap, type)
#define va_copy(dest,src) __builtin_va_copy(dest, src)
#define va_end(ap) __builtin_va_end(ap)
#define va_start(ap,param) __builtin_va_start(ap, param)
#define w_coredump w_T.w_Coredump
#define w_retcode w_T.w_Retcode
#define w_stopsig w_S.w_Stopsig
#define w_stopval w_S.w_Stopval
#define w_termsig w_T.w_Termsig

数万行の(標準ライブラリもすべて展開されたと思わしき)ソースコードが標準出力に出力されました。おそらく当初のoj-verify runで出力されるものと同一だと思われます。

コンパイルが出来て、期待通りのもの(Many A + Bの解答となるバイナリ)が./a.outに出力されました。

yosupo06 commented 3 years ago

役に立つかもしれない情報を追記します。

$ g++ --help
:
:
  -MD                     Write a depfile containing user and system headers
  -meabi <value>          Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
  -membedded-data         Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
  -mexecute-only          Disallow generation of data access to code sections (ARM only)
  -mextern-sdata          Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
  -mfentry                Insert calls to fentry at function entry (x86/SystemZ only)
  -mfix-cortex-a53-835769 Workaround Cortex-A53 erratum 835769 (AArch64 only)
  -mfp32                  Use 32-bit floating point registers (MIPS only)
  -mfp64                  Use 64-bit floating point registers (MIPS only)
  -MF <file>              Write depfile output from -MMD, -MD, -MM, or -M to <file>
  -mgeneral-regs-only     Generate code which only uses the general purpose registers (AArch64 only)
  -mglobal-merge          Enable merging of globals
  -mgpopt                 Use GP relative accesses for symbols known to be in a small data section (MIPS)
  -MG                     Add missing headers to depfile
  -mhvx-length=<value>    Set Hexagon Vector Length
  -mhvx=<value>           Enable Hexagon Vector eXtensions
  -mhvx                   Enable Hexagon Vector eXtensions
  -miamcu                 Use Intel MCU ABI
  --migrate               Run the migrator
  -mincremental-linker-compatible
                          (integrated-as) Emit an object file which can be used with an incremental linker
  -mindirect-jump=<value> Change indirect jump instructions to inhibit speculation
  -mios-version-min=<value>
                          Set iOS deployment target
  -MJ <value>             Write a compilation database entry per input
  -mllvm <value>          Additional arguments to forward to LLVM's option processing
  -mlocal-sdata           Extend the -G behaviour to object local data (MIPS)
  -mlong-calls            Generate branches with extended addressability, usually via indirect jumps.
  -mlong-double-128       Force long double to be 128 bits
  -mlong-double-64        Force long double to be 64 bits
  -mlong-double-80        Force long double to be 80 bits, padded to 128 bits for storage
  -mmacosx-version-min=<value>
                          Set Mac OS X deployment target
  -mmadd4                 Enable the generation of 4-operand madd.s, madd.d and related instructions.
  -MMD                    Write a depfile containing user headers
  -mmemops                Enable generation of memop instructions
  -mms-bitfields          Set the default structure layout to be compatible with the Microsoft compiler standard
  -mmsa                   Enable MSA ASE (MIPS only)
  -mmt                    Enable MT ASE (MIPS only)
  -MM                     Like -MMD, but also implies -E and writes to stdout by default
  -mno-abicalls           Disable SVR4-style position-independent code (Mips only)
  -mno-code-object-v3     Disable code object v3 (AMDGPU only)
  -mno-crc                Disallow use of CRC instructions (Mips only)
  -mno-cumode             WGP wavefront execution mode is used (AMDGPU only)
  -mno-embedded-data      Do not place constants in the .rodata section instead of the .sdata if they meet the -G <size> threshold (MIPS)
  -mno-execute-only       Allow generation of data access to code sections (ARM only)
  -mno-extern-sdata       Do not assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
  -mno-fix-cortex-a53-835769
                          Don't workaround Cortex-A53 erratum 835769 (AArch64 only)
  -mno-global-merge       Disable merging of globals
  -mno-gpopt              Do not use GP relative accesses for symbols known to be in a small data section (MIPS)
  -mno-hvx                Disable Hexagon Vector eXtensions
  -mno-implicit-float     Don't generate implicit floating point instructions
  -mno-incremental-linker-compatible
                          (integrated-as) Emit an object file which cannot be used with an incremental linker
  -mno-local-sdata        Do not extend the -G behaviour to object local data (MIPS)
  -mno-long-calls         Restore the default behaviour of not generating long calls
  -mno-madd4              Disable the generation of 4-operand madd.s, madd.d and related instructions.
  -mno-memops             Disable generation of memop instructions
  -mno-movt               Disallow use of movt/movw pairs (ARM only)
  -mno-ms-bitfields       Do not set the default structure layout to be compatible with the Microsoft compiler standard
  -mno-msa                Disable MSA ASE (MIPS only)
  -mno-mt                 Disable MT ASE (MIPS only)
  -mno-neg-immediates     Disallow converting instructions with negative immediates to their negation or inversion.
  -mno-nvj                Disable generation of new-value jumps
  -mno-nvs                Disable generation of new-value stores
  -mno-outline            Disable function outlining (AArch64 only)
  -mno-packets            Disable generation of instruction packets
  -mno-relax              Disable linker relaxation
  -mno-restrict-it        Allow generation of deprecated IT blocks for ARMv8. It is off by default for ARMv8 Thumb mode
  -mno-save-restore       Disable using library calls for save and restore
  -mno-sram-ecc           Disable SRAM ECC (AMDGPU only)
  -mno-stack-arg-probe    Disable stack probes which are enabled by default
  -mno-tls-direct-seg-refs
                          Disable direct TLS access through segment registers
  -mno-unaligned-access   Force all memory accesses to be aligned (AArch32/AArch64 only)
  -mno-wavefrontsize64    Wavefront size 32 is used
  -mno-xnack              Disable XNACK (AMDGPU only)
  -mnocrc                 Disallow use of CRC instructions (ARM only)
  -mnop-mcount            Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.
  -mnvj                   Enable generation of new-value jumps
  -mnvs                   Enable generation of new-value stores
  -module-dependency-dir <value>
                          Directory to dump module dependencies to
  -module-file-info       Provide information about a particular module file
  -momit-leaf-frame-pointer
                          Omit frame pointer setup for leaf functions
  -moutline               Enable function outlining (AArch64 only)
  -mpacked-stack          Use packed stack layout (SystemZ only).
  -mpackets               Enable generation of instruction packets
  -mpie-copy-relocations  Use copy relocations support for PIE builds
  -mprefer-vector-width=<value>
                          Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
  -MP                     Create phony target for each dependency (other than main file)
  -mqdsp6-compat          Enable hexagon-qdsp6 backward compatibility
  -MQ <value>             Specify name of main file output to quote in depfile
  -mrecord-mcount         Generate a __mcount_loc section entry for each __fentry__ call.
  -mrelax-all             (integrated-as) Relax all machine instructions
  -mrelax                 Enable linker relaxation
  -mrestrict-it           Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
  -mrtd                   Make StdCall calling convention the default
  -msave-restore          Enable using library calls for save and restore
  -msign-return-address=<value>
                          Select return address signing scope
  -msoft-float            Use software floating point
  -msram-ecc              Enable SRAM ECC (AMDGPU only)
  -mstack-alignment=<value>
                          Set the stack alignment
  -mstack-arg-probe       Enable stack probes
  -mstack-probe-size=<value>
                          Set the stack probe size
  -mstackrealign          Force realign the stack at entry to every function
  -mthread-model <value>  The thread model to use, e.g. posix, single (posix by default)
  -mtls-direct-seg-refs   Enable direct TLS access through segment registers (default)
  -mtp=<value>            Thread pointer access method (AArch32/AArch64 only)
  -MT <value>             Specify name of main file output in depfile
  -munaligned-access      Allow memory accesses to be unaligned (AArch32/AArch64 only)
  -MV                     Use NMake/Jom format for the depfile
  -mwavefrontsize64       Wavefront size 64 is used
  -mxnack                 Enable XNACK (AMDGPU only)
  -M                      Like -MD, but also implies -E and writes to stdout by default
:
:
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

また、-MDをつけるか否かで標準出力に出力されるかが変化されるように見えます。実際に

g++ -std=c++17 -O2 test-oj/aplusb.test.cpp -I . -MM -MF output.txt

ならば何も標準出力に出力されず、output.txtは次のようになります

$ cat output.txt
aplusb.test.o: test-oj/aplusb.test.cpp yosupo/fastio.hpp yosupo/bit.hpp \
  yosupo/internal_type_traits.hpp