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

race condition issue #4

Open
tommynanny opened this issue Jul 11, 2023 · 0 comments
Open

race condition issue #4

tommynanny opened this issue Jul 11, 2023 · 0 comments

Comments

@tommynanny
Copy link

func GetGEOID(lat, lng float64) (float64, error) {
	//in order to use package, has to move
	loc := egm96.NewLocationGeodetic(lat, math.Mod(lng+360, 360), 0)
	h, err := loc.HeightAboveMSL()
	if err != nil {
		return 0, err
	}
	geoid := -h
	return geoid, nil
}

func MSLAltToW84Alt(lat, lng, msl_height float64) (float64, error) {
	geoid, err := GetGEOID(lat, lng)
	if err != nil {
		return 0, err
	}
	return msl_height + geoid, nil
}

==================

WARNING: DATA RACE
Write at 0x00c039950ba0 by goroutine 73:
github.com/westphae/geomag/pkg/egm96.loadEGM96Grid()
C:/Users/chand/go/pkg/mod/github.com/westphae/geomag@v1.0.2/pkg/egm96/egm96.go:264 +0x818
github.com/westphae/geomag/pkg/egm96.Location.HeightAboveMSL()
C:/Users/chand/go/pkg/mod/github.com/westphae/geomag@v1.0.2/pkg/egm96/egm96.go:132 +0x68
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.GetGEOID()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:28 +0x65
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.MSLAltToW84Alt()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:10 +0x154
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb/model.Traffic.ParseToAircraftState()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/model/traffic.go:98 +0x13b
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneTraffic()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:79 +0xef
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x124

Previous read at 0x00c039950ba0 by goroutine 273:
github.com/westphae/geomag/pkg/egm96.Location.HeightAboveMSL()
C:/Users/chand/go/pkg/mod/github.com/westphae/geomag@v1.0.2/pkg/egm96/egm96.go:154 +0x4cf
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.GetGEOID()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:28 +0x65
bitbucket.org/anra-contract-support/wc-adsb-pingstation/common/utils.MSLAltToW84Alt()
C:/Users/chand/Desktop/wc-adsb-pingstation/common/utils/altitude.go:10 +0x154
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb/model.Traffic.ParseToAircraftState()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/model/traffic.go:98 +0x13b
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneTraffic()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:79 +0xef
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x124

Goroutine 73 (running) created at:
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x208
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessMessageChannel.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:56 +0x118

Goroutine 273 (running) created at:
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessOneUDPMessage()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:69 +0x208
bitbucket.org/anra-contract-support/wc-adsb-pingstation/adsb.ProcessMessageChannel.func1()
C:/Users/chand/Desktop/wc-adsb-pingstation/adsb/server_manager.go:56 +0x118

==================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant