Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled pdfium is not available in windows7 #162

Open
Haye1213 opened this issue Mar 25, 2024 · 3 comments
Open

Compiled pdfium is not available in windows7 #162

Haye1213 opened this issue Mar 25, 2024 · 3 comments

Comments

@Haye1213
Copy link

I would like to ask how you compile pdfium. The chromium6307 version of pdfium I compiled will crash when using FPDF_InitLibrary on windows7 system, but this problem will not occur when using the one you provide
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

@mara004
Copy link
Contributor

mara004 commented Mar 26, 2024

pdfium-binaries are currently built without PartitionAlloc, which is not Windows-7-compatible according to https://groups.google.com/g/pdfium/c/nvsDYtu1v7c/m/UyCzD2N0AQAJ.
I think this explains why a binary compiled with your config crashes whereas pdfium-binaries don't.
See also #148 for other reasons to disable PartitionAlloc.

@Haye1213
Copy link
Author

Haye1213 commented Apr 7, 2024

Hi!@mara004 ,
Thank you for your reply. I have learned that we can avoid further problems in windows7 by adding this compilation option, but I also want to know if there will be any bad effects after adding this compilation option

@mara004
Copy link
Contributor

mara004 commented Apr 7, 2024

@Haye1213 We've been using PartitionAlloc-disabled binaries for a while now and so far haven't had any issues.
From what I understand, it's a custom memory allocator implementation, i.e. an alternative to the system allocator. In particular, it seems to provide some inherent security features, aiming to limit the exploit scope in case of memory corruption. This may or may not be relevant to your use case. You can read more about PartitionAlloc design goals e.g. here: https://chromium.googlesource.com/chromium/src/+/master/base/allocator/partition_allocator/PartitionAlloc.md

If you are concerned about disabling PartitionAlloc, you could alternatively try to patch the code that does not work on Win7, but supposedly you'd be on your own with this.
IMHO the compatibility reasons justify disabling PartitionAlloc, and its advantages might be more theoretical than practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants