segfault with IceS2 (looks like use-after-free() in libshout)
I was running two ices-2 in parallel, and one of the two crashed. The other, as well as Icecast are still running fine.
This is on OpenBSD 3.8 (i386), which contains some interesting changes to malloc(). Misbehaving software gets a SIGSEGV here, while on other systems, the same bug might only occasionally cause a seemingly random crash. It is explained at http://marc.theaimsgroup.com/?l=openbsd-misc&m=112475373731469&w=2
Versions are ices-2.0.1, libshout-2.1 and icecast-2.3.0.
The tail of the ices.log:
[2005-10-17 07:37:53] INFO playlist-builtin/playlist_read Currently playing "/home/maxx/mp3-stream/Midnight_Oil_-_Blue_Sky_Mine.ogg"
[2005-10-17 07:37:53] DBUG encode/encode_clear Clearing encoder engine
[2005-10-17 07:37:53] DBUG reencode/reencode_page Reinitialising reencoder for new logical stream
[2005-10-17 07:37:53] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channel(s), 44100 Hz, quality 1.500000
[2005-10-17 07:40:53] EROR stream/ices_instance_stream Send error: Socket error (Broken pipe)
[2005-10-17 07:40:53] DBUG input/input_flush_queue Input queue flush requested
[2005-10-17 07:40:53] WARN stream/ices_instance_stream Trying reconnect after server socket error
[2005-10-17 07:40:53] INFO signals/signal_hup_handler Flushing logs
[2005-10-17 07:40:53] INFO playlist-builtin/event_handler Moving to next file in playlist.
[2005-10-17 07:40:53] INFO playlist-builtin/playlist_read Currently playing "/home/maxx/mp3-stream/Shaper_-_Recliner.ogg"
[2005-10-17 07:40:53] EROR stream/ices_instance_stream Failed to reconnect to localhost:8000 (Socket error)
[2005-10-17 07:40:55] WARN stream/ices_instance_stream Trying reconnect after server socket error
Backtrace:
Program terminated with signal 11, Segmentation fault.
#0 0x0496c89f in free_codecs () from /usr/local/lib/libshout.so.4.0
#1 0x0496c7ec in close_ogg () from /usr/local/lib/libshout.so.4.0
#2 0x0496a25e in shout_close () from /usr/local/lib/libshout.so.4.0
#3 0x1c006115 in ices_instance_stream (arg=0x7cc43680) at /usr/ports/mystuff/net/ices2/w-ices-2.0.1p1-debug/ices-2.0.1/src/stream.c:300
300 shout_close(sdsc->shout);
#4 0x1c00de4e in _start_routine (arg=0x871bd1c0) at /usr/ports/mystuff/net/ices2/w-ices-2.0.1p1-debug/ices-2.0.1/src/thread/thread.c:655
655 (start_routine)(real_arg);
#5 0x08a15d4b in _thread_start () from /usr/lib/libpthread.so.6.1
#6 0x0000001f in ?? ()
#7 0x00000000 in ?? ()
#8 0x00000000 in ?? ()
[...]
#1029 0x00000000 in ?? ()
#1030 0x00000000 in ?? ()
Cannot access memory at address 0x827cb000
I'll be happy to help with more information, if necessary, also on Freenode/#icecast (_mx). I will also restart the whole thing with libshout having debug symbols; maybe it happens again.