Сould you tell me, the poppler library is thread safe?
I use the library (tag: poppler-0.70.1) in 2 threads and I have segfault. I build my project with sanitize and I get this info:
==12554==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000031190 at pc 0x000000960aee bp 0x7f4e1b4fd850 sp 0x7f4e1b4fd840
READ of size 8 at 0x602000031190 thread T2
#0 0x960aed in BuiltinFontWidths::~BuiltinFontWidths() /home/yl/code/test_gpu/v2/poppler_local/poppler/BuiltinFont.cc:39
#1 0x9613ab in freeBuiltinFontTables() /home/yl/code/test_gpu/v2/poppler_local/poppler/BuiltinFontTables.cc:4282
#2 0x612535 in GlobalParams::~GlobalParams() /home/yl/code/test_gpu/v2/poppler_local/poppler/GlobalParams.cc:730
#3 0x482774 in poppler::initer::~initer() /home/yl/code/test_gpu/v2/poppler_local/cpp/poppler-document.cpp:60
#4 0x489164 in poppler::initer::~initer() /home/yl/code/test_gpu/v2/poppler_local/cpp/poppler-document.cpp:116
#5 0x489164 in poppler::document_private::~document_private() /home/yl/code/test_gpu/v2/poppler_local/cpp/poppler-document.cpp:111
#6 0x4895ba in poppler::document_private::check_document(poppler::document_private*, std::__debug::vector<char, std::allocator<char> >*) /home/yl/code/test_gpu/v2/poppler_local/cpp/poppler-document.cpp:130
0x602000031190 is located 0 bytes inside of 16-byte region [0x602000031190,0x6020000311a0)
freed by thread T1 here:
#0 0x7f4e21833b2a in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99b2a)
#1 0x9613b3 in freeBuiltinFontTables() /home/yl/code/test_gpu/v2/poppler_local/poppler/BuiltinFontTables.cc:4282
previously allocated by thread T2 here:
#0 0x7f4e21833532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532)
#1 0x960faa in initBuiltinFontTables() /home/yl/code/test_gpu/v2/poppler_local/poppler/BuiltinFontTables.cc:4262
Thread T2 created by T0 here:
#0 0x7f4e217d0253 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36253)
#1 0x7f4e20480dc2 in std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xb8dc2)
Thread T1 created by T0 here:
#0 0x7f4e217d0253 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36253)
#1 0x7f4e20480dc2 in std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xb8dc2)
SUMMARY: AddressSanitizer: heap-use-after-free /home/yl/code/test_gpu/v2/poppler_local/poppler/BuiltinFont.cc:39 BuiltinFontWidths::~BuiltinFontWidths()
Сould you tell me, the poppler library is thread safe?