karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
297 stars 105 forks source link

Segfault when calling fallback-mount combined with limit-rate #425

Open glitch59 opened 12 months ago

glitch59 commented 12 months ago

Calling a mountpont that is offline, but has a fallback-mount set, does not work. Icecast simply shows a 404 not found page.

When adding limit-rate to the mount, Icecast segfault immediately. See attaches file for valgrind dump of the crash.

Icecast version: Icecast 2.4.0-kh22

Mount definition:

<mount type="normal">
    <mount-name>/mountname.mp3</mount-name>
    <password>hackme</password>
    <fallback-mount>/fallback/sounds/fallback.mp3</fallback-mount>
    <fallback-override>1</fallback-override>
    <limit-rate>160k</limit-rate>
    <authentication type="url">
      <option name="allow_duplicate_users" value="0"/>
      <option name="realm" value="Livesets"/>
      <option name="mount_add" value="http://url/mount/add/1"/>
      <option name="mount_remove" value="http://url/mount/remove/1"/>
      <option name="listener_add" value="http://url/listener/add/1"/>
      <option name="listener_remove" value="http://url/listener/remove/1"/>
    </authentication>
  </mount>

dmesg output:

[Wed Jul  5 17:11:24 2023] traps: ShoutOutput 'De[133623] general protection fault ip:7f8eecaa64d3 sp:7f8da2ffc548 error:0 in libogg.so.0.8.4[7f8eecaa6000+5000]
[Wed Jul  5 17:22:42 2023] traps: ShoutOutput 'De[148720] general protection fault ip:7f00eff454d3 sp:7effcd71b548 error:0 in libogg.so.0.8.4[7f00eff45000+5000]
[Wed Jul  5 17:33:05 2023] traps: ShoutConnection[166665] general protection fault ip:7fad6d3764d3 sp:7fac197f9548 error:0 in libogg.so.0.8.4[7fad6d376000+5000]
[Wed Jul  5 17:41:22 2023] icecast[169110]: segfault at 20 ip 00007f52c0aeaa30 sp 00007fff8b03d8b8 error 4 in libc.so.6[7f52c0a83000+155000]
[Wed Jul  5 17:41:22 2023] Code: 92 0f 84 89 fd ff ff 8d 48 26 83 f8 da 72 93 48 b8 09 00 00 08 2c 00 00 00 48 d3 e8 a8 01 74 82 e9 6b fd ff ff 0f 1f 44 00 00 <8b> 47 10 89 c2 81 e2 7f 01 00 00 a8 7c 75 51 48 83 ec 08 85 d2 75

Valigrind dump: valgrind.log

karlheyes commented 12 months ago

thanks for the report. It's a null deref which occurs as the client is no longer on the workers when a 404 occurs in auth.

The fix should now be in the master tree and looks to be working for the above cases and if you specify

<fallback rate="160k">/fallback.mp3</fallback>

karl

glitch59 commented 12 months ago

Hi Karl, thanks for the fast reply. I have retested with the latest master version and the issue is indeed resolved. Thanks a lot for your support. Best regards, Sven.