<pre class="notranslate">1. What is a short input program that triggers the error?
package pkg

type A interface{}
type B interface{}

func F(a A) {
        control := make(chan B)
        control &lt;- a
}

2. What is the full compiler output?
example.go:8: internal compiler error: syslook: can't find runtime.convE2E

Please file a bug report including a short program that triggers the error.
<a href="http://code.google.com/p/go/issues/entry?template=compilerbug" rel="nofollow">http://code.google.com/p/go/issues/entry?template=compilerbug</a>

3. What version of the compiler are you using?  (Run it with the -V flag.)
6g version release.r56 7666

4. Notes?
This clearly is an invalid program, but its error message needs some love.</pre>
<p dir="auto">by <strong><a href="mailto:louisk@google.com">louisk@google.com</a></strong>:</p>
<pre class="notranslate">There is a bug in the RPC server that causes an infinite loop (with infinite error
messages on the console) if there is an error condition on the socket.  This bug
triggers routinely on Windows, but it can also happen on Linux.  Here is a sample code
which reproduces the problem.
Bug verified on Go r60.1 and Go weekly.2011-09-21

Run "./bug server" in one window and "./bug client" in another.  The
server will infinite loop and print the following message forever:
2011/09/29 12:27:34 rpc: rpc: server cannot decode request: invalid character '{'
looking for beginning of object key string
2011/09/29 12:27:34 rpc: rpc: server cannot decode request: invalid character '{'
looking for beginning of object key string
2011/09/29 12:27:34 rpc: rpc: server cannot decode request: invalid character '{'
looking for beginning of object key string
2011/09/29 12:27:34 rpc: rpc: server cannot decode request: invalid character '{'
looking for beginning of object key string
...



/////////// bug.go /////////////

package main

import "os"
import "net"
import "rpc"
import "rpc/jsonrpc"
import "fmt"

func handleErr(who string, err os.Error) bool {
  if (err != nil) {
    fmt.Fprintln(os.Stderr, who, err)
    return true
  }
  return false
}

type BugRequest struct {
  Foo int
}

type RPCMethods struct{}

func (RPCMethods) Method(req *BugRequest, resp *string) os.Error {
  *resp = "Hello"
  return nil
}

func serve() {
  li, err := net.Listen("tcp", ":5432")
  if (handleErr("listen:", err)) {
    return
  }
  rpcserver := rpc.NewServer()
  err = rpcserver.Register(RPCMethods{})
  fmt.Println("listening on port 5432")
  for {
    conn, err := li.Accept()
    if handleErr("accept:", err) {
      return
    }
    go rpcserver.ServeCodec(jsonrpc.NewServerCodec(conn))
  }

  rpcserver.Accept(li)
}

func client() os.Error {
  sock, err := net.Dial("tcp", "localhost:5432")
  if (handleErr("rpc.Dial:", err)) {
    return err
  }
  cli := jsonrpc.NewClient(sock)
  var resp string
  err = cli.Call("RPCMethods.Method", BugRequest{}, &amp;resp)
  fmt.Println(resp)
  // add some junk to the socket -- triggers bug
  sock.Write([]byte { 123, 123, 123, 123})
  sock.Close()
  return nil
}

func main() {
  switch(os.Args[1]) {
    case "server":
          serve()
    case "client":
          client()
  }
}</pre>