skip to Main Content

When I run the django manage.py app, I got free(): invalid pointer error.

Example:

>python manage.py check
System check identified no issues (0 silenced).
free(): invalid pointer
Abortado (imagem do núcleo gravada)

The django app is running fine but I’m trying to get rid off this message.

How can I fix this error or get more info to debug it?

Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux (Ubuntu 20.04)
Django==2.2.28
with virtualenv

3

Answers


  1. I have tested with same environment with same Django version and I ran the check command, which did not yield this problem. I assume it is an issue with Pytorch, as mentioned in here: GitHub issue #21018.

    To resolve it, you can take the following steps (copy pasted from this SO answer: https://stackoverflow.com/a/56363390/2696165)


    There is a known issue with importing both open3d and PyTorch. A few possible workarounds exist:

    (1) Some people have found that changing the order in which you import the two packages can resolve the issue, though in my personal testing both ways crash.

    (2) Other people have found compiling both packages from source to help.

    (3) Still others have found that moving open3d and PyTorch to be called from separate scripts resolves the issue.

    Login or Signup to reply.
  2. That’s a C error related to memory freeing, probably due to a bug from some unpatched dependency package, since you’re using an old Django version.

    Some options:

    • Check your project at debug level:

      python3 manage.py check --fail-level DEBUG

    • List your dependencies and look online for which one originates that error:

      python3 -m pip freeze

    • Log files.

    Login or Signup to reply.
  3. This usually happens with external dependencies.

    You can run the check command on a specific app:

        python manage.py check app1 app2 app3 
    
    For Example:
        python manage.py check auth user myapp
    
    

    Running on any specific database is also possible.

        python manage.py check --database default --database other
    

    A few similar articles found:

    https://github.com/duckietown/apriltags3-py/issues/1

    https://github.com/googleapis/python-pubsub/issues/414

    https://bugs.python.org/issue41335

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search