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

time: panic in initLocal on js/wasm #28649

Closed
FiloSottile opened this issue Nov 8, 2018 · 3 comments
Closed

time: panic in initLocal on js/wasm #28649

FiloSottile opened this issue Nov 8, 2018 · 3 comments
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@FiloSottile
Copy link
Contributor

This very simple program panics when executed with misc/wasm/go_js_wasm_exec.

package main

import (
	"log"
)

func main() {
	log.Print("Test.")
}
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
time.itoa(...)
	/Users/valsorda/go/src/time/zoneinfo_js.go:51
time.initLocal()
	/Users/valsorda/go/src/time/zoneinfo_js.go:39 +0x3b
sync.(*Once).Do(0x15a3c0, 0x39a18)
	/Users/valsorda/go/src/sync/once.go:44 +0xf
time.(*Location).get(0x141120, 0x8)
	/Users/valsorda/go/src/time/zoneinfo.go:79 +0x5
time.Time.abs(0xbef100f060a9d100, 0x112701, 0x141120, 0x5)
	/Users/valsorda/go/src/time/time.go:455 +0x4
time.Time.date(0xbef100f060a9d100, 0x112701, 0x141120, 0x16a50001, 0xc056000, 0x32e59, 0x5, 0x100000076)
	/Users/valsorda/go/src/time/time.go:964 +0x2
time.Time.Date(0xbef100f060a9d100, 0x112701, 0x141120, 0x0, 0xc04c000, 0xc000180)
	/Users/valsorda/go/src/time/time.go:495 +0x2
log.(*Logger).formatHeader(0xc04a000, 0xc04a030, 0xbef100f060a9d100, 0x112701, 0x141120, 0x0, 0x0, 0x0)
	/Users/valsorda/go/src/log/log.go:103 +0x5b
log.(*Logger).Output(0xc04a000, 0x2, 0xc0140c8, 0x5, 0x0, 0x0)
	/Users/valsorda/go/src/log/log.go:167 +0x9
log.Print(0xc030788, 0x1, 0x1)
	/Users/valsorda/go/src/log/log.go:296 +0x3
main.main()
	/Users/valsorda/go/src/jspanic.go:8 +0x2
exit status 2
@FiloSottile FiloSottile added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-wasm WebAssembly issues labels Nov 8, 2018
@FiloSottile FiloSottile added this to the Go1.12 milestone Nov 8, 2018
@FiloSottile
Copy link
Contributor Author

/cc @neelance

@agnivade
Copy link
Contributor

agnivade commented Nov 8, 2018

My bad, I did not think of negative offsets. Sigh .. Sending a fix.

@FiloSottile FiloSottile added NeedsFix The path to resolution is known, but the work has not been done. and removed arch-wasm WebAssembly issues labels Nov 8, 2018
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 8, 2018
@FiloSottile FiloSottile added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-wasm WebAssembly issues and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 8, 2018
@gopherbot
Copy link

Change https://golang.org/cl/148338 mentions this issue: time: handle negative offsets on js/wasm

@golang golang locked and limited conversation to collaborators Nov 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly issues FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants