Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6709 Discussions

Segmentation fault in ippsInflate_8u(e9_ippsInflate_8u) in zlib 1.2.8

Igor_Z_
Beginner
319 Views

Hi! I have a problem (segfault) with multithreaded application that uses ImageMagick that uses libpng that uses zlib 1.2.8 with Intel IPP patch version 2017 update 3. I can't reproduce a crash with the same images that are processed when application had crashed. This looks like a race. Moreover when I try to inspect every coredump created by this app, I have corrupted stacktrace:

#0  0x00007f611b740720 in LWIN_COPY03byte8gas_1 ()
#1  0x00007f5f6b610730 in ?? ()
#2  0x00007f5f6b610738 in ?? ()
#3  0x00007f5f6b6106d0 in ?? ()
#4  0x00007f5f6b610798 in ?? ()
#5  0x00007f5f6b610728 in ?? ()
#6  0x00007f5f6b6106e0 in ?? ()
#7  0x000000000000001e in ?? ()
#8  0x0000000000008000 in ?? ()
#9  0x0000000000007fff in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x0000001b00000009 in ?? ()
#12 0x0000000000000102 in ?? ()
#13 0x00007f5dc49bb580 in ?? ()
#14 0x0000000000000007 in ?? ()
#15 0x0000000000000009 in ?? ()
#16 0x0000000000000001 in ?? ()
#17 0x00007f5f6b610780 in ?? ()
#18 0x00007f611b6f0bf4 in e9_ippsInflate_8u ()

My setup:

Ubuntu 14.04, zlib was built in according to readme of Intel patch

libpng12-0=1.2.54-1ubuntu2

Problem was reproduced on Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz and Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz cpus

Could this be related to the following problem: https://software.intel.com/en-us/forums/intel-integrated-performance-primitives/topic/288222 ?

Could you please help me to debug the problem?

Thanks, Igor

0 Kudos
2 Replies
Igor_Z_
Beginner
319 Views

I have more info about the problem:

in all previous attempts I ran my app with jemalloc 3.5.1. Now I run app with default glibc allocator and no more segfaults.

Looks like problem with Intel patch and jemalloc interaction.

0 Kudos
Sergey_K_Intel
Employee
319 Views

Hi Igor,

Thank you for notifying us! We fixed the similar problem in the upcoming Intel(R) IPP release (next major). May be, it will resolve your issue too.

As a workaround you can use standard allocator, or continue to use jemalloc, but to allocate "size+64" bytes. I don't know how it is done  in ImageMagick + libpng, but try to update memory allocation code to really allocate 64 bytes more.

Regards,
Sergey

0 Kudos
Reply