Opened 14 years ago

Closed 14 years ago

#161 closed defect (fixed)

source/Lib/TLibCommon/TComBitStream.cpp:203: Void TComInputBitstream::read(UInt, UInt&): Assertion `m_fifo_idx + num_bytes_to_load < m_fifo->size()' failed

Reported by: davidf Owned by:
Priority: critical Milestone: HM-3.1
Component: HM Version: HM-3.0
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

From the current HM-3.0-dev r909:

$ ./jctvc-tmuc-enc \
      -c ~/rd/project/jctvc-tmuc//cfg//encoder_lowdelay_loco.cfg \
      -c ~/rd/project/jctvc-tmuc//cfg//per-sequence/RaceHorses.cfg \
      --InputFile=RaceHorses_416x240_30.yuv \
      --FramesToBeEncoded=24 \
      --BitstreamFile=out.bit \
      --ReconFile=out.bit.yuv
...
POC    0 TId: 0 ( I-SLICE, QP 32 )      69648 bits [Y 34.1502 dB    U 37.2259 dB    V 37.6995 dB]  [ET     3 ] [L0 ] [L1 ] [MD5:d45676bcc1e6cd96ef82d840f511065d]
POC    1 TId: 0 ( B-SLICE, QP 35 )       6920 bits [Y 31.4898 dB    U 36.3927 dB    V 36.6373 dB]  [ET     6 ] [L0 0 ] [L1 0 ] [LC 0 ] [MD5:7472c8042035b256e640dd7dc7038fb1]
POC    2 TId: 0 ( B-SLICE, QP 34 )       9424 bits [Y 31.3365 dB    U 36.2060 dB    V 36.4521 dB]  [ET    10 ] [L0 1 0 ] [L1 1 0 ] [LC 1 0 ] [MD5:37d03ef12291c492d9242e93d915f34a]
POC    3 TId: 0 ( B-SLICE, QP 35 )       6920 bits [Y 30.5560 dB    U 35.7810 dB    V 35.7427 dB]  [ET    13 ] [L0 2 1 0 ] [L1 2 1 0 ] [LC 2 1 0 ] [MD5:7e0e83766c20ed94579aa51e5de26cb5]
POC    4 TId: 0 ( B-SLICE, QP 33 )      28032 bits [Y 33.3721 dB    U 36.8717 dB    V 37.2671 dB]  [ET    18 ] [L0 3 2 1 0 ] [L1 3 2 1 0 ] [LC 3 2 1 0 ] [MD5:c5f5b511f6afb74868ef7491cbfc8c4f]
POC    5 TId: 0 ( B-SLICE, QP 35 )       6056 bits [Y 31.4562 dB    U 36.1094 dB    V 36.4754 dB]  [ET    15 ] [L0 4 3 2 1 ] [L1 4 3 2 1 ] [LC 4 3 2 1 ] [MD5:ac1521d95a02577d5146836b19dc503e]
POC    6 TId: 0 ( B-SLICE, QP 34 )       9032 bits [Y 31.1916 dB    U 35.7949 dB    V 36.1372 dB]  [ET    16 ] [L0 5 4 3 2 ] [L1 5 4 3 2 ] [LC 5 4 3 2 ] [MD5:05f9be53552121d68717b0ba5a7ae5c9]
POC    7 TId: 0 ( B-SLICE, QP 35 )       7112 bits [Y 30.5432 dB    U 35.2687 dB    V 35.4717 dB]  [ET    15 ] [L0 6 5 4 3 ] [L1 6 5 4 3 ] [LC 6 5 4 3 ] [MD5:4a4a735697d182d055b9cd1eef12b1ed]
POC    8 TId: 0 ( B-SLICE, QP 33 )      31400 bits [Y 33.2649 dB    U 36.7103 dB    V 37.0140 dB]  [ET    18 ] [L0 7 6 5 4 ] [L1 7 6 5 4 ] [LC 7 6 5 4 ] [MD5:23d6785913d24eefd113f04cec0693ec]

$ ./jctvc-tmuc-dec --BitstreamFile=out.bit
...
POC    0 TId: 0 ( I-SLICE, QP 32 ) [DT  0.050] [L0 ] [L1 ] [MD5:d45676bcc1e6cd96ef82d840f511065d,(OK)]
POC    1 TId: 0 ( B-SLICE, QP 35 ) [DT  0.010] [L0 0 ] [L1 0 ] [LC 0 ] [MD5:7472c8042035b256e640dd7dc7038fb1,(OK)]
POC    2 TId: 0 ( B-SLICE, QP 34 ) [DT  0.010] [L0 1 0 ] [L1 1 0 ] [LC 1 0 ] [MD5:37d03ef12291c492d9242e93d915f34a,(OK)]
POC    3 TId: 0 ( B-SLICE, QP 35 ) [DT  0.020] [L0 2 1 0 ] [L1 2 1 0 ] [LC 2 1 0 ] [MD5:7e0e83766c20ed94579aa51e5de26cb5,(OK)]
POC    4 TId: 0 ( B-SLICE, QP 33 ) [DT  0.030] [L0 3 2 1 0 ] [L1 3 2 1 0 ] [LC 3 2 1 0 ] [MD5:c5f5b511f6afb74868ef7491cbfc8c4f,(OK)]
POC    5 TId: 0 ( B-SLICE, QP 35 ) [DT  0.020] [L0 4 3 2 1 ] [L1 4 3 2 1 ] [LC 4 3 2 1 ] [MD5:ac1521d95a02577d5146836b19dc503e,(OK)]
POC    6 TId: 0 ( B-SLICE, QP 34 ) [DT  0.020] [L0 5 4 3 2 ] [L1 5 4 3 2 ] [LC 5 4 3 2 ] [MD5:05f9be53552121d68717b0ba5a7ae5c9,(OK)]
jctvc-tmuc-dec: /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibCommon/TComBitStream.cpp:203: Void TComInputBitstream::read(UInt, UInt&): Assertion `m_fifo_idx + num_bytes_to_load < m_fifo->size()' failed.

Examining the stack trace:

#2  0x00007ffff72d37c5 in __assert_fail (assertion=0x46bcd8 "m_fifo_idx + num_bytes_to_load < m_fifo->size()", file=<value optimised out>, line=203, function=<value optimised out>) at assert.c:81
#3  0x0000000000413cd2 in TComInputBitstream::read (this=0x8de8c0, uiNumberOfBits=1, ruiBits=@0x7fffffff2730) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibCommon/TComBitStream.cpp:203                                                                                                                                                                                                                                          #4  0x0000000000413b91 in TComInputBitstream::pseudoRead (this=0x8de8c0, uiNumberOfBits=6, ruiBits=@0x7fffffff2730) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibCommon/TComBitStream.cpp:157
#5  0x0000000000453299 in TDecCavlc::parseCbfTrdiv (this=0x7fffffff44a8, pcCU=0xc7ea10, uiAbsPartIdx=128, uiTrDepth=0, uiDepth=2, uiSubdiv=@0x7fffffff27dc) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCAVLC.cpp:1922
#6  0x000000000045c4f4 in TDecEntropy::xDecodeTransformSubdiv (this=0x7fffffff4498, pcCU=0xc7ea10, uiAbsPartIdx=128, uiDepth=2, uiInnerQuadIdx=0, uiYCbfFront3=@0x7fffffff2884, uiUCbfFront3=@0x7fffffff2888, uiVCbfFront3=@0x7fffffff288c) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecEntropy.cpp:751
#7  0x000000000045d32d in TDecEntropy::decodeTransformIdx (this=0x7fffffff4498, pcCU=0xc7ea10, uiAbsPartIdx=128, uiDepth=2) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecEntropy.cpp:988
#8  0x000000000045da12 in TDecEntropy::decodeCoeff (this=0x7fffffff4498, pcCU=0xc7ea10, uiAbsPartIdx=128, uiDepth=2, uiWidth=16, uiHeight=16) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecEntropy.cpp:1164
#9  0x0000000000457666 in TDecCu::xDecodeCU (this=0x7fffffff4458, pcCU=0xc7ea10, uiAbsPartIdx=128, uiDepth=2) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCu.cpp:325
#10 0x0000000000456eae in TDecCu::xDecodeCU (this=0x7fffffff4458, pcCU=0xc7ea10, uiAbsPartIdx=128, uiDepth=1) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCu.cpp:216
#11 0x0000000000456eae in TDecCu::xDecodeCU (this=0x7fffffff4458, pcCU=0xc7ea10, uiAbsPartIdx=0, uiDepth=0) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCu.cpp:216
#12 0x0000000000456af5 in TDecCu::decodeCU (this=0x7fffffff4458, pcCU=0xc7ea10, ruiIsLast=@0x7fffffff2d4c) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCu.cpp:126
#13 0x0000000000464020 in TDecSlice::decompressSlice (this=0x7fffffff4438, pcBitstream=0x8de8c0, rpcPic=@0x7fffffffdeb0) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecSlice.cpp:105
#14 0x000000000045e3c2 in TDecGop::decompressGop (this=0x7fffffff41b0, bEos=false, pcBitstream=0x8de8c0, rpcPic=@0x7fffffffdeb0, bExecuteDeblockAndAlf=false) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecGop.cpp:176

(gdb) frame 5
#5  0x0000000000453299 in TDecCavlc::parseCbfTrdiv (this=0x7fffffff44a8, pcCU=0xc7ea10, uiAbsPartIdx=128, uiTrDepth=0, uiDepth=2,!
    uiSubdiv=@0x7fffffff27dc) at /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibDecoder/TDecCAVLC.cpp:1922
1922          m_pcBitstream->pseudoRead(6, uiSymbol);

(gdb) print m_pcBitstream->getNumBitsLeft()
$1 = 5

Change History (5)

comment:1 Changed 14 years ago by davidf

  • Version set to HM-3.0

This issue exists before the bitstream rework too.

Checkout tags/HM-3.0:
encode:

POC    0 ( I-SLICE, QP 32 )      69744 bits [Y 34.1532 dB    U 37.2637 dB    V 37.5869 dB]  [ET     2 ] [L0 ] [L1 ] [MD5:6debd2c90c4c139c9c4dbd34d6d7b4fb] 
POC    1 ( B-SLICE, QP 35 )       7112 bits [Y 31.5511 dB    U 36.2868 dB    V 36.6721 dB]  [ET     4 ] [L0 0 ] [L1 0 ] [LC 0 ] [MD5:2a82bc2deca85b9d3c9f31dd43e99872] 
POC    2 ( B-SLICE, QP 34 )       9112 bits [Y 31.3223 dB    U 36.0644 dB    V 36.3149 dB]  [ET     7 ] [L0 1 0 ] [L1 1 0 ] [LC 1 0 ] [MD5:d27070666a804f21039e7c211528441d] 
POC    3 ( B-SLICE, QP 35 )       6784 bits [Y 30.5594 dB    U 35.6881 dB    V 35.6899 dB]  [ET     9 ] [L0 2 1 0 ] [L1 2 1 0 ] [LC 2 1 0 ] [MD5:791af4bb7e9df58f7a462adc3c1b566e] 
POC    4 ( B-SLICE, QP 33 )      28392 bits [Y 33.4226 dB    U 36.8723 dB    V 37.3268 dB]  [ET    13 ] [L0 3 2 1 0 ] [L1 3 2 1 0 ] [LC 3 2 1 0 ] [MD5:65fc5689611dbf903f0bd6d3f69ab971] 
POC    5 ( B-SLICE, QP 35 )       6120 bits [Y 31.4797 dB    U 35.9854 dB    V 36.5573 dB]  [ET    11 ] [L0 4 3 2 1 ] [L1 4 3 2 1 ] [LC 4 3 2 1 ] [MD5:3cd520639abf9bd984ed0a3cc53e5f10] 
POC    6 ( B-SLICE, QP 34 )       8736 bits [Y 31.2709 dB    U 35.8697 dB    V 36.1062 dB]  [ET    11 ] [L0 5 4 3 2 ] [L1 5 4 3 2 ] [LC 5 4 3 2 ] [MD5:95fff6841974417627840301c400d003] 
POC    7 ( B-SLICE, QP 35 )       6880 bits [Y 30.6176 dB    U 35.3068 dB    V 35.4940 dB]  [ET    11 ] [L0 6 5 4 3 ] [L1 6 5 4 3 ] [LC 6 5 4 3 ] [MD5:ba9fd1a0eb5e7919688ce874cf288d01] 
POC    8 ( B-SLICE, QP 33 )      30528 bits [Y 33.2590 dB    U 36.7124 dB    V 37.0324 dB]  [ET    13 ] [L0 7 6 5 4 ] [L1 7 6 5 4 ] [LC 7 6 5 4 ] [MD5:c23e4157d1399f0cf15f50a6075a74f6] 

decode:

POC    0 ( I-SLICE, QP 32 ) [DT  0.040] [L0 ] [L1 ] [MD5:6debd2c90c4c139c9c4dbd34d6d7b4fb,(OK)] 
POC    1 ( B-SLICE, QP 35 ) [DT  0.020] [L0 0 ] [L1 0 ] [LC 0 ] [MD5:2a82bc2deca85b9d3c9f31dd43e99872,(OK)] 
POC    2 ( B-SLICE, QP 34 ) [DT  0.020] [L0 1 0 ] [L1 1 0 ] [LC 1 0 ] [MD5:d27070666a804f21039e7c211528441d,(OK)] 
POC    3 ( B-SLICE, QP 35 ) [DT  0.020] [L0 2 1 0 ] [L1 2 1 0 ] [LC 2 1 0 ] [MD5:791af4bb7e9df58f7a462adc3c1b566e,(OK)] 
POC    4 ( B-SLICE, QP 33 ) [DT  0.030] [L0 3 2 1 0 ] [L1 3 2 1 0 ] [LC 3 2 1 0 ] [MD5:65fc5689611dbf903f0bd6d3f69ab971,(OK)] 
POC    5 ( B-SLICE, QP 35 ) [DT  0.020] [L0 4 3 2 1 ] [L1 4 3 2 1 ] [LC 4 3 2 1 ] [MD5:3cd520639abf9bd984ed0a3cc53e5f10,(OK)] 
POC    6 ( B-SLICE, QP 34 ) [DT  0.020] [L0 5 4 3 2 ] [L1 5 4 3 2 ] [LC 5 4 3 2 ] [MD5:95fff6841974417627840301c400d003,(OK)] 
POC    7 ( B-SLICE, QP 35 ) [DT  0.020] [L0 6 5 4 3 ] [L1 6 5 4 3 ] [LC 6 5 4 3 ] [MD5:ba9fd1a0eb5e7919688ce874cf288d01,(OK)] 
POC    8 ( B-SLICE, QP 33 ) [DT  0.030] [L0 7 6 5 4 ] [L1 7 6 5 4 ] [LC 7 6 5 4 ] [MD5:c23e4157d1399f0cf15f50a6075a74f6,(OK)] 

revert r574:
decode:

POC    0 ( I-SLICE, QP 32 ) [DT  0.040] [L0 ] [L1 ] [MD5:6debd2c90c4c139c9c4dbd34d6d7b4fb,(OK)] 
POC    1 ( B-SLICE, QP 35 ) [DT  0.020] [L0 0 ] [L1 0 ] [LC 0 ] [MD5:2a82bc2deca85b9d3c9f31dd43e99872,(OK)] 
jctvc-tmuc-dec: /users/davidf/rd/project/jctvc-tmuc/source/Lib/TLibCommon/TComBitStream.cpp:159: Void TComBitstream::pseudoRead(UInt, UInt&): Assertion `0' failed.
POC    2 ( B-SLICE, QP 34 ) [DT  0.020] [L0 1 0 ] [L1 1 0 ] [LC 1 0 ] [MD5:d27070666a804f21039e7c211528441d,(OK)] Command terminated by signal 6

comment:2 Changed 14 years ago by davidf

  • Resolution set to fixed
  • Status changed from new to closed

This has been resolved in r919.

An alternative solution would be to rewrite the users of pseudoRead to use read(), consuming only sufficient bits for each part of the vlc decoding. That said, this is somewhat mitigated by the explicit use of pseudoRead not changing the stream state at all -- any bits chosen must be later consumed by read(), so an overrun would still be detected.

comment:3 Changed 13 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:4 Changed 13 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:5 Changed 13 years ago by davidf

  • Cc jct-vc@… added
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Reporter, Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Always)