Compiled pdfium is not available in windows7

117 views
Skip to first unread message

Haye Lee

unread,
Mar 25, 2024, 2:25:57 AMMar 25
to pdfium
I downloaded the chromium6307 version of pdfium source code and compiled it, after compiling, call the export interface to achieve the function of extracting text, but put the tool into windows7 system, the use of tools will crash, using windbg to view the stack as follows:
pdfium!partition_alloc::internal::logging::LogMessage::~LogMessage::<lambda_0>::operator()
pdfium!partition_alloc::internal::logging::LogMessage::~LogMessage+0x152
pdfium!partition_alloc::internal::base::RandBytes+0xc7
pdfium!partition_alloc::internal::base::RandUint64+0x14
pdfium!partition_alloc::internal::base::InsecureRandomGenerator::InsecureRandomGenerator+0x3c
pdfium!partition_alloc::RandomGenerator::GetGenerator+0x4d
pdfium!partition_alloc::RandomGenerator::RandomValue+0x5e
pdfium!partition_alloc::internal::RandomValue+0x63
pdfium!partition_alloc::GetRandomPageBase+0xa
pdfium!partition_alloc::AllocPagesWithAlignOffset+0x48
pdfium!partition_alloc::AllocPages+0x1c
pdfium!partition_alloc::internal::PartitionAddressSpace::Init+0x3d
pdfium!partition_alloc::PartitionRoot::Init+0x62
pdfium!partition_alloc::PartitionAllocator::init+0x32
pdfium!partition_alloc::PartitionAllocator::PartitionAllocator+0x10
pdfium!pdfium::base::NoDestructor<partition_alloc::PartitionAllocator>::NoDestructor<const partition_alloc::PartitionOptions &>+0x3b
pdfium!`anonymous namespace'::GetArrayBufferPartitionAllocator+0x59
pdfium!FX_InitializeMemoryAllocators+0x1e
pdfium!FPDF_InitLibraryWithConfig+0x16

This seems to be a problem with FPDF_InitLibrary, but it doesn't work on windows10. 
I use the command line to compile, enter the command line as follows:
gn args out/x64
ninja -C out/x64 pdfium

My args.gn file looks like this:
is_component_build = false
is_debug = false
pdf_enable_v8 = false
pdf_enable_xfa = false
pdf_is_standalone = true
target_cpu = "x86"
target_os = "win"
treat_warnings_as_errors = false

Now I can't find the problem, I hope to get your reply, thank you

Lei Zhang

unread,
Mar 25, 2024, 12:17:34 PMMar 25
to Haye Lee, pdfium
The current partition_alloc::internal::base::RandBytes() may not work
on Windows 7. You can either try reverting that file to an older
version which works with Win 7, or turn off PartitionAlloc altogether
by setting GN pdf_use_partition_alloc=false.
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/1f7ef3da-73b3-49de-9b5b-1da5c1b2dd71n%40googlegroups.com.

Haye Lee

unread,
Mar 25, 2024, 10:29:02 PMMar 25
to pdfium
Thank you for your reply. I have tried both methods and they are feasible. And I also want to ask, what are the effects of turning off PartitionAlloc?

Lei Zhang

unread,
Mar 26, 2024, 12:16:00 AMMar 26
to Haye Lee, pdfium
You can find out more about PartitionAlloc in your favorite search
engine. There are lots of good resources that can describe
PartitionAlloc better than I can.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/adac5828-6dad-4b46-b449-9ab8847a9056n%40googlegroups.com.

geisserml

unread,
Mar 26, 2024, 6:57:27 PMMar 26
to pdfium
FWIW, @bblanchon's pdfium-binaries are built without PartitionAlloc.
See also https://github.com/bblanchon/pdfium-binaries/issues/148 and https://github.com/bblanchon/pdfium-binaries/issues/162
Reply all
Reply to author
Forward
0 new messages