docling-project / docling-project/docling

free(): invalid pointer crash when loading PDF with docling_parse (v4.0.1 / CPU / Python 3.12)

Open
#1,397 1 comment 1 reaction 1 assignee Claimed by @PeterStaar-IBM View on GitHub
bug pdf parsing
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

Title:
free(): invalid pointer crash when loading PDF with docling_parse (v4.0.1 / CPU / Python 3.12)

Body:

Hey Docling team,

I’m consistently running into a fatal crash when using docling_parse (version 4.0.1) with Python 3.12 and the CPU-only version of PyTorch (no CUDA).

The crash happens during document parsing — specifically when calling _load_document() from pdf_parser.py in doclin_parse version 4.0.1. Here's the error:

```bash
free(): invalid pointer
Fatal Python error: Aborted
```

And this is the relevant part of the stacktrace:

File ".../docling_parse/pdf_parser.py", line 489 in _load_document
File ".../docling_parse/pdf_parser.py", line 455 in load
...

I’ve confirmed the following:

PyTorch is installed correctly as 2.6.0+cpu, no CUDA present

Python version is 3.12.3

No crash when importing torch or pdfminer.six separately

Downgrading docling_parse to 4.0.0 and 3.4.0 does not resolve the issue

The crash happens inside your library, likely due to a native extension or unsafe memory access

Would really appreciate it if you could look into this — especially since it completely breaks CPU-only setups. Let me know if you need more info to reproduce.

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.