Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: unexpected signal panic on make(map[string]interface{}) #23329

Closed
ruandao opened this issue Jan 4, 2018 · 7 comments

Comments

Projects
None yet
6 participants
@ruandao
Copy link

commented Jan 4, 2018

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 test

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

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\Go\workspace\BASE\FishingServer;D:\Go_
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

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?

not crash

What did you see instead?

crash

fatal error: unexpected signal during runtime execution
[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x411194]


goroutine 132 [running]:
runtime.throw(0x954d70, 0x2a)
	C:/Go/src/runtime/panic.go:605 +0x9c fp=0xc043d09678 sp=0xc043d09658 pc=0x42e33c
runtime.sigpanic()
	C:/Go/src/runtime/signal_windows.go:155 +0x184 fp=0xc043d096a8 sp=0xc043d09678 pc=0x4439a4
runtime.mallocgc(0x30, 0x913840, 0xc043d09701, 0x534680f3)
	C:/Go/src/runtime/malloc.go:779 +0x314 fp=0xc043d09750 sp=0xc043d096a8 pc=0x411194
runtime.newobject(0x913840, 0x1e4f976ddc1bee2f)
	C:/Go/src/runtime/malloc.go:840 +0x3f fp=0xc043d09780 sp=0xc043d09750 pc=0x41190f
runtime.makemap(0x8b22a0, 0x0, 0x0, 0x0, 0xc0442cdba8)
	C:/Go/src/runtime/hashmap.go:321 +0x2fc fp=0xc043d097e0 sp=0xc043d09780 pc=0x40859c
main.(*Game).GetGameFishTrail(0xc043caa000, 0x6, 0x0, 0x0, 0x0)
	D:/Go/workspace/BASE/FishingServer/src/main/game.go:368 +0x258 fp=0xc043d09900 sp=0xc043d097e0 **pc=0x81d508**

func (g *Game) GetGameFishTrail(index int) []map[string]interface{} {
	g.checkPointLock.RLock()
	defer g.checkPointLock.RUnlock()

	checkPoint := g.GameCheckPoint[index]
	var trails []map[string]interface{}

	for _, trail := range checkPoint.Trail {
		newTrail := make(map[string]interface{})    // crash line
		for k,v := range trail {
			newTrail[k] = v                                   
		}
		trails = append(trails, newTrail)
	}
	return trails
}
@randall77

This comment has been minimized.

Copy link
Contributor

commented Jan 4, 2018

I don't understand how this could happen.

The line in malloc.go which faults is (line 779):

	mp.mallocing = 0

There is a previous line in the same function (line 627) that does:

	mp.mallocing = 1

and that line succeeded.

Long shot: something corrupting the stack? mp is probably spilled to the stack and could get corrupted by a stack overwrite.

Questions:

  • How often do you see this crash?
  • Is there any way you can post enough code for us to reproduce this? Without us being able to reproduce, it's going to be hard to fix.
  • By "never" on the latest release, do you mean you tried it on tip? 1.9.2? 1.10 beta? How confident are you that it has been fixed?
  • Are you using unsafe? cgo?
@ruandao

This comment has been minimized.

Copy link
Author

commented Jan 4, 2018

How often do you see this crash?
one time

Is there any way you can post enough code for us to reproduce this? Without us being able to reproduce, it's going to be hard to fix.
this was in a big project, it have too many rely env (like redis, other http service), I can't post the project

By "never" on the latest release, do you mean you tried it on tip? 1.9.2? 1.10 beta? How confident are you that it has been fixed?
sorry, i never look carefully, i mean never test.

Are you using unsafe? cgo?
i never use cgo

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Jan 4, 2018

@mvdan mvdan changed the title runtime crash when make(map[string]interface{}) runtime: unexpected signal panic on make(map[string]interface{}) Jan 4, 2018

@mvdan

This comment has been minimized.

Copy link
Member

commented Feb 20, 2018

Ping @ruandao

@ruandao

This comment has been minimized.

Copy link
Author

commented Feb 23, 2018

i can't provide more info, because my code has a lot of race problem when plus -race flag...

@mvdan

This comment has been minimized.

Copy link
Member

commented Feb 23, 2018

Sorry, I don't understand what you mean. Are you saying that -race shows race conditions in your program?

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 23, 2018

Feel free to reopen this bug if/when the problem still occurs after data races are fixed.

@bradfitz bradfitz closed this Feb 23, 2018

@golang golang locked and limited conversation to collaborators Feb 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.