goccy / go-json

Fast JSON encoder/decoder compatible with encoding/json for Go
MIT License
3.11k stars 148 forks source link

Panic with .so files #522

Open ruauka opened 1 month ago

ruauka commented 1 month ago

Hello. I get a panic when i call my app from a compiled .so file on linux. Panic even with empty json. OS - Linux (corp build), let's say - CentOS. Go - 1.22.7 CMD - go build -buildmode=c-shared -o execute.so main.go

failed call user function, error in function: runtime error: index out of range [576456392026449311] with length 23278. File: /app/vendor/github.com/goccy/go-json/internal/decoder/compile_norace.go:19

The goal is to execute the Go script in the Python environment. I have a go-logic and CGO script to call this logic. I go get this logic in this script as a library and compile with CMD above in execute.so. This execute.so i call from Python script using ctypes library.

The problem is relevant only on Linux, on MAC(amd64) all works.