Skip to content

Commit 5a8f81f

Browse files
authored
created RandomSegmentationFaults tip
1 parent 66dae6e commit 5a8f81f

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Solving random segmenation faults...
2+
3+
Ideally the source code *should* be littered with ANSI-C `assert`ions.
4+
These are indispensable in detecting segmentation faults due to
5+
dereferencing null pointers.
6+
7+
Obviously there are not enough... so consider adding more!
8+
9+
One way to track down the source of a random segmentation fault,
10+
is to litter the pdf2htmlEX and/or poppler source code with
11+
printfs... This will allow you to detect the last working code,
12+
and this might suggest where to start reading the code in detail.
13+
14+
## Poppler reference counting
15+
16+
Poppler uses object reference counting. Unfortunately the assumption
17+
about "who" is responsible for incrementing and decrementing these
18+
refernce counts *does* change between poppler releases. This means
19+
that between poppler releases the pdf2htmlEX code should include
20+
new increments or decrements *or* now has too many...
21+
22+
**Solution:** Check all {inc,dec}RefCnt uses...
23+
from poppler-0.68.0 the USER (i.e. pdf2htmlEX) is supposed to
24+
incRefCnt as well as decRefCnt.
25+

0 commit comments

Comments
 (0)