piratfm / eti-tools

ETI conversion software
Mozilla Public License 2.0
53 stars 18 forks source link

Segfault in ni2http after longer time of operation #2

Closed mistrey closed 8 years ago

mistrey commented 9 years ago

Hi,

I'm using ni2http with dab2eti with the German national DAB multiplex: dab2eti 178352000 | ni2http -c /home/strey/Software/eti-tools/ni2http.conf

ni2http.conf contains all services of this ensemble and feeds them to Icecast2.

From time to time the whole process stops with a segfault message. Here is an excerpt form my system log: [strey@mischka ~]$ journalctl --no-pager | grep ni2http Nov 12 13:30:19 mischka kernel: ni2http[2528]: segfault at 10d157a6 ip 0000000000403d63 sp 00007fff23cbc8d0 error 4 in ni2http[400000+14000] Nov 12 13:30:19 mischka systemd-coredump[6880]: Process 2528 (ni2http) of user 1000 dumped core. Nov 12 16:03:43 mischka kernel: ni2http[15521]: segfault at 7cd6c585 ip 0000000000403d63 sp 00007ffe97186480 error 4 in ni2http[400000+14000] Nov 12 16:03:43 mischka systemd-coredump[31377]: Process 15521 (ni2http) of user 1000 dumped core. Nov 12 16:11:56 mischka kernel: ni2http[6524]: segfault at a8f000 ip 0000000000406593 sp 00007fff4892e1a0 error 4 in ni2http[400000+14000] Nov 12 16:11:56 mischka systemd-coredump[6777]: Process 6524 (ni2http) of user 1000 dumped core. Nov 12 16:27:04 mischka kernel: ni2http[17425]: segfault at 2090000 ip 0000000000406593 sp 00007ffc2f68eb40 error 4 in ni2http[400000+14000] Nov 12 16:27:04 mischka systemd-coredump[21449]: Process 17425 (ni2http) of user 1000 dumped core. Nov 12 17:02:43 mischka kernel: ni2http[22844]: segfault at ffffffffcc54cff2 ip 0000000000403d63 sp 00007ffe4abb2280 error 5 in ni2http[400000+14000] Nov 12 17:02:43 mischka systemd-coredump[25456]: Process 22844 (ni2http) of user 1000 dumped core. Nov 12 21:06:01 mischka kernel: ni2http[21072]: segfault at c007386a ip 0000000000403d63 sp 00007ffc37a58900 error 4 in ni2http[400000+14000] Nov 12 21:06:01 mischka systemd-coredump[29598]: Process 21072 (ni2http) of user 1000 dumped core.

Best regards Michael

piratfm commented 9 years ago

Can You run ni2http with gdb wrapper, like this: dab2eti 178352000 | gdb --args ni2http -c /home/strey/Software/eti-tools/ni2http.conf

then in gdb console enter "r", like (gdb) r

and wait until application crash, so after it crashes gdb will show again it's console, and enter "bt" (gdb) bt

So, the faulty function will be known.

mistrey commented 9 years ago

On Do, 2015-11-12 at 23:21, piratfm wrote:

Can You run ni2http with gdb wrapper, like this: dab2eti 178352000 | gdb --args ni2http -c /home/strey/Software/eti-tools/ni2http.conf

then in gdb console enter "r", like (gdb) r

It doesn't work this way with gdb after the pipe. But I have recorded a 2 GByte ETI file and just running the following command:

gdb --args ni2http --delay -c /home/strey/Software/eti-tools/ni2http.conf -i eti-dab_deutschland-20151113.eni

I'm just listening to Radio ENERGY from 3 hours ago and hoping for the fault to occur. Thank you for this nice piece of software and your support!

Best regards Michael

mistrey commented 9 years ago

On Do, 2015-11-12 at 23:21, piratfm wrote:

[...]

and wait until application crash, so after it crashes gdb will show again it's console, and enter "bt" (gdb) bt

So, the faulty function will be known.

Here we go:

,---- ... INFO: chan[53808] song: Grnstreifen mit Dominik Schottner - "Fader" von The Temper Trap INFO: chan[5596] song: Paul Oakenfold ft. Angela McCluskey mit You Could Be Happy (Radio Edit) auf sunshine live // electronic music radio - digital INFO: chan[53792] song: Deutschlandradio Kultur - Das Feuilleton im Radio ERROR: failed to send data to server for SID 53792.
ERROR: libshout: Socket error.
Program received signal SIGSEGV, Segmentation fault.
0x0000000000403d63 in process_dabplus (data_ptr=0x7fffffffccf4 "E.\200\001\240\t\", data_len=336, chan=0x61e480) at ni2http.c:701
701 *(chan->dabplus_data + au_start[i] + au_size[i] - 2) ^= 0xff;
(gdb) bt
#0 0x0000000000403d63 in process_dabplus (data_ptr=0x7fffffffccf4 "E.\200\001\240\t\", data_len=336, chan=0x61e480) at ni2http.c:701
#1 0x0000000000404282 in process_stc (msc_ptr=0x7fffffffc784 "^뾃k\254 \017\217\373z\275\002O\235\374\f\357\357\312\340Ur\300",
stc_ptr=0x7fffffffc6d8 "\b", idx=6, prev_len=174) at ni2http.c:791
#2 0x0000000000404fa0 in main (i_argc=6, ppsz_argv=0x7fffffffe048) at ni2http.c:1118
(gdb)

`----

Best regards Michael

mistrey commented 9 years ago

(gdb) bt full

0 0x0000000000403d63 in process_dabplus (data_ptr=0x7fffffffccf4 "E.\200\001\240\t\", data_len=336, chan=0x61e480) at ni2http.c:701

    austab = {4, 2, 6, 3}
    sp = {rfa = 0, dac_rate = 0, sbr_flag = 0, ps_flag = 1900544, aac_channel_mode = 1, mpeg_surround_config = 0}
    au_start = {27397100, 218110984, 57570, 0, 0, 0}
    au_size = {-1292257327, 1434535114, 8430904, -268042240, 1006763933, 1213388056}
    num_aus = 3
    s = 14
    cbuf = "?\350\277\002\204\031g\375\062\061l'V\240\034Q\a\264\245<\326X\272,\337Ġ#ր\f9Z\224\022t7\306bD\332P\203y\272\251\207_\241\200\361\241֍\344c8~\301\205\251\300\373\242\320\337ߺ\n\347\345<\213\000\350\342\000\000\060?\361\016\000\362\205$\205\r\370_``\243\267\231\322d^\v\215\000\374ߏ&\374\274\372\000\027lD\221\375s\226\001\250\303%"
    audio_super_frame_size = 1540
    i = 1
    j = 110

1 0x0000000000404282 in process_stc (msc_ptr=0x7fffffffc784 "^뾃k\254|\017\217\373z\275\002O\235\374\f\357\357\312\340Ur\300",

stc_ptr=0x7fffffffc6d8 "\b", idx=6, prev_len=174) at ni2http.c:791
    data_ptr = 0x7fffffffccf4 "E.\200\001\240\t\"
    data_len = 336
    sstc = {{{stl = 42, tpl = 33, sad = 590, scid = 11}, val = 776897578}}
    chan = 0x61e480

2 0x0000000000404fa0 in main (i_argc=6, ppsz_argv=0x7fffffffe048) at ni2http.c:1118

    len = 174
    ficl = 24 '\030'
    stc_ptr = 0x7fffffffc6d8 "\b"
    msc_ptr = 0x7fffffffc784 "^뾃k\254|\017\217\373z\275\002O\235\374\f\357\357\312\340Ur\300"
    idx = 6
    i = 128
    c = -1
    list = 0
    config_parsed = 1
    delay = 1
    inputfile = 0x617010
    long_options = {{name = 0x40dc35 "input", has_arg = 1, flag = 0x0, val = 105}, {name = 0x40dc3b "config", has_arg = 1, flag = 0x0, val = 99}, 
      {name = 0x40dc42 "delay", has_arg = 0, flag = 0x0, val = 100}, {name = 0x40dc48 "list", has_arg = 0, flag = 0x0, val = 108}, {name = 0x0, 
        has_arg = 0, flag = 0x0, val = 0}}
    bytes_readed = 6144
    p_ni_search_block = "\377\a:\266\360\222K%\b\000\210\033\f6\210\033\020l\210\033\024\242\210\022\030ƈ\033)\332D0.N\204_2\276\204$7\036\204\022;N\210\tP\374\210\033U2\210\033Yh\210\033y\236\210\003}\244\210\006\201\260\210\003\205\266\210\006\211\302\210\003\377\377\033\224\035\b\322@\002\200\001\322\060\001\200\001\322 \001\200\001\322\020\001\200\001\322@\000\r\322\060\000\f\276\261\032\003\002\060\005|\001\002\000\005\210\002\002\020\005\204\001\002 \005\200\003\002@<x\004\377\000\000g\360\b\"\340\321\020\274\001\300\222\020\002\025\334\001?V\320\034\001?\026\032d\001?\n\377\000\000\000\263\310^뾃k\254|\017\217\373z\275\002O\235\374\f\357\357\312\340Ur\300"...
    sync_byte = 3057256447
    sync_found = 1
    total_readed = 1400580096
    fc = {{{fl = 805, mid = 1, fp = 2, nst = 18, ficf = 1, fct = 240}, val = 4036119333}}
    count = 227959
    diff1 = {tv_sec = 0, tv_usec = 23222}
    diff2 = {tv_sec = 0, tv_usec = 778}
    startTV = {tv_sec = 1447424891, tv_usec = 65246}
    endTV = {tv_sec = 1447424891, tv_usec = 65246}

(gdb)

piratfm commented 8 years ago

Please, check latest ni2http. The error was appeared when there is no actual aac data inside the superframe. Now app simply ignores such frames.

mistrey commented 8 years ago

Just tried the update. Seems to work. The recorded ETI file runs through until its end. Thank you!