I have some more information. I set the MALLOC_CHECK_ environment variable
to 3 and I got a backtrace. I have an issue open on gevent and the
backtrace with other details is here:
https://github.com/gevent/gevent/issues/808#issuecomment-221206899

It looks like a bug with how libgeos works with gunicorn using a gevent
worker. Should I report this as a django bug?

Thanks,
Tapan

On Fri, May 20, 2016 at 3:08 AM, Erik Cederstrand <erik+li...@cederstrand.dk
> wrote:

>
> > Den 19. maj 2016 kl. 22.17 skrev Tapan Pandita <tapan.pand...@gmail.com
> >:
> >
> > I am running django 1.9.4 on gunicorn19.4.5 with the gevent worker
> (gevent==1.0.2, greenlet==0.4.9). My app is deployed on heroku. For some
> requests, I have noticed this error: "*** Error in
> `/app/.heroku/python/bin/python': double free or corruption (out):
> 0x000000000403bc90 ***". I can't reproduce it deterministically, but it
> happen in about 5% of all requests. I was able to get the stack trace for
> it and everytime it's the same:
> >
> > May 19 13:50:35 <app-name> app/web.2:    File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py",
> line 125, in __del__.
> > May 19 13:50:35 <app-name> app/web.2:      capi.destroy_geom(self._ptr).
> > May 19 13:50:35 <app-name> app/web.2:    File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py",
> line 157, in __call__.
> > May 19 13:50:35 <app-name> app/web.2:      return self.func(*args,
> **kwargs).
> > May 19 13:50:35 <app-name> app/web.2:    File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/threadsafe.py",
> line 52, in __call__.
> > May 19 13:50:35 <app-name> app/web.2:      if not
> self.thread_context.handle:.
> > May 19 13:50:35 <app-name> app/web.2:    File
> "/app/.heroku/python/lib/python2.7/site-packages/gevent/local.py", line
> 173, in __getattribute__.
> > May 19 13:50:35 <app-name> app/web.2:      d =
> object.__getattribute__(self, '_local__dicts').get(getcurrent()).
> > May 19 13:50:35 <app-name> app/web.2:  *** Error in
> `/app/.heroku/python/bin/python': double free or corruption (out):
> 0x0000000003dd6470 ***
>
> This is bad. The python binary itself is crashing with a memory violation
> in C/C++ code in either Python or an external module (e.g. gevent).
> Unfortunately, your stack trace leaves no further hints about the source of
> the problem.
>
> Normally, you would compile Python and any external C modules with
> debugging symbols and attach a debugger. I don't know Heroku very well, but
> your options are probably limited. Your best bet is probably to find a
> reproducible test case and contact their support team.
>
> Erik
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/zfqG7ZR3rQE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/92EC4AAF-B11F-4215-80E3-0221875A654F%40cederstrand.dk
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMQ_VdvY6pfr5Kpzff-46yykr23%2Bh8LJ%3DTzsQwzoNM6c_%3Dmdzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to