[dvblast-devel] get_sdt segfaulting

Georgi Chorbadzhiyski gf at unixsol.org
Sat Jan 13 20:27:24 CET 2018


On 13.01.18 21:24, Georgi Chorbadzhiyski wrote:
> On 11.01.18 15:20, Ibrahim Tachijian wrote:
>> Just cam across a transponder that is segfaulting when running get_sdt with dvblastctl.
>> Most probably some weird characters breaking things up. (also the EIT/NIT is quite huge)
>>
>> Transponder is 11538V on 28.2e
>>
>> Anyone have any idea what it might be? (I can send more logs if it helps)
>>
>> #dvblastctl -r /tmp/326.sock get_sdt
>> new SDT actual tsid=2094 version=19 onid=2
>>   * service sid=22601 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="ATN Bangla UK"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=42 value=1d0031df221efe534deede4d357182957eedaae3024d571832858d0cf2d6cd2c6ab8c16c191a7ef6e7b5
>>   * service sid=22603 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="Ahlebait TV"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=121 value=1d0111df38af4fe12adaae3013ca1a755c614832a7f44da145af211d75daeac8eab87b6e85b0e475153e1aae303a9a6a7c93d5c60a51d8d571832858dc9d75daeac8eab8c1d7c2c6ab8c14a1369ab8c14abf76d07755c60841db594b737dc57a7f0956d571809d8d4f927d571822ee2bd3f84ab6ab8c04fb55
>>   * service sid=22604 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="Xpanded TV2"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=140 value=1d00313f2afb6355c605baae3024dccd7aae305cd5718516ab8c21f71b78f5718127a755c6027b84f0f0dd16cf15aae30b6d59a5b14b786ab8c21b0d571834d5c61b56dc0be606ab8c21f7097808637430eb35b997ab8c36ad86956d571846eab8c0b6c64acd355c610fbaaf422ba2af1629b6b1f52ae3052fd57182268641b73571834bff2cb5718348218a
>>   * service sid=22605 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="HUM EUROPE"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=144 value=1d00d1df2ab57627741577ac8215e82c6ab8c1b755c60d1aae3087d5718206aad5d89dd7f618ca06ab8c1170acc050697b1aae306887c8355c611baae3087d571807ee20597dc9d75daeac8d8d52497d91d5718346f76f269ab8c14abf76c391c653586ab8c14f55c60701630792cd02c60391c2c6e4ce055c60a51eab8c1f4355c6049aae305b06469f87238ca6b0ed
>>   * service sid=22606 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="TalkingPictures"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=113 value=1d00d038b55c60cfa5b55c610f875e5ad2f0d2e8e65aff55c60d19328d8c8549005e7206acea2f86ab8c11774732155c60a5f5ceaaad5c6105aae30a2d571839eab8c2572191f55c60f7db44c954fa696df254477473735718297d738632801aae3045d674360fe94106ab8c1a46924876
>>   * service sid=22607 eit_schedule eit_pf running=4
>>     - desc 48 service type=0x1 provider="BSkyB" service="Faith World TV"
>>     - desc 49 country_availability available=1 country=GBR
>>     - desc 49 country_availability available=1 country=IRL
>>     - desc 5f private_data specifier=0x00000002
>>     - desc b2 unknown length=62 value=1d0131bf389f7f57cab55c60a51ea55c60a5faae3091d571834601d495ad9a511def797e6ae30528f215c941965f37d3ea282d5c60d3aae3075ab8c14a3a
>> Segmentation fault
> 
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  sdt_get_service (n=0 '\000', p_sdt=0x0) at /usr/local/include/bitstream/dvb/si/sdt.h:158
> 158	    uint16_t i_section_size = psi_get_length(p_sdt) + PSI_HEADER_SIZE
> (gdb) bt
> #0  sdt_get_service (n=0 '\000', p_sdt=0x0) at /usr/local/include/bitstream/dvb/si/sdt.h:158
> #1  sdt_table_print (pf_print=0x406800 <psi_print>, print_opaque=0x0, pf_iconv=0x407bf0 <psi_iconv>, iconv_opaque=0x0, i_print_type=PRINT_TEXT,
>     pp_sections=0x9bd010) at /usr/local/include/bitstream/dvb/si/sdt_print.h:76
> #2  main (i_argc=<optimized out>, ppsz_argv=<optimized out>) at dvblastctl.c:700
> 
> The problem is that SDT on this transponder is split into multiple sections
> but this is not handled currently.
> 
> I have the same transponder locally so I'll fix this in no time.
> 

Preliminary fix (which is probably wrong but it fixes the segfault).

Apply to bitstream, 'make install', then recompile dvblast.

diff --git a/dvb/si/sdt_print.h b/dvb/si/sdt_print.h
index fcf9f28..dab5b84 100644
--- a/dvb/si/sdt_print.h
+++ b/dvb/si/sdt_print.h
@@ -73,6 +73,9 @@ static inline void sdt_table_print(uint8_t **pp_sections,
         uint8_t *p_service;
         int j = 0;

+       if (p_section == NULL)
+           break;
+
         while ((p_service = sdt_get_service(p_section, j)) != NULL) {
             j++;
             switch (i_print_type) {

-- 
Georgi Chorbadzhiyski | http://georgi.unixsol.org/ | http://github.com/gfto/


More information about the dvblast-devel mailing list