golang/go

runtime: map unexpected fault address

Closed this issue · 11 comments

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.9.1

Does this issue reproduce with the latest release?

never teset

What operating system and processor architecture are you using (go env)?

windows, amd64

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

What did you see instead?

I run code like this:

  v["beginTime"].(float64)          // v was map[string]interface{}
unexpected fault address 0xffffffffffffffff
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x45cb91]

goroutine 58 [running]:
runtime.throw(0x93330c, 0x5)
	C:/Go/src/runtime/panic.go:605 +0x9c fp=0xc0426dd8b0 sp=0xc0426dd890 pc=0x42e33c
runtime.sigpanic()
	C:/Go/src/runtime/signal_windows.go:164 +0x14e fp=0xc0426dd8e0 sp=0xc0426dd8b0 pc=0x44396e
runtime.memeqbody()
	C:/Go/src/runtime/asm_amd64.s:1431 +0xd1 fp=0xc0426dd8e8 sp=0xc0426dd8e0 pc=0x45cb91
runtime.mapaccess1_faststr(0x8ad380, 0xc0447d3f80, 0x936ab8, 0x9, 0xc0449ad3a8)
	C:/Go/src/runtime/hashmap_fast.go:234 +0xd9 fp=0xc0426dd940 sp=0xc0426dd8e8 pc=0x40c089
main.(*Hub).run(0xc04268c100)
	

the hashmap_fast.go:234 was:

if k.str == key.str || memequal(k.str, key.str, uintptr(key.len))

mdcnz commented

Could you please provide more information? The specific code mentioned appears valid by itself:
v["beginTime"].(float64)
play

Please provide a small working example that reproes your issue.

normal it run well, but occasionally it panic
working example just like:
play

cznic commented

working example just like:

What's needed is the failing example.

I think @ruandao means to say normally the example runs fine. It just panics occasionally. And that is the example which does that.

@ruandao - The code seems legit to me. I am running linux though. And also, using the raw println function is not very idiomatic. fmt.Println is recommended. Are you sure this is the exact code which panics in your machine ? You did say "just like", so wanted to make sure whether your code is "similar" to this, or it is "actually" this.

cznic commented

Then an example including a loop and a note like "fails randomly at i between X and Y on my computer" would have been sufficient. Note that sharing the values of X and Y is essential in such case for the person trying to fix the issue, because it may not reproduce on other machine at all.

This is probably a duplicate of #22781. If so, it should be fixed in 1.9.3 (or with https://golang.org/cl/79018 patched in).

Hmm, but the fix for #22781 didn't touch the mapassign_faststr variant. Still, it could be related.

yes it normally runs fine. It just panics occasionally.
I say "just like" means my code is "similar" to this
@agnivade

@ruandao - can you try with the 1.10 beta release and see if your issue is fixed ? 1.9.3 hasn't released yet.

Also, it would help if you can give us the "exact" code which fails rather than something similar. This is just to rule out any oversight or other interfering factors.

Timed out.