rogchap / v8go

Execute JavaScript from Go

Home Page:https://rogchap.com/v8go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker run threadpool the Error

qing-shang opened this issue · comments

Multithreading running error in docker, but it works normally in wsl2: ubuntu 20.04

docker system: ubuntu:20.04

1.v8go version 0.7.0
2.go build
3.docker run
`<--- Last few GCs --->

<--- JS stacktrace --->

Fatal javascript OOM in GC during deserialization

SIGTRAP: trace trap
PC=0x13e914e m=17 sigcode=128
signal arrived during cgo execution

goroutine 2133 [syscall]:
runtime.cgocall(0xb62fd0, 0xc00070d850)
/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc00070d828 sp=0xc00070d7f0 pc=0x81ae3c
rogchap.com/v8go._Cfunc_NewIsolate()
_cgo_gotypes.go:716 +0x49 fp=0xc00070d850 sp=0xc00070d828 pc=0xb563a9
rogchap.com/v8go.NewIsolate()
/root/go/pkg/mod/rogchap.com/v8go@v0.7.0/isolate.go:59 +0x3c fp=0xc00070d888 sp=0xc00070d850 pc=0xb57f9c
rogchap.com/v8go.NewContext({0x0, 0x0, 0x1d1?})
/root/go/pkg/mod/rogchap.com/v8go@v0.7.0/context.go:57 +0x54 fp=0xc00070d8d8 sp=0xc00070d888 pc=0xb56ad4`

I don't know what to do, How to solve it?

ctx does not release iso, i solved it

Latest release is 0.7.0.
Is there any plan to make a new release with this fix?
Thanks

最新版本为 0.7.0。是否有任何计划使用此修复程序制作新版本? 谢谢

opts.iso = NewIsolate()

If iso has no parameter transfer, it needs to be released manually
ctx := v8go.NewContext(nil)
ctx.Close()
ctx.Isolate().Dispose()

v8go/context.go

Line 119 in da7f43c

func (c *Context) Close() {

Because it is not released in the close