Segmentation fault in ippiRotate with "nan" parameter

Segmentation fault in ippiRotate with "nan" parameter

Bild des Benutzers Hristo Hristov

Is it normal for ippiRotate to cause segmentation fault when "nan" is passed as angle? I believe it should return error and not segfault in any case... Here is the code:

#include 
#include 
#include 

void test_ippiRotate_nan_segfault()
{
    int srcWidth = 100, srcHeight = 100, srcStep;
    Ipp8u *pSrc = ippiMalloc_8u_C1(srcWidth, srcHeight, &srcStep);
    IppiSize srcSize = { srcWidth, srcHeight };
    IppiRect srcRoi = { 0, 0, srcWidth, srcHeight };

    int dstWidth = 100, dstHeight = 100, dstStep;
    Ipp8u *pDst = ippiMalloc_8u_C1(dstWidth, dstHeight, &dstStep);
    IppiRect dstRoi = { 0, 0, dstWidth, dstHeight };

    double a = std::numeric_limits<double>::quiet_NaN();
    double sx = 0, sy = 0;

    printf("call: ippiRotate_8u_C1R(... , %f %f %f) ...\\n", a, sx, sy);
    ippiRotate_8u_C1R(pSrc, srcSize, srcStep, srcRoi, pDst, dstStep, dstRoi, a, sx, sy, IPPI_INTER_LINEAR);
    printf("done: ippiRotate_8u_C1R() ...\\n");

    ippiFree(pSrc);
    ippiFree(pDst);
}

output: call: ippiRotate_8u_C1R(... , nan 0.000000 0.000000) ... Segmentation fault (core dumped) backtrace: Program terminated with signal 11, Segmentation fault. #0 0x00007fa823d52d86 in y8_ownpi_WarpAffine_L_8u_C1 () from /opt/intel/composerxe/ipp/lib/intel64/libippiy8.so.7.0 #1 0x00007fa82393862e in y8_ownpi_WarpAffine () from /opt/intel/composerxe/ipp/lib/intel64/libippiy8.so.7.0 #2 0x00007fa8235371ef in y8_ownpi_Rotate () from /opt/intel/composerxe/ipp/lib/intel64/libippiy8.so.7.0 #3 0x00007fa82346d1ea in y8_ippiRotate_8u_C1R () from /opt/intel/composerxe/ipp/lib/intel64/libippiy8.so.7.0
3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Chuck De Sylva (Intel)

Hristo,

In order to have secure behavior a check on NaN and +-INF will be added to the next version of IPP (7.1 Gold). The implementation is currently underway.

Thanks,
Chuck

Bild des Benutzers Hristo Hristov

What is planned for functions for which params are arrays or masks of doubles (for example ippiRemap() crashes in the same way if there is NaN in the map)? Do we have to check for Nan/Inf before each IPP call with floating point params in order to prevent segmentation faults? Thanks!

Melden Sie sich an, um einen Kommentar zu hinterlassen.