Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Apple TV 3rd gen. DoS-bug stopping homesharing

Hi.


As many others here I experienced a nasty bug in Apple iTunes eco-system: Homesharing just stopped after a while.


My setup: A mac mini server running 10.7.3 with iTunes 10.6.1 sharing my whole library

One AppleTV 2nd Gen. and one AppleTV 3rd Gen.


I first suspected one of the latest iTunes updates. But even downgrading didn't help. First after looking deeper into whats going on network-wise on my revealed the following:


User uploaded file

Alltogether that made up 198 connections, all to my AppleTV 3:


User uploaded file

I can imagine it has something to do with the sleep mode. But I'm not sure. All I can see is that I do not experience such a connection hazard with my older AppleTV 2.


It really looks like the 3rd Gen AppleTV is running a DoS-attack against iTunes so that finally no other devices are able to connect (thus the definition of a DoS-attach).


That's something Apple really has to fix very soon!

Apple TV, Mac OS X (10.7.3)

Posted on Apr 23, 2012 11:06 AM

Reply
26 replies

Jun 7, 2012 6:36 AM in response to wwebers

After 24 hours with the new software release I am finding myself in the same end state, albeit via a slightly different route.


Whereas up until now the DoS end state was accompanied with scores of established connections to the DAAP port on the iTunes Home Sharing server (Windows or Mac), now the same DoS end state is accompanied with scores of established connections between the Apple TV and the iTunes Home Sharing server, though these connections are all on the high order ports (e.g. > 49000).


I will update my contact at Apple Care with this information. The next logical step is to RMA the Apple TV, but given you are observing the same issue, I doubt we are dealing with a manufacturing defect (unless of course the manufacturing defect aflicts all 3rd generation Apple TVs).


Stay tuned.


G.-A.

Jun 9, 2012 11:46 AM in response to wwebers

Mr. Webers, in my series of tests I came across an interesting nuance in the DoS bug we are investigating. I created an AppleScript that restarts iTunes automatically and log the number of connections established to the DAAP port, to get around the DoS. The script is scheduled to run three times a day (10AM, 4PM and 10PM).


Over time I noticed there were no connections to the DAAP port, while the AppleTV was still unable to connect to the HomeSharing server.


I updated the AppleScript to log the total number of connections to the AppleTV in addition to those on the DAAP port.


As it turns out I noticed the following behavior:


1) connections build up on the DAAP port until a point where the Apple TV can no longer view the contents of the Home Sharing library. (known behavior).

2) my script restarts iTunes.

3) now connections start building up until a point where the Apple TV can no longer view the contents of the Home Sharing library, but this time around the source and destination ports are in the high order, eg >49000 (new behavior).

4) iTunes is restarted at the next execution of the script.

5) the connection build up on the DAAP port resumes. (known behavior).


Are you seeing a similar behavior? I will gladly share my AppleScript if you'd like.

User uploaded file

Jun 21, 2012 2:40 PM in response to wwebers

Here is an update for the record.


After numerous tests and reconfiguration of my set up with the clear goal of isolating this odd behavior, I have received an update from my AppleCare contact. Using his own words: "Right now your issue is under further investigation at the software level. Engineering has requested that you use either work around (Wi-Fi connection or running the restart script) in the mean time.


Keep up with your updates as when a fix is released, it will come in the form of an update.''


I will post an update if anything new on this front happens, but most likely you will find out at the same time I will.

Jun 21, 2012 3:05 PM in response to G.-A.

Hi G.-A.


Thanks for sharing your experiences with AppleCare with us. Let's hope Apple will fix this some lucky day this year. It just looks like that the AppleTV is not disconnecting it's wired connection when is goes to sleep. So every time it wakes up (which happens quiet often when other HDMI devices connected to the very same TV are being used) it looks like the AppleTV is building up a fresh connection to iTunes.


Shouldn't be that hard to fix for such experienced engineers usually seen at such a brave company like Apple, wouldn't it?


🙂

Jul 4, 2012 2:17 PM in response to dcarr178

Certainly, here it is the core of the AppleScript; I omitted the logging code that calls an other script to track the number of established sessions:


set HowManySessions to do shell script "netstat -n | grep <ATV IP address here> | wc -l"

set HowManySessionsDAAP to do shell script "netstat -n | grep .3689 | wc -l"


if HowManySessions > " 60" then


quitapplication "iTunes"


delay 5

tell application "iTunes"


activate

end tell

else


quitapplication "iTunes"


delay 5

tell application "iTunes"


activate

end tell


end if

Jul 10, 2012 10:57 PM in response to G.-A.

Thanks for your script G.-A. Currently you have it restarting no matter what (the else clause). I updated it and added a check for iTunes running. There's probably a better way, but it works.


#!/usr/bin/osascript

set HowManySessionsDAAP to do shell script "netstat -n | grep .3689 | wc -l"

set HowManyiTunes to do shell script "ps -e | grep 'iTunes ' | egrep -v grep | wc -l"


if HowManySessionsDAAP > " 60" then

say "There is a problem with iTunes. I'm restarting it now."

quit application "iTunes"

delay 5

tell application "iTunes"

activate

end tell

end if


if HowManyiTunes = " 0" then

say "iTunes is not running. I'm starting it now."

delay 1

tell application "iTunes"

activate

end tell

end if


I added an entry to crontab (crontab -e) to fire every 30 minutes:


*/30 * * * * /Users/myname/iTunes-restart

Sep 26, 2012 7:57 PM in response to G.-A.

Well folks, it is 12 hours later and I am glad to report no more recurrence of the symptoms we all are familiar with.


The version of ATV software is 5.1 (5201) running on OS Build 6.0 (10A406e).

ITunes is 10.7 (21) 64-bit

OS X 10.8.2


Thank you Mr. Weber for your clues about the problem, and all at Apple for nailing this one.

Sep 29, 2012 3:30 AM in response to G.-A.

Hi G.-A.


well, I experience that the amount of connections has been reduced with the latest update. But it is still not comparable with the wireless connections:


User uploaded file


The connections to 192.168.1.4 are those wireless ones. The others are those other ethernet cable. We will see if over time still see an increasing number of wired connections.


So, I'm still not very impressed and I still claim that we talk about a design flaw in the AppleTV 3rd gen.

Apple TV 3rd gen. DoS-bug stopping homesharing

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.