Opened 5 years ago

Closed 5 years ago

#192 closed defect (fixed)

Crash (Seg fault) at getAffineMergeCand() — at Version 5

Reported by: mafonso Owned by:
Priority: critical Milestone: VTM-5.1
Component: VTM Version: VTM-4.0
Keywords: Cc: ksuehring, XiangLi, fbossen, jvet@…

Description (last modified by ksuehring)

Crash happens when encoding a low resolution 640x360 sequence using VTM 4.0, commit 2411a1a3da from Feb 15.

In Lib/CommonLib/Picture.h poc is uninitialized.

Error log:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x6c)
    frame #0: 0x0000000100148d5c EncoderApp`Picture::getPOC(this=0x0000000000000000) const at Picture.h:235
   232 	  void extendPicBorder();
   233 	  void finalInit( const SPS& sps, const PPS& pps );
   234
-> 235 	  int  getPOC()                               const { return poc; }
   236 	  void setBorderExtension( bool bFlag)              { m_bIsBorderExtended = bFlag;}
   237 	  Pel* getOrigin( const PictureType &type, const ComponentID compID ) const;
   238
Target 0: (EncoderApp) stopped.

BT:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x6c)
* frame #0: 0x0000000100148d5c EncoderApp`Picture::getPOC(this=0x0000000000000000) const at Picture.h:235
* frame #1: 0x000000010019e3ad EncoderApp`PU::getAffineMergeCand(pu=0x00007ffeefbf9360, affMrgCtx=0x00007ffeefbf9910, mrgCandIdx=-1) at UnitTools.cpp:3811
* frame #2: 0x00000001002b0911 EncoderApp`EncCu::xCheckRDCostAffineMerge2Nx2N(this=0x00000001007d8218, tempCS=0x00007ffeefbfac40, bestCS=0x00007ffeefbfac38, partitioner=0x0000000109100050, encTestMode=0x00007ffeefbfa4c8) at EncCu.cpp:3017
* frame #3: 0x00000001002aa4fc EncoderApp`EncCu::xCompressCU(this=0x00000001007d8218, tempCS=0x00007ffeefbfac40, bestCS=0x00007ffeefbfac38, partitioner=0x0000000109100050, tempMotCandLUTs=0x00007ffeefbfac30, bestMotCandLUTs=0x00007ffeefbfac28) at EncCu.cpp:841
* frame #4: 0x00000001002a8b02 EncoderApp`EncCu::compressCtu(this=0x00000001007d8218, cs=0x0000000105ff7000, area=0x00007ffeefbfafc8, ctuRsAddr=0, prevQP=0x00007ffeefbfb308, currQP=0x00007ffeefbfb300) at EncCu.cpp:445
* frame #5: 0x00000001003542a5 EncoderApp`EncSlice::encodeCtus(this=0x00000001007d7388, pcPic=0x0000000105ff6a00, bCompressEntireSlice=false, bFastDeltaQP=false, startCtuTsAddr=0, boundingCtuTsAddr=15, pEncLib=0x000000010076dd48) at EncSlice.cpp:1673
* frame #6: 0x0000000100351593 EncoderApp`EncSlice::compressSlice(this=0x00000001007d7388, pcPic=0x0000000105ff6a00, bCompressEntireSlice=false, bFastDeltaQP=false) at EncSlice.cpp:1386
* frame #7: 0x00000001002e2dbf EncoderApp`EncGOP::compressGOP(this=0x00000001007d6f08, iPOCLast=64, iNumPicRcvd=16, rcListPic=size=24, rcListPicYuvRecOut=size=17, isField=false, isTff=false, snr_conversion=IPCOLOURSPACE_UNCHANGED, printFrameMSE=false, isEncodeLtRef=false) at EncGOP.cpp:2330
* frame #8: 0x0000000100310c5d EncoderApp`EncLib::encode(this=0x000000010076dd48, flush=false, pcPicYuvOrg=0x00007ffeefbfea90, cPicYuvTrueOrg=0x00007ffeefbfeb00, snrCSC=IPCOLOURSPACE_UNCHANGED, rcListPicYuvRecOut=size=17, iNumEncoded=0x00007ffeefbfeb7c) at EncLib.cpp:600
* frame #9: 0x000000010000a8aa EncoderApp`EncApp::encode(this=0x0000000100769000) at EncApp.cpp:711
* frame #10: 0x0000000100083778 EncoderApp`main(argc=24, argv=0x00007ffeefbff678) at encmain.cpp:153
* frame #11: 0x00007fff6dbb8015 libdyld.dylib`start + 1
* frame #12: 0x00007fff6dbb8015 libdyld.dylib`start + 1

Change history (6)

comment:1 Changed 5 years ago by XiangLi

Please provide detailed encoding settings (including cfg files if non CTC conditions) and logs so that we can duplicate the issue. Thanks.

Changed 5 years ago by mafonso

Log file of the encode

comment:2 Changed 5 years ago by fbossen

Mariana: thanks for providing the log file. Could you please also provide the command line that was used when invoking the encoder? Tried a bunch of 360p encodes here, but haven't been able to reproduce the issue.

comment:3 Changed 5 years ago by mafonso

Sure. Here are a few more details.

Encoder settings:

EncoderApp -i MarketPlace_640x360_60fps_10bit_420.yuv -c ./cfg/encoder_randomaccess_vtm.cfg -b MarketPlace_640x360_60fps_10bit_420.bin -o /dev/null -f 128 -wdt 640 -hgt 360 -fr 60 --InputBitDepth=10 --InternalBitDepth=10 --IntraPeriod=64 --ConformanceWindowMode=1 -q 48 --DecodingRefreshType=2

Source file of MarketPlace at 640x360 was obtained by rescaling using ffmpeg:

ffmpeg -y -f rawvideo -s:v 1920x1080 -pix_fmt yuv420p10le -r 60 -i MarketPlace_1920x1080_60fps_10bit_420.yuv -sws_flags lanczos -strict -1 -f rawvideo -s:v 640x360 -pix_fmt yuv420p10le -r 60 MarketPlace_640x360_60fps_10bit_420.yuv

comment:4 Changed 5 years ago by fbossen

Thanks for the additional details. The issue here seems to be related to the use of --DecodingRefreshType=2 which isn't properly implemented.
Workarounds include:

  • use --DecodingRefreshType=1, but this will encode a CRA instead of an IDR for frame 64
  • encode 2 segments of 64 frames instead of 1 segment of 128 frames and concatenate the bit streams

comment:5 Changed 5 years ago by ksuehring

  • Description modified (diff)
  • Milestone set to VTM-5.1
  • Resolution set to fixed
  • Status changed from new to closed

A fix was submitted as MR 586

https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM/merge_requests/586

and was merged to master.

Please test again an re-open if any issues remain.

Note: See TracTickets for help on using tickets.