You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem. Thanks.
N/A
What steps will reproduce the problem?
1. Using Firefox 3.6.17 [Mozilla/5.0 (X11; U; Linux x86_64; cs-CZ; rv:1.9.2.17)
Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17] visit golang.org.
2. Enter into the playground's text area:
package main
func main() {
println("%")
}
3. Verify it's OK by clicking the "COMPILE & RUN" button (or shift-enter).
4. The single percent sign is seen as the correct output of the above program.
5. Click the "Pop Out" link bellow the input yellow text area.
What is the expected output?
A new window with the program as in step 2.
What do you see instead?
A new window with the "Hello World" example.
Which compiler are you using (5g, 6g, 8g, gccgo)?
N/A
Which operating system are you using?
See details in step 1.
Which revision are you using? (hg identify)
N/A
Please provide any additional information below.
Doing all the same while replacing the percent sign with e.g. a hash sign (#) works as
expected. The problem seems to be related with the value %25 in the escaped URL in the
pop out window. Additionally, everything works (both with % and with #) OK in a Chrome
browser [11.0.696.57 beta]. Other browsers were not tested.
Re #2: I was not able to detect the specific place of the bug. I haven't found anything
wrong in the playground Javascript code.
There's probably a small misunderstanding - the workaround solves the working (#) case,
the problem is with the percent sign (%) instead.
A workaround for anyone also having the problem with FF. Not nice, just works.
http://golang.org/doc/play/#package%20main%0Afunc%20main%28%29%20{%0A%09println%28%22\x25%22%29%0A}%0A
BTW: If there is some way for me to help with solving this issue, I'l be happy to
volunteer.
Unfortunately this is an issue(probably a bug in at least Gecko based browsers) with the
behaviour of decodeURIComponent in that it appears to decodes %25 then borks at the
possibly unexpected % sign. I don't have IE handy to test (and I have no reason to
expect it to break there) but a possible workaround is to just use escape/unescape as
opposed to encodeURIComponent/decodeURIComponent. AFAICT that pair simply works.
// Called directly by OS as signal handler.
#pragma textflag 7
before the definition of runtime.sigignore in both freebsd/386/signal.c and
freebsd/amd64/signal.c.
This is a difference compared to the Darwin port because on Darwin the function gets
called via sigtramp. On FreeBSD it is being given to the signal handler directly, so it
cannot be a typical Go stack-checking function.
I found the error. It is indeed a bug in Firefox when retrieving the hash through
window.location.hash.
I found a cross-platform solution for the same purpose.
So to fix the issue, we need to replace line 163 in playground.js by the following :
var hash = location.href.split("#")[1] || "";
I fixed this in our internal copy of playground.js, and Andrew promises not to
reintroduce the bug in his upcoming rewrite. Thanks very much for diagnosing this.
Activity
rsc commentedon May 2, 2011
Comment 1:
Owner changed to @adg.
Status changed to Accepted.
bradfitz commentedon May 2, 2011
Comment 2:
rsc commentedon May 2, 2011
Comment 3:
cznic commentedon May 2, 2011
Comment 4:
cznic commentedon Jun 7, 2011
Comment 5:
rsc commentedon Jul 25, 2011
Comment 6:
Status changed to HelpWanted.
gopherbot commentedon Aug 14, 2011
Comment 7 by disposaboy@dby.me:
rsc commentedon Oct 6, 2011
Comment 8:
gopherbot commentedon Oct 20, 2011
Comment 9 by teabee89:
I found the error. It is indeed a bug in Firefox when retrieving the hash through window.location.hash. I found a cross-platform solution for the same purpose. So to fix the issue, we need to replace line 163 in playground.js by the following : var hash = location.href.split("#")[1] || "";adg commentedon Oct 22, 2011
Comment 10:
Status changed to Started.
rsc commentedon Dec 9, 2011
Comment 11:
Labels changed: added priority-later.
rsc commentedon Jan 29, 2012
Comment 12:
rsc commentedon Jan 29, 2012
Comment 13:
Labels changed: added priority-go1, removed priority-later.
rsc commentedon Jan 30, 2012
Comment 14:
Labels changed: added go1-must.
rsc commentedon Jan 31, 2012
Comment 15:
Status changed to Fixed.