Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/gob: crash across program boundaries. #470
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. What steps will reproduce the problem? 1. Two source files, http://pastebin.com/f26179f31 and http://pastebin.com/f557e27bb 2. compile and link as two separate programs. 3. run the first one, then the second. What is the expected output? What do you see instead? expected: 42. instead: throw: runtime·mapaccess1: key not in map panic PC=0x2ad775b949e8 ... (complete output: http://pastebin.com/f47eacf2f) What is your $GOOS? $GOARCH? linux, amd64 Which revision are you using? (hg identify) 16355a0398ab+ tip Please provide any additional information below. Possibly related to https://golang.org/issue/459, but I think this is a separate issue. The problem doesn't reproduce when the two programs are combined into one! That is, http://pastebin.com/f724d1c22 produces the expected output, 42. Possibly some state is stored in the program address space that needs to be encoded in the gob? This would allow the one-program version to work but would leave the two program version to make a bad assumption at some point.