Life In 19x19
http://prod.lifein19x19.com/

Stack overflow
http://prod.lifein19x19.com/viewtopic.php?f=14&t=1397
Page 1 of 1

Author:  John Fairbairn [ Mon Aug 16, 2010 3:07 am ]
Post subject:  Stack overflow

For, I think, the last three days (today is 16 August 2010) I have been getting a message on this site only, using Windows and Internet Explorer, that a script is running on this page and may cause Explorer to run slowly. If I stop it, nothing seems to happen. If I let it run there is an instant "stack overflow at line 1161".

It does not appear on every page I look at. My impression is that it only appears on pages with the Eidogo viewer (which I very rarely use and have not used for some time).

Author:  kirkmc [ Mon Aug 16, 2010 3:15 am ]
Post subject:  Re: Stack overflow

That happens when you try to pile up the stones too high. With yunzi stones you can make taller stacks.

Author:  bobmcg [ Mon Aug 16, 2010 5:36 am ]
Post subject:  Re: Stack overflow

John Fairbairn wrote:
For, I think, the last three days (today is 16 August 2010) I have been getting a message on this site only, using Windows and Internet Explorer, that a script is running on this page and may cause Explorer to run slowly. If I stop it, nothing seems to happen. If I let it run there is an instant "stack overflow at line 1161".

It does not appear on every page I look at. My impression is that it only appears on pages with the Eidogo viewer (which I very rarely use and have not used for some time).


I have been getting the same message but I've always clicked "yes" regarding stopping the script so I haven't seen the "stack overflow". I tried stopping the script and using the eidogo player after that and it worked OK.

Author:  fwiffo [ Mon Aug 16, 2010 6:34 am ]
Post subject:  Re: Stack overflow

What version of IE?

Author:  bobmcg [ Mon Aug 16, 2010 6:59 am ]
Post subject:  Re: Stack overflow

fwiffo wrote:
What version of IE?


I'm using IE 8. I do get the stack overflow immediately after clicking not to turn off the script, though, as I said above, the eidogo player works all right if I do turn off the script. What is that script anyhow?

Author:  fwiffo [ Mon Aug 16, 2010 7:28 am ]
Post subject:  Re: Stack overflow

It may be completely unrelated to eidogo. The site runs javascript for other things too. No idea which is causing the error. Is it a particular screen or thread that produces the error?

I'll try to look into it sometime this week.

Author:  bobmcg [ Mon Aug 16, 2010 7:38 am ]
Post subject:  Re: Stack overflow

fwiffo wrote:
It may be completely unrelated to eidogo. The site runs javascript for other things too. No idea which is causing the error. Is it a particular screen or thread that produces the error?

I'll try to look into it sometime this week.


It happened again just now on page three of the thread "Comparison of Interest in Pro Go by Country": viewtopic.php?f=13&t=1365&start=40

It doesn't happen on the first two pages of the thread which don't have Eidogo players, only the third when the post including an eidogo player is on the page.

Author:  bobmcg [ Mon Aug 16, 2010 7:42 am ]
Post subject:  Re: Stack overflow

bobmcg wrote:
fwiffo wrote:
It may be completely unrelated to eidogo. The site runs javascript for other things too. No idea which is causing the error. Is it a particular screen or thread that produces the error?

I'll try to look into it sometime this week.


It happened again just now on page three of the thread "Comparison of Interest in Pro Go by Country": viewtopic.php?f=13&t=1365&start=40

It doesn't happen on the first two pages of the thread which don't have Eidogo players, only the third when the post including an eidogo player is on the page.


I just tried this thread viewtopic.php?f=15&t=1097 which has an Eidogo player in it's first post and I did not get the script error.

Author:  hyperpape [ Mon Aug 16, 2010 8:55 am ]
Post subject:  Re: Stack overflow

On IE7, I get the stack overflow, but without the message that a script may cause the site to run slowly. It doesn't appear in every page involving the eidogo viewer: I just looked at the congress photos thread in the AGA forum, and had no problem. The one thread it always happened on was "Comparison of Pro Interest By Country".

Author:  deja [ Mon Aug 16, 2010 9:30 am ]
Post subject:  Re: Stack overflow

Yep, happening to me as well. I clicked the links that bobmcg posted and exact same thing happens. Using IE8, although I've recently thrown in the towel and started using Firefox. :cry:

Author:  apetresc [ Mon Aug 16, 2010 9:55 am ]
Post subject:  Re: Stack overflow

I just reproduced it under Chrome in Linux (!!). There was no script error, but it took a good 30+ seconds for Javascript to run. Since I'm on Chrome I can probably figure out exactly what script is causing it. I'll post back in here.

Author:  John Fairbairn [ Mon Aug 16, 2010 10:21 am ]
Post subject:  Re: Stack overflow

I'm on IE8.

Not sure which threads give me the message but it's definitely NOT any Malkovich forums as I zap those.

Author:  apetresc [ Mon Aug 16, 2010 11:00 am ]
Post subject:  Re: Stack overflow

So the problem is a bug in the all.compressed.js script. The findCaptures() method has an infinite recursion somewhere around line 1167. This bug actually exists on all platforms and all browsers; the reason the Firefox users never noticed it is that the stack depth on Firefox is much lower, so it just errors out before the time lag becomes noticeable. If you look at your Javascript Error Console in Firefox you will see:
Code:
Error: too much recursion
Source File: http://www.lifein19x19.com/eidogo-phpbb3/eidogo/player/js/all.compressed.js
Line: 1161

Other browsers, like IE, Chrome, and Safari, will happily recurse for a long time (or forever, in IE/Safari's case) leading to the timeout.

Whoever wants to help fix this (Kirby, Joaz, fwiffo?) I recommend investigating by setting a breakpoint on line 1167, and step through a bunch of times. Notice how pendingCaptures.length just keeps going up forever, with the call on line 1172. The call stack will contain hundreds of copies of findCaptures().

I'm not sure what it is about this SGF that causes the problem; it seems well-formed to me, and CGoban has no problems parsing it. I'll keep looking.

Author:  apetresc [ Mon Aug 16, 2010 11:25 am ]
Post subject:  Re: Stack overflow

Okay, I've figured out the problem. The problem is that the SGF in that thread uses an "incorrect" SGF property -- it used "KO[6.5]" instead of "KM[6.5]" to represent the komi. The KO property actually is meant to indicate a ko square, so the EidoGo parser was getting very confused about where the ko was when there were, in fact, 0 stones on the board at the time :)

I've fixed the offending SGF for the meantime, but we should go and toughen up the EidoGo parser to fail more gracefully on incorrect SGF tags.

Author:  fwiffo [ Mon Aug 16, 2010 11:47 am ]
Post subject:  Re: Stack overflow

Wow, that's weird. What app made the offending SGF? I know the eidogo code fairly well and have my own fork on github, so I'll fix the bug when I have time.

Author:  apetresc [ Mon Aug 16, 2010 12:30 pm ]
Post subject:  Re: Stack overflow

fwiffo wrote:
Wow, that's weird. What app made the offending SGF?


Good question; I PMed Kirby about it, since he posted it.

Author:  John Fairbairn [ Mon Aug 16, 2010 12:42 pm ]
Post subject:  Re: Stack overflow

Adrian: I'm impressed. Thank you.

Author:  CarlJung [ Mon Aug 16, 2010 12:49 pm ]
Post subject:  Re: Stack overflow

Adrian = Javascript 9P.

Author:  bobmcg [ Mon Aug 16, 2010 1:09 pm ]
Post subject:  Re: Stack overflow

Good work Adrian! But why did the Eidogo app appear to work after I had nixed the script? Did it just skip the bad code an proceed from there?

Author:  apetresc [ Mon Aug 16, 2010 1:18 pm ]
Post subject:  Re: Stack overflow

Kirby got back to me; it was taken from the Korean Baduk Association site (if you steal the URL from their gibo_load() calls). I checked a few out and they all use KO instead of KM, and it doesn't affect them because they're really only intended to run in their own player which probably makes the same mistake. Just something to keep in mind.
bobmcg wrote:
Good work Adrian! But why did the Eidogo app appear to work after I had nixed the script? Did it just skip the bad code an proceed from there?

Exactly; it processes that part towards the end. You might have noticed that if you killed the script, it worked but it wasn't quite right; for example, the forward arrow buttons were still greyed out instead of red like they usually are. This is because the script wasn't quite done initializing everything.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/