About "*** stack smashing detected ***: terminated"

Hello! I’m using docker to deploy pyhton program, TestPy.so is a dynamic library

my test py:

from thirdParty import TestPy

x: int = 1
y: int = 2

print(f"{x} / {y} = ", TestPy.div1(x, y))

It runs ok in ubuntu20.04:

But when I deploying in docker, it terminaled with " *** stack smashing detected *** "
This is my Dockerfile

FROM python
COPY . /app/
ENTRYPOINT ["python3.9"]
CMD ["test.py"]

How can I solve it?

TestPy.so is probably not compatible with the Linux distribution in the container which is Debian Bullseye.
How did you build that library? If you can rebuild it, the best way to use these kind of libraries is builing them inside a container based on the same distribution as it will be used in the final container.

Since you have a very simple test command, I don’t think it is a memory resource issue.