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

"Thomas B. Rücker" thomas at ruecker.fi
Mon Jul 21 05:49:11 PDT 2014


Hi,

On 07/18/2014 07:33 PM, Frank Lazzarini wrote:
> 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?
[…]
> # ./env/bin/python example.py test.mp3
> Using libshout version 2.3.1
> opening file test.mp3
> Segmentation fault
>

As I'm not very well versed with those things it took me a bit, but I
eventually dug out the problem. Something changed in python 2.5 (sic!),
that broke the PyArg_ParseTuple call in shout.c
(https://docs.python.org/2/c-api/arg.html#PyArg_ParseTuple).

Below is a diff of a quick-fix that works for me. Before I commit that
and roll a release, I'd like to hear though from someone well versed in
those things if it's the right-thing™ to do.

----------------------------------
Index: shout.c
===================================================================
--- shout.c (revision 19173)
+++ shout.c (working copy)
@@ -19,6 +19,7 @@
* $Id$
*/

+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <shout/shout.h>

----------------------------------


Cheers

Thomas


More information about the Icecast-dev mailing list