Yes, 16k on x64 and arm64 android.

On Tue, Sep 16, 2025 at 6:53 PM 'Mati Cohen' via v8-users
<v8-users@googlegroups.com> wrote:
>
> I'm willing to recompile the latest stable version. I am looking at 
> build_config.h and for it's using the following implementation:
>
> #if (defined(V8_OS_MACOS) && defined(V8_HOST_ARCH_ARM64)) || \
> (defined(V8_OS_ANDROID) && \
> (defined(V8_HOST_ARCH_ARM64) || defined(V8_HOST_ARCH_X64))) || \
> defined(V8_HOST_ARCH_LOONG64) || defined(V8_HOST_ARCH_MIPS64) || \
> defined(V8_OS_IOS)
> // Android 64 bit has experimental support for 16kB pages.
> // MacOS & iOS on arm64 uses 16kB pages.
> // LOONG64 and MIPS64 also use 16kB pages.
> constexpr int kMinimumOSPageSize = 16 * 1024;
> #elif defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID) && \
> (defined(V8_HOST_ARCH_ARM64) || defined(V8_HOST_ARCH_PPC64))
> // Linux on arm64 (excluding android) and PPC64 can be configured for up to 
> 64kB
> // pages.
> constexpr int kMinimumOSPageSize = 64 * 1024;
> #else
> // Everything else uses 4kB pages.
> constexpr int kMinimumOSPageSize = 4 * 1024;
> #endif
>
> Sorry for my ignorance, but does it mean that all Android devices with 
> arm64-v8a and x86_64 architectures will use a size of 16KB. Is this correct? 
> I am trying to understand if there are devices with arm64-v8a and x86_64 
> architectures which still use 4KB for page sizes.
>
> Thanks,
> Matias.
>
> On Saturday, September 13, 2025 at 7:17:56 AM UTC-4 Ben Noordhuis wrote:
>>
>> Assuming recompiling is not a problem for you: just edit
>> build_config.h and change it to 16k.
>>
>> IIRC, stdout and stderr are not normally hooked up to anything on
>> Android but it should be possible to freopen them to a log file.
>>
>> On Fri, Sep 12, 2025 at 4:15 PM 'Matias Cohen' via v8-users
>> <v8-u...@googlegroups.com> wrote:
>> >
>> > Thanks Ben.
>> >
>> > Yeah, that’s strange. I also noticed that SetDataReadOnly didn’t exist in 
>> > 10.4.132. Moreover, the V8_FATAL exception that is raised was added even 
>> > later. Maybe my records about 10.4.132 are wrong, but I am sure that we 
>> > built v8 last time in August 2022, so I can’t explain it.
>> >
>> > Android Studio don’t show any error message more than the stacktrace I 
>> > already shared.
>> >
>> > My guess is that kMinimumOSPageSize was still 4KB for Android back then 
>> > when I built v8 (yet I can’t explain why SetDataReadOnly is part of the 
>> > stacktrace).
>> >
>> > Is there any way for me to overwrite kMinimumOSPageSize from “outside” v8, 
>> > just to test if that makes a difference?
>> >
>> > Thanks!
>> >
>> > > On Sep 12, 2025, at 5:20 AM, Ben Noordhuis <in...@bnoordhuis.nl> wrote:
>> > >
>> > > On Fri, Sep 12, 2025 at 8:26 AM 'Mati Cohen' via v8-users
>> > > <v8-u...@googlegroups.com> wrote:
>> > >>
>> > >> Hi,
>> > >>
>> > >> My app is using v8 to run a JS environment. Last time I built v8 was 
>> > >> about 3 years ago by pointing to 10.4.132.
>> > >>
>> > >> As per Google policy, my app needs to support 16 KB page size and I've 
>> > >> been checking all my dependencies to meet that criteria.
>> > >>
>> > >> Apparently, based on my checks, my v8 build does support it and I 
>> > >> managed to run the app on my device.
>> > >> However, v8 is crashing as soon as I call V8::Initialize(); with the 
>> > >> following stack trace:
>> > >>
>> > >> /base.apk!liben8.so (offset 0x8ad8000) (v8::base::OS::Abort()+28)
>> > >> /base.apk!liben8.so (offset 0x8ad8000) (V8_Fatal(char const*, ...)+376)
>> > >> /base.apk!liben8.so (offset 0x8ad8000) 
>> > >> (v8::base::OS::SetDataReadOnly(void*, unsigned long)+52)
>> > >> /base.apk!liben8.so (offset 0x8ad8000) 
>> > >> (v8::internal::V8::Initialize()+1552)
>> > >> /base.apk!liben8.so (offset 0x8ad8000) (v8::V8::Initialize(int)+28)
>> > >> /base.apk!liben8.so (offset 0x8ad8000) (Runtime::Runtime(_JNIEnv*)+172)
>> > >>
>> > >> As explained at 
>> > >> https://www.google.com/url?q=https://developer.android.com/guide/practices/page-sizes%23check-code&source=gmail-imap&ust=1758273654000000&usg=AOvVaw2eBFhXRa0E0P-iWsikoJCW,
>> > >>  I was trying to look for references to PAGE_SIZE and 4096 to see if I 
>> > >> was setting up something wrong, but I didn't find anything.
>> > >>
>> > >> Does anyone have any knowledge about this?
>> > >> Thanks a lot,
>> > >> Mati
>> > >
>> > > V8 doesn't use PAGE_SIZE, it uses sysconf(_SC_PAGESIZE).
>> > >
>> > > You mention 10.4.132 but that stack trace is from a different version,
>> > > isn't it? Because SetDataReadOnly didn't exist back then.
>> > >
>> > > It crashes when trying to mprotect(PROT_READ) the command line flags,
>> > > v8_flags. v8_flags is aligned to kMinimumOSPageSize and that _should_
>> > > be 16k on Android but you'll want to double-check that. It's defined
>> > > in src/base/build_config.h.
>> > >
>> > > What error message did V8 print?
>> > >
>> > > --
>> > > --
>> > > v8-users mailing list
>> > > v8-u...@googlegroups.com
>> > > https://www.google.com/url?q=http://groups.google.com/group/v8-users&source=gmail-imap&ust=1758273654000000&usg=AOvVaw3Vi2w6FFQXBkM9c-JZXWPp
>> > > ---
>> > > You received this message because you are subscribed to a topic in the 
>> > > Google Groups "v8-users" group.
>> > > To unsubscribe from this topic, visit 
>> > > https://www.google.com/url?q=https://groups.google.com/d/topic/v8-users/7XDxoIaXdV4/unsubscribe&source=gmail-imap&ust=1758273654000000&usg=AOvVaw0flrzsS8NN-9t4czOPfrqp.
>> > > To unsubscribe from this group and all its topics, send an email to 
>> > > v8-users+u...@googlegroups.com.
>> > > To view this discussion visit 
>> > > https://www.google.com/url?q=https://groups.google.com/d/msgid/v8-users/CAHQurc-SN0whK9Y3U8%253DSEdMPOVJLfhQ7fVPcqUi_kAjDJywGeQ%2540mail.gmail.com&source=gmail-imap&ust=1758273654000000&usg=AOvVaw0W3G7qAhJMvkfEdoop6uqR.
>> >
>> > --
>> > --
>> > v8-users mailing list
>> > v8-u...@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+u...@googlegroups.com.
>> > To view this discussion visit 
>> > https://groups.google.com/d/msgid/v8-users/D27EC591-82E7-43AB-B309-D7D01E9B3123%40encircleapp.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 visit 
> https://groups.google.com/d/msgid/v8-users/759c5f1b-0824-4a79-917a-07acab42f7aan%40googlegroups.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 visit 
https://groups.google.com/d/msgid/v8-users/CAHQurc9s4xM%2B-XtE4h_JcSEePN6wmP7Xob2v2JLGr3MZvdXksQ%40mail.gmail.com.

Reply via email to