Segmentation fault when applying the "--no-wpp"

Issue #113 resolved
bujyu created an issue

I met the problem that when i applying the option "--no-wpp" and preset was ultrafast, superfast or veryfast,

the execution would crash and display "Segmentation fault", I didn't meet this problem in version 1.4+222-5f9f7194267b.

The log of info as follow ( preset was ultrafast ) :

$ x265 --input ./sequence/BasketballDrive_1920x1080_50.yuv --output ./Basketball.x265 -input-res 1920x1080 --fps 50 --preset ultrafast --no-wpp

yuv [info]: 1920x1080 fps 50000/1000 i420p8 frames 0 - 500 of 501

x265 [info]: HEVC encoder version 1.5+219-db86567c3f5c

x265 [info]: build info [Linux][GCC 4.8.2][64 bit] 8bpp

x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX

x265 [info]: Main profile, Level-4.1 (Main tier)

x265 [info]: frame threads / pool features : 17 / none

Segmentation fault

Comments (13)

  1. Deepthi Nandakumar

    Thanks - can you check the commits right after this revision? We found and fixed this just today :)

  2. bujyu reporter

    I update to version 1.5+221-b931c50d5501,

    but it was still crash and display "Segmentation fault"...

  3. bujyu reporter

    Dual Intel Xeon E5-2670 v2, and I had test on different machine which has dual Intel Xeon E5-2620

  4. Deepthi Nandakumar

    Thanks, we have X265_MAX_FRAME_THREADS set to 16. And if you aren't setting this from the commandline, can you step through and see what causes 17 frame threads to be printed (if not created)?

  5. bujyu reporter

    Like this? "DEBUG OUPUT" is to monitor the variable in encoder/encoder.cpp

    $ x265 --input ./sequence/BasketballDrive_1920x1080_50.yuv --output ./Basketball.x265 --input-res 1920x1080 --fps 50 --preset ultrafast --no-wpp

    yuv [info]: 1920x1080 fps 50000/1000 i420p8 frames 0 - 500 of 501

    x265 [info]: HEVC encoder version 1.5+221-b931c50d5501

    x265 [info]: build info [Linux][GCC 4.4.7][64 bit] 8bpp

    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX

    x265 [info]: Main profile, Level-4.1 (Main tier)

    DEBUG OUTPUT encoder.cpp:112 : frame thread = 0

    DEBUG OUTPUT encoder.cpp:118 : CPU count = 40

    DEBUG OUTPUT encoder.cpp:119 : rows = 34

    DEBUG OUTPUT encoder.cpp:134 : frame thread = 17

    x265 [info]: frame threads / pool features : 17 / none

    Segmentation fault (core dumped)

  6. bujyu reporter

    I think the problem is caused by the size of m_frameEncoder.

    In version 1.4+222-5f9f7194267b, the m_frameEncoder allocated at encoder.cpp and the size was m_param->frameNumThreads.

    But in version 1.5+219-db86567c3f5c, the m_frameEncoder allocated at encoder.h and the size was X265_MAX_FRAME_THREADS ( it defined at x265.h and was 16 )

    So, if any loop condition was "0 < m_param->frameNumThreads".

    the index would be out of range and caused the Segment fault

  7. Log in to comment