pkujhd / goloader

load and run golang code at runtime.
Apache License 2.0
507 stars 59 forks source link

golang.1.12 loader -o base.o -times 2 coredump #1

Closed pkujhd closed 5 years ago

pkujhd commented 5 years ago

rum same object multi-times, the second run coredump

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

goroutine 1 [running]:
runtime.throw(0x7c2c2e, 0x2a)
        /home/jhd/programs/go.1.12.9/src/runtime/panic.go:617 +0x72 fp=0xc0000d2b08 sp=0xc0000d2ad8 pc=0x42d2d2
runtime.sigpanic()
        /home/jhd/programs/go.1.12.9/src/runtime/signal_unix.go:374 +0x4a9 fp=0xc0000d2b38 sp=0xc0000d2b08 pc=0x4418b9
runtime.getitab(0x7f206aaed6b7, 0x7f206aaed4e5, 0x1100, 0x8)
        /home/jhd/programs/go.1.12.9/src/runtime/iface.go:67 +0x2be fp=0xc0000d2b88 sp=0xc0000d2b38 pc=0x40a0be
github.com/dearplain/goloader.Load(0xc00030a000, 0xc00009ef00, 0x400, 0x400, 0x0)
        /home/jhd/go/src/github.com/dearplain/goloader/dymcode.go:663 +0x173b fp=0xc0000d33e8 sp=0xc0000d2b88 pc=0x6dcc1b
main.main()
        /home/jhd/go/src/github.com/dearplain/goloader/examples/loader/loader.go:87 +0x1219 fp=0xc0000d3f98 sp=0xc0000d33e8 pc=0x6e8c79
runtime.main()
        /home/jhd/programs/go.1.12.9/src/runtime/proc.go:200 +0x20c fp=0xc0000d3fe0 sp=0xc0000d3f98 pc=0x42ec3c
runtime.goexit()
        /home/jhd/programs/go.1.12.9/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0000d3fe8 sp=0xc0000d3fe0 pc=0x458fe1
pkujhd commented 5 years ago

fix it on commit https://github.com/pkujhd/goloader/commit/c7171ad589be4e8750dd35e7edbd9b5cbb7d5381