pdf2xml icon indicating copy to clipboard operation
pdf2xml copied to clipboard

Memory-leaks-TextPage-testLinkedText

Open Aurorainfinity opened this issue 4 years ago • 0 comments

$ ./pdf2xml 04-Memory leaks-TextPage-testLinkedText.pdf test.xml
=================================================================
==82085==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 99000 byte(s) in 99 object(s) allocated from:
	#0 0x7f1554619602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
	#1 0x7f1553d2f735  (/usr/lib/x86_64-linux-gnu/libxml2.so.2+0x2e735)

Direct leak of 4850 byte(s) in 97 object(s) allocated from:
	#0 0x7f1554619602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
	#1 0x4156a9 in TextPage::testLinkedText(_xmlNode*, double, double, double, double) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:1473
	#2 0x41773d in TextPage::dump(int, int) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:1764
	#3 0x428ec5 in XmlOutputDev::endPage() /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:4155
	#4 0x48e309 in Gfx::~Gfx() /home/test/pdf2xml_analysis/pdf2xml/xpdf/xpdf/Gfx.cc:591
	#5 0x45653e in Page::display(OutputDev*, double, double, int, int, int, int, int (*)(void*), void*) /home/test/pdf2xml_analysis/pdf2xml/xpdf/xpdf/Page.cc:310

Direct leak of 3924 byte(s) in 97 object(s) allocated from:
	#0 0x7f1554619602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
	#1 0x417a6c in TextPage::dump(int, int) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:1800
	#2 0x428ec5 in XmlOutputDev::endPage() /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:4155
	#3 0x48e309 in Gfx::~Gfx() /home/test/pdf2xml_analysis/pdf2xml/xpdf/xpdf/Gfx.cc:591
	#4 0x45653e in Page::display(OutputDev*, double, double, int, int, int, int, int (*)(void*), void*) /home/test/pdf2xml_analysis/pdf2xml/xpdf/xpdf/Page.cc:310

Direct leak of 3316 byte(s) in 227 object(s) allocated from:
	#0 0x7f15545e330f in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x6230f)
	#1 0x40a476 in TextWord::TextWord(GfxState*, int, int, int, int, double, double, int, TextFontInfo*, double, int, int) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:212
	#2 0x4125fc in TextPage::beginWord(GfxState*, double, double) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:1160
	#3 0x4128c9 in TextPage::addChar(GfxState*, double, double, double, double, unsigned int, int, unsigned int*, int) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:1178
	#4 0x429048 in XmlOutputDev::drawChar(GfxState*, double, double, double, double, double, double, unsigned int, int, unsigned int*, int) /home/test/pdf2xml_analysis/pdf2xml/src/XmlOutputDev.cc:4172
	#5 0x4935b1 in Gfx::doShowText(GString*) /home/test/pdf2xml_analysis/pdf2xml/xpdf/xpdf/Gfx.cc:3646

ref:https://github.com/Aurorainfinity/Poc/tree/master/pdf2xml 04-Memory leaks-TextPage-testLinkedText.pdf

Aurorainfinity avatar Jul 06 '20 03:07 Aurorainfinity