[x265] Issue #558: SEGV on unknown address 0x0000000002a4 at x265::MotionEstimate::motionEstimate (multicoreware/x265)

Kittywhiskers Van Gogh issues-reply at bitbucket.org
Wed Jul 8 08:31:03 CEST 2020


New issue 558: SEGV on unknown address 0x0000000002a4 at x265::MotionEstimate::motionEstimate
https://bitbucket.org/multicoreware/x265/issues/558/segv-on-unknown-address-0x0000000002a4-at

Kittywhiskers Van Gogh:

* **Operating System:** macOS Catalina 10.15.5
* `ffmpeg` configuration:

```
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3-with-options_2 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --disable-libjack --disable-indev=jack --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-chromaprint --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libgme --enable-libgsm --enable-libmodplug --enable-libopenh264 --enable-libopenjpeg --enable-librav1e --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtesseract --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-openssl --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
```

* **Install script:** [A custom script for installing ffmpeg with all possible options](https://github.com/kittywhiskers/ffmpegScripts/blob/master/ffmpegSetupMacOS.sh) **\(note, running** `brew upgrade` after running this script does break `ffmpeg` due to mismatched library versions\)
* **Script run:** [A custom script for compounding compression artifacts](https://github.com/kittywhiskers/ffmpegScripts/blob/master/ffmpegDecompose.sh)
* **Expected Behavior:** Successful conversion
* **Actual Behavior:**

@slhck

Reproduced with newly available footage \(to eliminate the possibility of corrupt footage, checked with `ffprobe` before starting instance\)

```
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3-with-options_2 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --disable-libjack --disable-indev=jack --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-chromaprint --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libgme --enable-libgsm --enable-libmodplug --enable-libopenh264 --enable-libopenjpeg --enable-librav1e --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtesseract --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-openssl --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'c306c7a7-1969-492f-9ff1-c6d92cd44742/31.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.45.100
  Duration: 00:03:04.62, start: 0.000000, bitrate: 249 kb/s
    Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 114 kb/s, 24 fps, 24 tbr, 12288 tbn, 24 tbc (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.4
x265 [info]: build info [Mac OS X][clang 11.0.3][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 16 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 4 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 24 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-50.0 / 0.60
x265 [info]: tools: rect limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: rskip mode=1 signhide tmvp strong-intra-smoothing lslices=4
x265 [info]: tools: deblock sao
Output #0, mp4, to 'c306c7a7-1969-492f-9ff1-c6d92cd44742/32.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: hevc (libx265) (hev1 / 0x31766568), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
      encoder         : Lavc58.91.100 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.91.100 aac
UndefinedBehaviorSanitizer:DEADLYSIGNAL8kB time=00:00:38.03 bitrate= 165.4kbits/s speed=0.595x
==56318==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x0000000002a4 (pc 0x00010acb8257 bp 0x7000035236a0 sp 0x7000035223e0 T6543552)
==56318==The signal is caused by a READ memory access.
==56318==Hint: address points to the zero page.
    #0 0x10acb8256 in x265::MotionEstimate::motionEstimate(x265::ReferencePlanes*, x265::MV const&, x265::MV const&, x265::MV const&, int, x265::MV const*, int, x265::MV&, unsigned int, unsigned char*) (libx265.192.dylib:x86_64+0x24256)
    #1 0x10acac0db in x265::Search::predInterSearch(x265::Mode&, x265::CUGeom const&, bool, unsigned int*) (libx265.192.dylib:x86_64+0x180db)
    #2 0x10aca04b5 in x265::Analysis::checkInter_rd0_4(x265::Mode&, x265::CUGeom const&, x265::PartSize, unsigned int*) (libx265.192.dylib:x86_64+0xc4b5)
    #3 0x10ac989b2 in x265::Analysis::compressInterCU_rd0_4(x265::CUData const&, x265::CUGeom const&, int) (libx265.192.dylib:x86_64+0x49b2)
    #4 0x10ac981dc in x265::Analysis::compressInterCU_rd0_4(x265::CUData const&, x265::CUGeom const&, int) (libx265.192.dylib:x86_64+0x41dc)
    #5 0x10ac981dc in x265::Analysis::compressInterCU_rd0_4(x265::CUData const&, x265::CUGeom const&, int) (libx265.192.dylib:x86_64+0x41dc)
    #6 0x10ac963e0 in x265::Analysis::compressCTU(x265::CUData&, x265::Frame&, x265::CUGeom const&, x265::Entropy const&) (libx265.192.dylib:x86_64+0x23e0)
    #7 0x10acc9345 in x265::FrameEncoder::processRowEncoder(int, x265::ThreadLocalData&) (libx265.192.dylib:x86_64+0x35345)
    #8 0x10acc88d1 in x265::FrameEncoder::processRow(int, int) (libx265.192.dylib:x86_64+0x348d1)
    #9 0x10b09ab67 in x265::WaveFront::findJob(int) (libx265.192.dylib:x86_64+0x406b67)
    #10 0x10b099d9f in x265::WorkerThread::threadMain() (libx265.192.dylib:x86_64+0x405d9f)
    #11 0x10b099c7e in x265::ThreadShim(void*) (libx265.192.dylib:x86_64+0x405c7e)
    #12 0x7fff6be70108 in _pthread_start (libsystem_pthread.dylib:x86_64+0x6108)
    #13 0x7fff6be6bb8a in thread_start (libsystem_pthread.dylib:x86_64+0x1b8a)

==56318==Register values:
rax = 0x000000000000002d  rbx = 0xfffffffffffffed4  rcx = 0x000001930000002c  rdx = 0x00007000035213a0
rdi = 0x00007fd6fdc61a80  rsi = 0x0000000000000020  rbp = 0x00007000035236a0  rsp = 0x00007000035223e0
 r8 = 0x0000000000000060   r9 = 0x0000000000000018  r10 = 0x00000000000002a0  r11 = 0x00007000035213c8
r12 = 0x000000000000002e  r13 = 0x000000010bb38f00  r14 = 0x0000000000000004  r15 = 0x0000000000000003
UndefinedBehaviorSanitizer can not provide additional info.
==56318==ABORTING
./ffmpegDecompose.sh: line 41: 56318 Abort trap: 6           "/usr/local/bin/ffmpeg" -y -i "$1" -c:v libx265 -preset slow -c:a aac -x265-params crf="$DECOMPOSITION_CRF_VALUE" "$2"
```

* The computer has 32GB of RAM with little memory pressure, this happened unexpectedly so I don't have a memdump

‌




More information about the x265-devel mailing list