I did a fresh checkout which solved some of my issues.
Writing """\
enable_mojom_fuzzer = true
enable_nacl = false
ffmpeg_branding = "ChromeOS"
is_asan = true
is_component_build = true
is_debug = false
optimize_for_fuzzing = true
pdf_enable_xfa = true
proprietary_codecs = true
use_goma = true
use_libfuzzer = true
""" to /home/adrian/Downloads/browsers/chromium/src/out/libfuzzer/
args.gn.
/home/adrian/Downloads/browsers/chromium/src/buildtools/linux64/gn gen ./out/libfuzzer --check --script-executable=/usr/bin/python
Done. Made 18897 targets from 2772 files in 9770ms
ninja: Entering directory `./out/libfuzzer'
[0/1] Regenerating ninja files
ninja: no work to do.
-rwxrwxr-x 1 adrian adrian 62668680 Apr 19 18:02 ./out/libfuzzer/pdfium_test
=================================================================
==220122==ERROR: AddressSanitizer: requested allocation size 0x7fffffffffffffff (0x8000000000001000 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
#0 0x562ec294f6ad in malloc /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x562ec2a8a60b in GetFileContents(char const*, unsigned long*) third_party/pdfium/testing/utils/file_util.cpp:26:26
#2 0x562ec29820bf in main third_party/pdfium/samples/pdfium_test.cc:1241:9
#3 0x7f527043c0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
==220122==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3 in malloc
I also tried with export ASAN_OPTIONS="allocator_may_return_null=1" and I still get the above error.