[Icecast-dev] python-shout 0.2.1 with icecast 2.4.0 segfaults

Frank Lazzarini flazzarini at gmail.com
Fri Jul 18 12:33:00 PDT 2014


Hi there,

I am trying to use python-shout 0.2.1 to broadcast to a icecast 2.4.0
server, which result in a segmentation fault and I can't understand why. Is
anyone else experiencing this problem?

Here is the config that I use with icecast 2.4.0.

<icecast>
    <limits>
        <clients>100</clients>
        <sources>2</sources>
        <threadpool>5</threadpool>
        <queue-size>524288</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-on-connect>1</burst-on-connect>
        <burst-size>65535</burst-size>
    </limits>

    <authentication>
        <source-password>passwood</source-password>
        <relay-password>passwood</relay-password>
        <admin-user>admin</admin-user>
        <admin-password>passwood</admin-password>
    </authentication>

    <hostname>thinkpad</hostname>

    <listen-socket>
        <port>8000</port>
    </listen-socket>

    <mount>
        <mount-name>/jukebox.ogg</mount-name>
        <username>source</username>
        <password>passwood</password>
        <max-listeners>10</max-listeners>
        <burst-size>>65536</burst-size>
        <hidden>1</hidden>
        <no-yp>1</no-yp>
    </mount>
    <fileserve>1</fileserve>
    <paths>
        <basedir>/usr/share/icecast2</basedir>
        <logdir>/var/log/icecast</logdir>
        <webroot>/usr/share/icecast2/web</webroot>
        <adminroot>/usr/share/icecast2/admin</adminroot>
        <alias source="/" dest="/status.xsl"/>
    </paths>

    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>
        <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
        <logsize>10000</logsize> <!-- Max size of a logfile -->
    </logging>

    <security>
        <chroot>0</chroot>
    </security>
</icecast>

# sudo -u nobody icecast -c /etc/icecast.xml

I use the example.py which is included in python-shout package to test the
broadcast, which result in the following.

#!/usr/bin/env python

# usage: ./example.py /path/to/file1 /path/to/file2 ...
import shout
import sys
import string
import time

s = shout.Shout()
print "Using libshout version %s" % shout.version()

s.host = 'localhost'
s.password = 'passwood'
s.mount = "/jukebox.ogg"
s.open()

total = 0
st = time.time()
for fa in sys.argv[1:]:
    print "opening file %s" % fa
    f = open(fa)
    s.set_metadata({'song': fa})

    nbuf = f.read(4096)
    while 1:
        buf = nbuf
        nbuf = f.read(4096)
        total = total + len(buf)
        if len(buf) == 0:
            break
        s.send(buf)
        s.sync()
    f.close()

    et = time.time()
    br = total*0.008/(et-st)
    print "Sent %d bytes in %d seconds (%f kbps)" % (total, et-st, br)

print s.close()

# ./env/bin/python example.py test.mp3
Using libshout version 2.3.1
opening file test.mp3
Segmentation fault

-- 

*Frank Lazzarini*
*Email:* flazzarini at gmail.com  *Phone:* +352 621 314 430
*Blog:*   http://www.gefoo.org   *LinkedIn:*
http://www.linkedin.com/pub/frank-lazzarini/1a/a30/112
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20140718/23dd4f14/attachment.htm 


More information about the Icecast-dev mailing list