macOS(14.1) build failure: dyld: Library not loaded: CoreFoundation

1,185 views
Skip to first unread message

JS.

unread,
Oct 10, 2023, 2:35:01 PM10/10/23
to Chromium-dev

I am having the following error on macOS 14.1(23B5056e):


```

$ autoninja -C out/debug chrome


ninja: Entering directory `out/debug'

[1/168] ACTION //tools/v8_context_snapshot:generate_v8_context_snapshot(//build/toolchain/mac:clang_arm64)

FAILED: v8_context_snapshot.arm64.bin 

python3 ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.arm64.bin

dyld[4441]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed

dyld[4441]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

  Referenced from: <4C4C44A2-5555-3144-A116-EE1A7F5ECC86> /Users/0x4248/chrome/src/out/debug/v8_context_snapshot_generator

  Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file, no dyld cache)

./v8_context_snapshot_generator failed with exit code -6

ninja: build stopped: subcommand failed.

```


Anyone tried solving this error?

Mark Mentovai

unread,
Oct 10, 2023, 3:47:18 PM10/10/23
to 0x4...@gmail.com, Chromium-dev
I’m not running macOS 14.1b, so I can’t speak directly to the report, but this is the problem:

dyld[4441]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed

Normally when this happens, it’s because something (the executable) is already mapped where the dyld shared cache wants to load. Is out/debug/v8_context_snapshot_generator extremely large? You can run size or otool -l on it to inspect how it maps when loaded, or even just an ls -l to get a sense of its size.

Note that while you say you’re running 14.1b2 23B5056e, 14.1b3 23B5067a is current, and it would be advisable to update and test again.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/3b05a264-228a-4864-bbd9-21e6ba3f53e5n%40chromium.org.

Mark Mentovai

unread,
Oct 11, 2023, 10:08:11 AM10/11/23
to JS., Chromium-dev
I updated to 14.1b3 23B5067a and tested again.

```

[1/168] ACTION //tools/v8_context_snapshot:generate_v8_context_snapshot(//build/toolchain/mac:clang_arm64)

FAILED: v8_context_snapshot.arm64.bin 

python3 ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.arm64.bin

dyld[4701]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed

dyld[4701]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

  Referenced from: <4C4C44A2-5555-3144-A116-EE1A7F5ECC86> /Users/0x4248/chrome/src/out/debug/v8_context_snapshot_generator

  Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file, no dyld cache)

./v8_context_snapshot_generator failed with exit code -6

ninja: build stopped: subcommand failed.

```

But that did not solved the problem.

ls -l out/debug/v8_context_snapshot_generator 

-rwxr-xr-x  1 0x4248  staff  2728076768 Oct  7 21:49 out/debug/v8_context_snapshot_generator


2728076768 > 2GB, which is the limit on executable size on mac-arm64. That confirms that your problem is an executable that’s too large.

I don’t know why your v8_context_snapshot_generator would be so large.

I also tried to remove out/debug/v8_context_snapshot_generator then build it.

That also did not help.

I will try to build it from the start.

 If you still have the problem after a clean build, look into any local modifications you may have made.

Locally, I see

% ls -l out/debug_component/v8_context_snapshot_generator
-rwxr-xr-x  1 mark  staff  48242448 Oct 11 09:57 out/debug_component/v8_context_snapshot_generator
% otool -l out/debug_component/v8_context_snapshot_generator | grep -E '^  segname|vmaddr|vmsize'
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x0000000000b20000
  segname __DATA_CONST
   vmaddr 0x0000000100b20000
   vmsize 0x0000000000020000
  segname __DATA
   vmaddr 0x0000000100b40000
   vmsize 0x0000000000004000
  segname __LINKEDIT
   vmaddr 0x0000000100b44000
   vmsize 0x00000000022bdf10

48242448 is well under 2GB.

2023년 10월 11일 수요일 오전 4시 47분 18초 UTC+9에 Mark Mentovai님이 작성:

Christian Biesinger

unread,
Oct 11, 2023, 10:27:29 AM10/11/23
to ma...@chromium.org, JS., Chromium-dev
On Wed, Oct 11, 2023 at 10:07 AM Mark Mentovai <ma...@chromium.org> wrote:
>
> 0x4...@gmail.com wrote:
>>
>> I updated to 14.1b3 23B5067a and tested again.
>>
>> ```
>>
>> [1/168] ACTION //tools/v8_context_snapshot:generate_v8_context_snapshot(//build/toolchain/mac:clang_arm64)
>>
>> FAILED: v8_context_snapshot.arm64.bin
>>
>> python3 ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.arm64.bin
>>
>> dyld[4701]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
>>
>> dyld[4701]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>>
>> Referenced from: <4C4C44A2-5555-3144-A116-EE1A7F5ECC86> /Users/0x4248/chrome/src/out/debug/v8_context_snapshot_generator
>>
>> Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file, no dyld cache)
>>
>> ./v8_context_snapshot_generator failed with exit code -6
>>
>> ninja: build stopped: subcommand failed.
>>
>> ```
>>
>> But that did not solved the problem.
>>
>> ls -l out/debug/v8_context_snapshot_generator
>>
>> -rwxr-xr-x 1 0x4248 staff 2728076768 Oct 7 21:49 out/debug/v8_context_snapshot_generator
>
>
> 2728076768 > 2GB, which is the limit on executable size on mac-arm64. That confirms that your problem is an executable that’s too large.
>
> I don’t know why your v8_context_snapshot_generator would be so large.

0x4248, it might be helpful if you post your args.gn?


Christian

JS.

unread,
Oct 11, 2023, 12:20:54 PM10/11/23
to Chromium-dev, Mark Mentovai, Chromium-dev, 0x4...@gmail.com
I updated to 14.1b3 23B5067a and tested again.

```

[1/168] ACTION //tools/v8_context_snapshot:generate_v8_context_snapshot(//build/toolchain/mac:clang_arm64)

FAILED: v8_context_snapshot.arm64.bin 

python3 ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.arm64.bin

dyld[4701]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed

dyld[4701]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

  Referenced from: <4C4C44A2-5555-3144-A116-EE1A7F5ECC86> /Users/0x4248/chrome/src/out/debug/v8_context_snapshot_generator

  Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file, no dyld cache)

./v8_context_snapshot_generator failed with exit code -6

ninja: build stopped: subcommand failed.

```

But that did not solved the problem.

ls -l out/debug/v8_context_snapshot_generator 

-rwxr-xr-x  1 0x4248  staff  2728076768 Oct  7 21:49 out/debug/v8_context_snapshot_generator


I also tried to remove out/debug/v8_context_snapshot_generator then build it.

That also did not help.

I will try to build it from the start.

2023년 10월 11일 수요일 오전 4시 47분 18초 UTC+9에 Mark Mentovai님이 작성:
I’m not running macOS 14.1b, so I can’t speak directly to the report, but this is the problem:

Christian Biesinger

unread,
Oct 11, 2023, 12:57:50 PM10/11/23
to JS., Chromium-dev, ma...@chromium.org
My assumption is that the combination of is_debug, is_asan and the
v8_* flags cause the huge size. Try removing some of them to verify?

(You don't need dcheck_always_on in an is_debug=true build)

Christian

On Wed, Oct 11, 2023 at 12:40 PM JS. <0x4...@gmail.com> wrote:
>
> Yes! I was about to share it because I haven't made any changes in the code.
>
> Thank you so much mark@ and cbiesinger@
>
> ```
> $ cat ~/chrome/src/out/debug/args.gn
> is_debug = true
> v8_enable_backtrace = true
> v8_enable_disassembler = true
> v8_enable_object_print = true
> v8_enable_verify_heap = true
> is_asan = true
> symbol_level = 1
> dcheck_always_on = true
> ```
>
> I guess the v8_* flags caused the issue?
>
>
> Thanks again!
>
>
> Junsung.
> 2023년 10월 11일 수요일 오후 11시 27분 29초 UTC+9에 Christian Biesinger님이 작성:

Mark Mentovai

unread,
Oct 11, 2023, 1:35:07 PM10/11/23
to Christian Biesinger, JS., Chromium-dev
I tried duplicating those GN args and still only wound up with an executable sized 87,244,480 bytes. I’d check for local changes.

JS.

unread,
Oct 11, 2023, 8:14:20 PM10/11/23
to Chromium-dev, Christian Biesinger, JS., Chromium-dev, ma...@chromium.org
Yes! I was about to share it because I haven't made any changes in the code.

Thank you so much mark@ and cbiesinger@

```
$ cat ~/chrome/src/out/debug/args.gn
is_debug = true
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
is_asan = true
symbol_level = 1
dcheck_always_on = true
```

I guess the v8_* flags caused the issue?


Thanks again!


Junsung.
2023년 10월 11일 수요일 오후 11시 27분 29초 UTC+9에 Christian Biesinger님이 작성:
On Wed, Oct 11, 2023 at 10:07 AM Mark Mentovai <ma...@chromium.org> wrote:
Reply all
Reply to author
Forward
0 new messages