webp-sh / webp_server_go

Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.
https://docs.webp.sh
GNU General Public License v3.0
1.83k stars 174 forks source link

WebP Server will crash when ENABLE_AVIF is set to true #175

Closed n0vad3v closed 1 year ago

n0vad3v commented 1 year ago

Describe the bug WebP Server will crash when ENABLE_AVIF is set to true

To Reproduce Enable AVIF like this and visit any image file.

{
  "HOST": "0.0.0.0",
  "PORT": "3333",
  "QUALITY": "80",
  "IMG_PATH": "./pics",
  "EXHAUST_PATH": "./exhaust",
  "ALLOWED_TYPES": ["jpg","png","jpeg","bmp"],
  "ENABLE_AVIF": true
}

Expected behavior Server behave normally.

Screenshots and logs

time="2023-02-21 07:50:56" level=debug msg="file pics/webp_server.jpg exists!" func="[67:main.imageExists()]"
fatal: morestack on g0
SIGTRAP: trace trap
PC=0x471062 m=7 sigcode=128
signal arrived during cgo execution

goroutine 34 [syscall]:
runtime.cgocall(0x78a0f0, 0xc000145290)
    /usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc000145268 sp=0xc000145230 pc=0x40f11c
github.com/Kagami/go-avif._Cfunc_avif_encode_frame(0xc000c2a120, 0xc000118150, 0xc000118180)
    _cgo_gotypes.go:91 +0x4c fp=0xc000145290 sp=0xc000145268 pc=0x5036ec
github.com/Kagami/go-avif.Encode.func3(0xc000582080?, 0xad?, 0x2e?)
    /go/pkg/mod/github.com/!kagami/go-avif@v0.1.0/avif.go:186 +0x87 fp=0xc0001452d8 sp=0xc000145290 pc=0x504467
github.com/Kagami/go-avif.Encode({0x9274a0, 0xc000014020}, {0x929960?, 0xc000582080?}, 0xc0001454e8?)
    /go/pkg/mod/github.com/!kagami/go-avif@v0.1.0/avif.go:186 +0x565 fp=0xc0001454a8 sp=0xc0001452d8 pc=0x504005
main.avifEncoder({0xc00002a090, 0x14}, {0xc0000b6240, 0x2c}, 0x42a00000)
    /build/encoder.go:111 +0x14b fp=0xc000145538 sp=0xc0001454a8 pc=0x785cab
main.convertImage({0xc00002a090, 0x14}, {0xc0000b6240, 0x2c}, {0x88e3e0, 0x4})
    /build/encoder.go:64 +0x287 fp=0xc000145618 sp=0xc000145538 pc=0x7853a7
main.convertFilter({0xc00002a090, 0x14}, {0xc0000b6240, 0x2c}, {0xc0000b6180, 0x2c}, 0x0)
    /build/encoder.go:26 +0x79 fp=0xc000145658 sp=0xc000145618 pc=0x785059
main.convert(0xc0000aa000)
    /build/router.go:68 +0x2a5 fp=0xc000145808 sp=0xc000145658 pc=0x788645
github.com/gofiber/fiber/v2.(*App).next(0xc000152900, 0xc0000aa000)
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/router.go:126 +0x1d5 fp=0xc0001458a8 sp=0xc000145808 pc=0x77c775
github.com/gofiber/fiber/v2.(*Ctx).Next(0x0?)
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/ctx.go:637 +0x53 fp=0xc0001458c8 sp=0xc0001458a8 pc=0x778553
github.com/gofiber/fiber/v2/middleware/logger.New.func2(0xc0000aa000)
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/middleware/logger/logger.go:154 +0x22b fp=0xc000145b60 sp=0xc0001458c8 pc=0x781aeb
github.com/gofiber/fiber/v2.(*App).next(0xc000152900, 0xc0000aa000)
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/router.go:126 +0x1d5 fp=0xc000145c00 sp=0xc000145b60 pc=0x77c775
github.com/gofiber/fiber/v2.(*App).handler(0xc000152900, 0x4b8057?)
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/router.go:154 +0xe7 fp=0xc000145c38 sp=0xc000145c00 pc=0x77c987
github.com/gofiber/fiber/v2.(*App).handler-fm(0x0?)
    <autogenerated>:1 +0x2c fp=0xc000145c58 sp=0xc000145c38 pc=0x7802ec
github.com/valyala/fasthttp.(*Server).serveConn(0xc000184200, {0x92b3d8?, 0xc000382008})
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/server.go:2372 +0x11d3 fp=0xc000145ec8 sp=0xc000145c58 pc=0x734933
github.com/valyala/fasthttp.(*Server).serveConn-fm({0x92b3d8?, 0xc000382008?})
    <autogenerated>:1 +0x39 fp=0xc000145ef0 sp=0xc000145ec8 pc=0x740839
github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc000143360, 0xc00039c000)
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/workerpool.go:224 +0xa9 fp=0xc000145fa0 sp=0xc000145ef0 pc=0x73dea9
github.com/valyala/fasthttp.(*workerPool).getCh.func1()
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/workerpool.go:196 +0x38 fp=0xc000145fe0 sp=0xc000145fa0 pc=0x73dc18
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000145fe8 sp=0xc000145fe0 pc=0x471201
created by github.com/valyala/fasthttp.(*workerPool).getCh
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/workerpool.go:195 +0x1b0

goroutine 1 [IO wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000149858 sp=0xc000149838 pc=0x442816
runtime.netpollblock(0xc0001718a0?, 0x40e7af?, 0x0?)
    /usr/local/go/src/runtime/netpoll.go:527 +0xf7 fp=0xc000149890 sp=0xc000149858 pc=0x43b217
internal/poll.runtime_pollWait(0x7fd9d9fde138, 0x72)
    /usr/local/go/src/runtime/netpoll.go:306 +0x89 fp=0xc0001498b0 sp=0xc000149890 pc=0x46bbc9
internal/poll.(*pollDesc).wait(0xc00017cb80?, 0x431d80?, 0x0)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32 fp=0xc0001498d8 sp=0xc0001498b0 pc=0x4c3672
internal/poll.(*pollDesc).waitRead(...)
    /usr/local/go/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc00017cb80)
    /usr/local/go/src/internal/poll/fd_unix.go:614 +0x2bd fp=0xc000149980 sp=0xc0001498d8 pc=0x4c4e3d
net.(*netFD).accept(0xc00017cb80)
    /usr/local/go/src/net/fd_unix.go:172 +0x35 fp=0xc000149a38 sp=0xc000149980 pc=0x5b8d35
net.(*TCPListener).accept(0xc000122750)
    /usr/local/go/src/net/tcpsock_posix.go:148 +0x25 fp=0xc000149a60 sp=0xc000149a38 pc=0x5cb725
net.(*TCPListener).Accept(0xc000122750)
    /usr/local/go/src/net/tcpsock.go:297 +0x3d fp=0xc000149a90 sp=0xc000149a60 pc=0x5ca97d
github.com/valyala/fasthttp.acceptConn(0xc000184200, {0x9299c0, 0xc000122750}, 0xc000149c88)
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/server.go:1931 +0x62 fp=0xc000149b70 sp=0xc000149a90 pc=0x733002
github.com/valyala/fasthttp.(*Server).Serve(0xc000184200, {0x9299c0?, 0xc000122750})
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/server.go:1824 +0x4f4 fp=0xc000149cb8 sp=0xc000149b70 pc=0x732b94
github.com/gofiber/fiber/v2.(*App).Listen(0xc000152900, {0xc00013c4d4?, 0xc000171dc8?})
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/app.go:574 +0xb5 fp=0xc000149d08 sp=0xc000149cb8 pc=0x775d15
main.main()
    /build/webp-server.go:117 +0x5ec fp=0xc000149f80 sp=0xc000149d08 pc=0x789f6c
runtime.main()
    /usr/local/go/src/runtime/proc.go:250 +0x207 fp=0xc000149fe0 sp=0xc000149f80 pc=0x4423e7
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000149fe8 sp=0xc000149fe0 pc=0x471201

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000060fb0 sp=0xc000060f90 pc=0x442816
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:387
runtime.forcegchelper()
    /usr/local/go/src/runtime/proc.go:305 +0xb0 fp=0xc000060fe0 sp=0xc000060fb0 pc=0x442650
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000060fe8 sp=0xc000060fe0 pc=0x471201
created by runtime.init.6
    /usr/local/go/src/runtime/proc.go:293 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000061780 sp=0xc000061760 pc=0x442816
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:387
runtime.bgsweep(0x0?)
    /usr/local/go/src/runtime/mgcsweep.go:319 +0xde fp=0xc0000617c8 sp=0xc000061780 pc=0x42ec7e
runtime.gcenable.func1()
    /usr/local/go/src/runtime/mgc.go:178 +0x26 fp=0xc0000617e0 sp=0xc0000617c8 pc=0x424106
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000617e8 sp=0xc0000617e0 pc=0x471201
created by runtime.gcenable
    /usr/local/go/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00008a000?, 0x9251a8?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000061f70 sp=0xc000061f50 pc=0x442816
runtime.goparkunlock(...)
    /usr/local/go/src/runtime/proc.go:387
runtime.(*scavengerState).park(0xc45c00)
    /usr/local/go/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc000061fa0 sp=0xc000061f70 pc=0x42cb73
runtime.bgscavenge(0x0?)
    /usr/local/go/src/runtime/mgcscavenge.go:633 +0x65 fp=0xc000061fc8 sp=0xc000061fa0 pc=0x42d165
runtime.gcenable.func2()
    /usr/local/go/src/runtime/mgc.go:179 +0x26 fp=0xc000061fe0 sp=0xc000061fc8 pc=0x4240a6
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000061fe8 sp=0xc000061fe0 pc=0x471201
created by runtime.gcenable
    /usr/local/go/src/runtime/mgc.go:179 +0xaa

goroutine 18 [finalizer wait]:
runtime.gopark(0x1a0?, 0xc469c0?, 0xe0?, 0x24?, 0xc000060770?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000060628 sp=0xc000060608 pc=0x442816
runtime.runfinq()
    /usr/local/go/src/runtime/mfinal.go:193 +0x107 fp=0xc0000607e0 sp=0xc000060628 pc=0x423147
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000607e8 sp=0xc0000607e0 pc=0x471201
created by runtime.createfing
    /usr/local/go/src/runtime/mfinal.go:163 +0x45

goroutine 19 [sleep]:
runtime.gopark(0x6b28c43d563?, 0xc000388f70?, 0x6c?, 0x4e?, 0x10?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000388f40 sp=0xc000388f20 pc=0x442816
time.Sleep(0x1dcd6500)
    /usr/local/go/src/runtime/time.go:195 +0x135 fp=0xc000388f80 sp=0xc000388f40 pc=0x46e075
github.com/gofiber/fiber/v2/middleware/logger.New.func1()
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/middleware/logger/logger.go:99 +0x75 fp=0xc000388fe0 sp=0xc000388f80 pc=0x784cf5
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000388fe8 sp=0xc000388fe0 pc=0x471201
created by github.com/gofiber/fiber/v2/middleware/logger.New
    /go/pkg/mod/github.com/webp-sh/fiber/v2@v2.4.0/middleware/logger/logger.go:97 +0x32c

goroutine 20 [sleep]:
runtime.gopark(0x6b090ee18a6?, 0xc00005cf88?, 0x25?, 0x24?, 0xc000143390?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005cf58 sp=0xc00005cf38 pc=0x442816
time.Sleep(0x2540be400)
    /usr/local/go/src/runtime/time.go:195 +0x135 fp=0xc00005cf98 sp=0xc00005cf58 pc=0x46e075
github.com/valyala/fasthttp.(*workerPool).Start.func2()
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/workerpool.go:67 +0x56 fp=0xc00005cfe0 sp=0xc00005cf98 pc=0x73d376
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005cfe8 sp=0xc00005cfe0 pc=0x471201
created by github.com/valyala/fasthttp.(*workerPool).Start
    /go/pkg/mod/github.com/valyala/fasthttp@v1.44.0/workerpool.go:59 +0xdd

goroutine 5 [GC worker (idle)]:
runtime.gopark(0xc000382008?, 0x0?, 0x0?, 0x0?, 0x4b8057?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005c750 sp=0xc00005c730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005c7e0 sp=0xc00005c750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005c7e8 sp=0xc00005c7e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 21 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005d750 sp=0xc00005d730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005d7e0 sp=0xc00005d750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005d7e8 sp=0xc00005d7e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 6 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000062750 sp=0xc000062730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000627e0 sp=0xc000062750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000627e8 sp=0xc0000627e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 22 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005df50 sp=0xc00005df30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005dfe0 sp=0xc00005df50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005dfe8 sp=0xc00005dfe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 23 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005e750 sp=0xc00005e730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005e7e0 sp=0xc00005e750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005e7e8 sp=0xc00005e7e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 7 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000062f50 sp=0xc000062f30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc000062fe0 sp=0xc000062f50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000062fe8 sp=0xc000062fe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 8 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000063750 sp=0xc000063730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000637e0 sp=0xc000063750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000637e8 sp=0xc0000637e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 9 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc000063f50 sp=0xc000063f30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc000063fe0 sp=0xc000063f50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000063fe8 sp=0xc000063fe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 10 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0000d2750 sp=0xc0000d2730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000d27e0 sp=0xc0000d2750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000d27e8 sp=0xc0000d27e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 11 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0000d2f50 sp=0xc0000d2f30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000d2fe0 sp=0xc0000d2f50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000d2fe8 sp=0xc0000d2fe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 12 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0000d3750 sp=0xc0000d3730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000d37e0 sp=0xc0000d3750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000d37e8 sp=0xc0000d37e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 13 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0000d3f50 sp=0xc0000d3f30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000d3fe0 sp=0xc0000d3f50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000d3fe8 sp=0xc0000d3fe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 24 [GC worker (idle)]:
runtime.gopark(0x6b28d1919c2?, 0x0?, 0x0?, 0x0?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005ef50 sp=0xc00005ef30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005efe0 sp=0xc00005ef50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005efe8 sp=0xc00005efe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 25 [GC worker (idle)]:
runtime.gopark(0x6b28d191bad?, 0x1?, 0xaf?, 0x3a?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005f750 sp=0xc00005f730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005f7e0 sp=0xc00005f750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005f7e8 sp=0xc00005f7e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 35 [GC worker (idle)]:
runtime.gopark(0xc786c0?, 0x1?, 0xce?, 0x5f?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc0000ce750 sp=0xc0000ce730 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000ce7e0 sp=0xc0000ce750 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000ce7e8 sp=0xc0000ce7e0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

goroutine 26 [GC worker (idle)]:
runtime.gopark(0x6b28d1a7463?, 0x1?, 0x28?, 0x1c?, 0x0?)
    /usr/local/go/src/runtime/proc.go:381 +0xd6 fp=0xc00005ff50 sp=0xc00005ff30 pc=0x442816
runtime.gcBgMarkWorker()
    /usr/local/go/src/runtime/mgc.go:1275 +0xf1 fp=0xc00005ffe0 sp=0xc00005ff50 pc=0x425c71
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00005ffe8 sp=0xc00005ffe0 pc=0x471201
created by runtime.gcBgMarkStartWorkers
    /usr/local/go/src/runtime/mgc.go:1199 +0x25

rax    0x17
rbx    0x8965d9
rcx    0x472a55
rdx    0x17
rdi    0x2
rsi    0x8965d9
rbp    0x7fd9d9ef8270
rsp    0x7fd9d9ef8248
r8     0x7fd9d9ef8840
r9     0xf138f9e1
r10    0xb50f4b0
r11    0x246
r12    0x7fd9d97ee280
r13    0x7fd9d97ee240
r14    0xc0001036c0
r15    0x7fd9d97ee1c0
rip    0x471062
rflags 0x206
cs     0x33
fs     0x0
gs     0x0

Environment (please complete the following information):

Additional context Using binary will not produce this kind of error on my development machine, might be problem with alpine.

libaom-3.2.0-5.fc.x86_64
libaom-devel-3.2.0-5.fc.x86_64
BennyThink commented 1 year ago
Webp Server Go - v0.5.0
Develop by WebP Server team. https://github.com/webp-sh

Webp Server Go is Running on http://0.0.0.0:3333
17:59:52 | 200 |     1ms |       127.0.0.1 | GET     | /1.png
18:00:03 | 200 |      0s |       127.0.0.1 | GET     | /1.png
18:00:31 | 200 |      0s |       127.0.0.1 | GET     | /1.png
INFO[2023-03-02 18:00:58][152:main.convertLog()] AVIF@80.00%: /opt/pics/1.png->exhaust/1.png.1675711056.avif 85214->31584 37.06% deflated
INFO[2023-03-02 18:00:58][152:main.convertLog()] WebP@80.00%: /opt/pics/1.png->exhaust/1.png.1675711056.webp 85214->21766 25.54% deflated
18:00:58 | 200 |  3.323s |       127.0.0.1 | GET     | /1.png
^C
root@9fce2b1fb590:~# cat /etc/config.json
{
  "HOST": "0.0.0.0",
  "PORT": "3333",
  "QUALITY": "80",
  "IMG_PATH": "/opt/pics",
  "EXHAUST_PATH": "./exhaust",
  "ALLOWED_TYPES": ["jpg","png","jpeg","bmp"],
  "ENABLE_AVIF": true
}

consider it as fixed.