mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-07 12:41:49 +00:00
Disable pikepdf mmap
Infrequently we can reproduce this error: terminating with uncaught exception of type std::runtime_error: pybind11_object_dealloc(): Tried to deallocate unregistered instance! The error is probably related to pybind11 issue #2252 and a bunch of other related issues. Until that is resolved in pybind11 and pikepdf we will disable the pikepdf mmap interface.
This commit is contained in:
parent
6b994221c6
commit
b93cf51c0f
@ -213,11 +213,15 @@ def clamp(n: T, smallest: T, largest: T) -> T:
|
||||
|
||||
|
||||
def pikepdf_enable_mmap():
|
||||
try:
|
||||
if pikepdf._qpdf.set_access_default_mmap(True):
|
||||
log.debug("pikepdf mmap enabled")
|
||||
except AttributeError:
|
||||
log.debug("pikepdf mmap not available")
|
||||
# try:
|
||||
# if pikepdf._qpdf.set_access_default_mmap(True):
|
||||
# log.debug("pikepdf mmap enabled")
|
||||
# except AttributeError:
|
||||
# log.debug("pikepdf mmap not available")
|
||||
# We found a race condition probably related to pybind issue #2252 that can
|
||||
# cause a crash. For now, disable pikepdf mmap to be on the safe side.
|
||||
log.debug("pikepdf mmap disabled")
|
||||
return
|
||||
|
||||
|
||||
def deprecated(func):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user