Hi Jakob,

The issue started with 11.0 (10.9 is good). More precisely it's commit 26bc8bb4 
(see [1]).
Unfortunately, without knowledge of the v8 internals, it's really hard to find 
a direct link in this commit to the place mksnapshot exits and debug further. 
It would be fantastic if I could get some more hints or a patch to try (even if 
untested).

Thanks,
Jean-Claude

--------------------------
[1] git bisect output

C:\Users\jean-claude\Documents\src\google\v8>git bisect good
26bc8bb4013a984d9e7a3e8feff8b1058458f349 is the first bad commit
commit 26bc8bb4013a984d9e7a3e8feff8b1058458f349
Author: Leszek Swirski <lesz...@chromium.org>
Date:   Wed Nov 23 15:06:55 2022 +0100

    [ext-code-space] Make process-wide code range leaky

    Make the process-wide code range a once-initialised leaky object, rather
    than having a global weak_ptr + per-heap shared pointers and allowing it
    to be collected when all Isolates die.

    These weak pointers add locking overhead when accessing the code range,
    which shows up in GC and deoptimization traces when attempting to
    calculate Code objects from PCs. The process-wide pointer compression
    cage is already leaky, so it makes sense for the code range to be
    similar.

    Bug: v8:11460

    Change-Id: Ibebd468ebad9eafe8aec49f575cdbf604e4b6cc0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4051201
    Reviewed-by: Igor Sheludko <ish...@chromium.org>
    Reviewed-by: Michael Lippautz <mlippa...@chromium.org>
    Commit-Queue: Leszek Swirski <lesz...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#84462}

src/execution/isolate.cc               |  3 +-
src/heap/code-range.cc                 | 61 ++++++++++++++++------------------
src/heap/code-range.h                  |  7 ++--
src/heap/heap.cc                       | 28 ++++++++--------
src/heap/heap.h                        | 14 ++++++--
src/init/isolate-allocator.cc          |  3 +-
src/objects/code.cc                    |  2 +-
src/snapshot/embedded/embedded-data.cc |  2 +-
src/snapshot/embedded/embedded-data.h  |  2 +-
9 files changed, 64 insertions(+), 58 deletions(-)

On Tue, Aug 8, 2023, at 3:19 PM, Jean-Claude Monnin wrote:
> Hi Jakob,
> 
> Thanks for your reply.
> It looks like using Microsoft's C++ library instead of libc++ is somewhat 
> exotic for v8. Unfortunately there are cases where it's almost impossible to 
> switch to libc++.
> 
> Since I have a chance to get some feedback here of how to address this issue, 
> I'm going to try to give you as much info as possible.
> 
> `mksnapshot.exe` aborts at `VirtualMemoryCage::InitReservation` at following 
> check:
>   CHECK(IsAligned(params.reservation_size, allocate_page_size));
> 
> When adding following print on the line before
>   i::PrintF(stdout, "VirtualMemoryCage::InitReservation %u %u\n", 
> params.reservation_size, allocate_page_size);
> it prints
>   VirtualMemoryCage::InitReservation 3356617664 65536
> It looks like the supplied `params.reservation_size` is not aligned.
> 
> Full call stack is included in screenshot below (sorry for the screenshot, I 
> couldn't find a way to copy text from WinDbg)
> 
> I'm happy to investigate further, but wanted to send this out in case there 
> is anything specific that would be helpful.
> 
> Jean-Claude
> 
> On Tue, Aug 8, 2023, at 12:13 PM, Jakob Gruber wrote:
>> Hi Jean-Claude,
>> 
>> no, we don't have a lot of test coverage for `use_custom_libcxx=false`, this 
>> mode is only supported on a best-effort basis.
>> 
>> For debugging: a backtrace and symbols would be useful. Does running 
>> `mksnapshot` in a debugger give more infos? Also, a bisect to find the 
>> culprit change would be very helpful.
>> 
>> On Thu, Aug 3, 2023 at 6:54 PM Jean-Claude Monnin <jc_mon...@emailplus.org> 
>> wrote:
>>> Hi,
>>> 
>>> On windows, the v8 version 11.5 build fails when generating the snapshot 
>>> with following error:
>>> 
>>> C:/Users/jean-claude/Documents/src/google/depot_tools/bootstrap-2@3_8_10_chromium_26_bin/python3/bin/python3.exe
>>>  ../../tools/run.py ./mksnapshot --turbo_instruction_scheduling 
>>> --target_os=win --target_arch=x64 --embedded_src gen/embedded.S 
>>> --embedded_variant Default --random-seed 314159265 --startup_blob 
>>> snapshot_blob.bin --no-native-code-counters
>>> Return code is 2147483651 <tel:(214)%20748-3651>
>>> 
>>> These are the options used (args.gn):
>>> is_official_build = true
>>> target_cpu = "x64"
>>> is_component_build = true
>>> use_custom_libcxx = false
>>> chrome_pgo_phase = false
>>> treat_warnings_as_errors = false
>>> fatal_linker_warnings = false
>>> symbol_level = 0
>>> 
>>> When using `is_debug=false` instead of `is_official_build = true` it builds 
>>> fine, but it comes with performance regressions compared to older version 
>>> 9.3 build with `is_official_build = true`.
>>> 
>>> If using either `is_component_build = false` or `use_custom_libcxx = true`, 
>>> it builds fine too, however it's not really an option as I need a dll build 
>>> and I need to use Microsoft's C++ standard library because third party 
>>> dependencies prevents us to use libc++.
>>> 
>>> I also tried version 11.4 and 11.6 and they give the same error.
>>> 
>>> Any hints in how to diagnose/fix that would be appreciated.
>>> 
>>> Auxiliary question: Is any big project using `use_custom_libcxx = false` 
>>> (eg. Microsoft's C++ standard library), or is this untested? 
>>> Chrome/node/deno all use libc++?
>>> 
>>> Best regards,
>>> Jean-Claude
>>> 
>>> --
>>> --
>>> v8-users mailing list
>>> v8-users@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to the Google Groups 
>>> "v8-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to v8-users+unsubscr...@googlegroups.com 
>>> <mailto:v8-users%2bunsubscr...@googlegroups.com>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/v8-users/984f3518-4b8e-4403-b794-923be66ccf08%40app.fastmail.com.
>> 
>> 
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to v8-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/v8-users/CAH3p7oO%2BEkjhuGaa9nXVWHd9Da3W4h0mr3ychCWu4J3gqRut8Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/v8-users/CAH3p7oO%2BEkjhuGaa9nXVWHd9Da3W4h0mr3ychCWu4J3gqRut8Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> 
> 
> 
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups 
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to v8-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/v8-users/7d4484d9-13bd-4f86-be64-79b12abc0ec9%40app.fastmail.com
>  
> <https://groups.google.com/d/msgid/v8-users/7d4484d9-13bd-4f86-be64-79b12abc0ec9%40app.fastmail.com?utm_medium=email&utm_source=footer>.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/de370ad9-9879-4c65-8677-ebe07247f9e0%40app.fastmail.com.

Reply via email to