Skip to content

Trying to compile gopher-lua with TinyGo issues #742

@thegrumpylion

Description

@thegrumpylion

I have forked and striped of any "os" dependencies this package https://github.com/yuin/gopher-lua (my fork https://github.com/thegrumpylion/gopher-lua) and i am trying to build this example https://github.com/thegrumpylion/tinygo/blob/lua/src/examples/lua/lua.go

tinygo build -target=pca10056 -o lua.hex ./src/examples/lua

But i hit this wall:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x3810ac0]

runtime stack:
runtime.throw(0x3b8f74d, 0x2a)
        /home/nikolas/go/src/runtime/panic.go:774 +0x72
runtime.sigpanic()
        /home/nikolas/go/src/runtime/signal_unix.go:378 +0x47c

goroutine 1 [syscall]:
runtime.cgocall(0xcb0050, 0xc00c1dc850, 0xc00c1dc848)
        /home/nikolas/go/src/runtime/cgocall.go:128 +0x5b fp=0xc00c1dc820 sp=0xc00c1dc7e8 pc=0x92dafb
tinygo.org/x/go-llvm._Cfunc_LLVMGetConstOpcode(0x7f73582d5e88, 0x7f7300000000)
        _cgo_gotypes.go:5253 +0x49 fp=0xc00c1dc850 sp=0xc00c1dc820 pc=0xb48b99
tinygo.org/x/go-llvm.Value.Opcode.func1(0x7f73582d5e88, 0x8)
        /home/nikolas/golang/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20191113125529-bad6d01809e8/ir.go:872 +0x56 fp=0xc00c1dc888 sp=0xc00c1dc850 pc=0xb6a7c6
tinygo.org/x/go-llvm.Value.Opcode(0x7f73582d5e88, 0x60f0d50)
        /home/nikolas/golang/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20191113125529-bad6d01809e8/ir.go:872 +0x2b fp=0xc00c1dc8a8 sp=0xc00c1dc888 pc=0xb573bb
github.com/tinygo-org/tinygo/interp.(*MapValue).PutBinary(0xc0079f04d0, 0xc003334780, 0xc003c77d40)
        /home/nikolas/projects/tinygo/tinygo/interp/values.go:370 +0xc5 fp=0xc00c1dc940 sp=0xc00c1dc8a8 pc=0xc8fcc5
github.com/tinygo-org/tinygo/interp.(*frame).evalBasicBlock(0xc00c1dd4e0, 0x7f73290e3620, 0x7f73290e3220, 0x0, 0x0, 0x0, 0x0, 0xc00590d4f8, 0x1, 0x1, ...)
        /home/nikolas/projects/tinygo/tinygo/interp/frame.go:291 +0x78f7 fp=0xc00c1dd448 sp=0xc00c1dc940 pc=0xc88bd7
github.com/tinygo-org/tinygo/interp.(*Eval).function(0xc008011f80, 0x7f734c04ca28, 0xc00c1dd628, 0x2, 0x2, 0xc003870240, 0x23, 0x0, 0x0, 0x0, ...)
        /home/nikolas/projects/tinygo/tinygo/interp/interp.go:104 +0x208 fp=0xc00c1dd518 sp=0xc00c1dd448 pc=0xc8c038
github.com/tinygo-org/tinygo/interp.(*Eval).Function(...)
        /home/nikolas/projects/tinygo/tinygo/interp/interp.go:87
github.com/tinygo-org/tinygo/interp.Run(0x60eff30, 0x7fff00000000, 0x0, 0x0)
        /home/nikolas/projects/tinygo/tinygo/interp/interp.go:74 +0x6b2 fp=0xc00c1dd658 sp=0xc00c1dd518 pc=0xc8bac2
github.com/tinygo-org/tinygo/builder.Build(0x7fffcbff6c9c, 0x12, 0x7fffcbff6c94, 0x7, 0xc0000f73e0, 0xc00c1ddca8, 0x0, 0x0)
        /home/nikolas/projects/tinygo/tinygo/builder/build.go:49 +0x1f5 fp=0xc00c1ddc68 sp=0xc00c1dd658 pc=0xc95025
main.Build(0x7fffcbff6c9c, 0x12, 0x7fffcbff6c94, 0x7, 0xc00016e000, 0x0, 0x16)
        /home/nikolas/projects/tinygo/tinygo/main.go:83 +0xc5 fp=0xc00c1ddcd0 sp=0xc00c1ddc68 pc=0xca4745
main.main()
        /home/nikolas/projects/tinygo/tinygo/main.go:590 +0x192a fp=0xc00c1ddf60 sp=0xc00c1ddcd0 pc=0xca7dba
runtime.main()
        /home/nikolas/go/src/runtime/proc.go:203 +0x21e fp=0xc00c1ddfe0 sp=0xc00c1ddf60 pc=0x959efe
runtime.goexit()
        /home/nikolas/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00c1ddfe8 sp=0xc00c1ddfe0 pc=0x985181

goroutine 6 [syscall]:
os/signal.signal_recv(0x0)
        /home/nikolas/go/src/runtime/sigqueue.go:147 +0x9c
os/signal.loop()
        /home/nikolas/go/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
        /home/nikolas/go/src/os/signal/signal_unix.go:29 +0x41

Any ideas what am i doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions