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 <[email protected]> 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 <[email protected]> wrote: > > > > On Fri, Sep 12, 2025 at 8:26 AM 'Mati Cohen' via v8-users > > <[email protected]> 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 > > [email protected] > > 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 > > [email protected]. > > 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 > [email protected] > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/v8-users/D27EC591-82E7-43AB-B309-D7D01E9B3123%40encircleapp.com. -- -- v8-users mailing list [email protected] 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/v8-users/CAHQurc9R8%3Dt9hQ1wcyZT%2BhX91vVg5UBB-sz-W7odYnEgNLGNNQ%40mail.gmail.com.
